Why it matters
Bellman-Ford handles negatives. Understanding shapes shortest-path options.
Advertisement
The architecture
Relax all edges V-1 times.
V-th iteration change indicates negative cycle.
Advertisement
How it works end to end
SPFA: queue-based variant. Often faster in practice but same worst case.
Applications: negative weight graphs, arbitrage detection, currency exchange.
Cycle detection: essential for correctness.