Beruflich Dokumente
Kultur Dokumente
Page 1 of 5
Bellman-Ford's algorithm
The Bellman-Ford's algorithm works in more general case than the Dijkstra's algorithm. It can be applied to the
negative-weight graph
If there is a negative cycle that is reacheable from the source, the the Bellman-Ford's algorithm indicates that
there is no solution; otherwise, it gives the shortest paths. In either case, it runs in time
.
The Bellman-Ford's algorithm is based on the concept feasible potential . We call
potential if it satisfies:
a feasible
If we find a feasible potential, we also obtain the shortest paths, with the feasible potential being the shortest
path weight from the source to the node . has feasible potential if and only if it has no negative-weight
dicircuit.
The Bellman-Ford's algorithm first initialize the sets
If
and
Correct
, and
where
steps.
http://www.ece.nwu.edu/~guanghui/Transportation/spt/section3_2.html
8/8/2002
Bellman-Ford's algorithm
Page 2 of 5
Using the example at the front page, we apply the Bellman-Ford's algorithm to it, and show the precedure step
by step. For each node, We use the box to indicate tits value, and the cycle to denotes its .
http://www.ece.nwu.edu/~guanghui/Transportation/spt/section3_2.html
8/8/2002
Bellman-Ford's algorithm
http://www.ece.nwu.edu/~guanghui/Transportation/spt/section3_2.html
Page 3 of 5
8/8/2002
Bellman-Ford's algorithm
http://www.ece.nwu.edu/~guanghui/Transportation/spt/section3_2.html
Page 4 of 5
8/8/2002
Bellman-Ford's algorithm
Page 5 of 5
At the last step, the values in boxes is a feasible potential, it indicates the shortest path weight from to every
node.
guanghui@
Sun Jun 2 22:04:53 CDT 1996
http://www.ece.nwu.edu/~guanghui/Transportation/spt/section3_2.html
8/8/2002