Bellman–Ford algorithm: Difference between revisions

Content deleted Content added
Jaredwf (talk | contribs)
simplified categories
No edit summary
Line 16:
for each edge (u,r) in G do
if Distance(r) > Distance(u) + w(u,r);
return false; //This means that the graph contains a cycle of negative weight
//and the shortest paths are not well defined
return true; //Lengths of shortest paths are in Distance array