Test case where Bellman-ford must go till (V-1)th iteration to give the right answer?

Revision en1, by Sportsman, 2020-08-27 00:35:08

I recently came across the Bellman-ford algorithm and tried to understand the intuition behind, why the Bellman-Ford algorithm takes atmost V-1 iterations to give the correct ouput. It would be helpful if you could share the reason or probably a test case or both, so that i can do a dry run to digest it. Thanks!

Tags graphs, bellman-ford

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Sportsman 2020-08-27 00:35:08 400 Initial revision (published)