Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7fb8ec9

Browse files
added figure for bellman ford. renamed to readme
1 parent 9b461b4 commit 7fb8ec9

File tree

1 file changed

+9
-3
lines changed
  • Competitive Coding/Graphs/Shortest Path/Bellman Ford

1 file changed

+9
-3
lines changed
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
Bellman Ford Algorithm:-
1+
## Bellman Ford Algorithm
22

3-
Description:-
3+
#### Description
44
This is a dynamic programming based algorithm, this algorithm gives shortest distance from a particular source in a graph to all its other vertices.
55

6-
Working:-
6+
---------
7+
![](http://users.informatik.uni-halle.de/~jopsi/dssea/bellman_ford.gif)
8+
9+
-----------
10+
#### Working
711
We initialize the distance of source as '0' and all other vertices as 'INFINITE'. Now if the number of vertices in a graph is 'V' , then all the vertices are processed 'V-1' times, at each iteration for an edge 'uv' if 'dist[v]>dist[u]+weight of uv' , then update dist[v]=dist[u]+weight of uv.
12+
13+
[More info](https://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /