Dijkstra finds shortest paths fast, but it breaks when edges have negative weights. The greedy assumption that once you process a node, its distance is final, stops working. Bellman-Ford handles negative weights correctly by relaxing all edges multiple times. It also detects negative cycles, which Dijkstra cannot do. These cycles make shortest paths undefined because you can loop forever to reduce the cost.
In this section, I'll show you how Bellman-Ford works, when to use it instead of Dijkstra, and how to detect and extract negative cycles. You will solve problems involving maximum paths, currency arbitrage, and constrained shortest paths.