Bellman–Ford algorithm: Difference between revisions

Content deleted Content added
Andris (talk | contribs)
finished correctness proof
occurance->occurrence(x2)
Line 36:
'''End of proof.'''
 
The correctness of the algorithm follows from the lemma together with the observation that shortest path between any two vertices must contain at most ''V(G)'' edges. (If a path contained more than ''V(G)'' edges, it must contain some vertex ''v'' twice. Then, it can be shortened by removing the part between the first occuranceoccurrence of ''v'' and the second occuranceoccurrence. This means that it was not the shortest path.)
 
== Applications in routing ==