← Back to Index

⚖️ Bellman-Ford

Single-Source Shortest Paths · Negative Edges + Cycle Detection
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.