0
Pass
-
Current Edge
0
Relaxations
No
Negative Cycle
Ready
Status
Current edge being relaxed
Distance improved
Negative cycle witness edge
Current shortest-path tree edge
Distance Table
How It Works
Bellman-Ford relaxes every directed edge exactly V - 1 times. If any edge can still improve a distance on the next pass, the graph contains a reachable negative cycle.
- Each pass scans the full edge list in order.
- A relaxation happens when
dist[u] + w < dist[v]. - The extra final pass is used only for negative-cycle detection.