🎉 October Learning Month — learn a new software term every day!
An interactive flashcard trainer for software engineering terms.

Bellman Ford

In plain terms

A shortest-path algorithm that handles negative edge weights.

Going deeper

Bellman-Ford relaxes all edges repeatedly to find shortest paths even with negative weights, and can detect negative cycles. It's slower than Dijkstra but more general.

Under the hood

O(V·E) time; detects negative-weight cycles, which Dijkstra can't handle.

Examples

Currency arbitrage detection, routing with penalties, negative-weight graphs.

Think of it like...

Like patiently recalculating travel costs over and over until no route gets cheaper.

Feedback & Bug Report