Bellman-Ford algorithm

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2023 Oct 31 6:48
Editor
Edited
Edited
2023 Nov 2 7:37

Even with negative weight cycle

notion image
  • Relaxation sequence is decided in for loop which means it can be started from arbitrary.
  • Relaxation steps can be failed until both vertex is not infinity
  • If not converge, which means negative-weight cycle in graph (still existing condition). After that it reports negative-weight cycle existence.
  • The iteration value is because all relaxation posibility which are proven.
 
 
 
 

Proof

Shortest path must be a simple path which does not has cycle. And biggest simple path length si . That is whey iteration is enough to find all shortest path.
notion image
notion image
 
 
 
 
 
 

Recommendations