43224315423ABCDEFGH
AlgoPlus//structures / bellman-ford
Read the theory

Bellman-Ford

Relax every edge V−1 times — handles negative weights.

Stability
In-Place
Space Complexity
Avg Time
Source
Legend
Current
Frontier
Visited
Path / MST
AI Tutor Workspace
In a nutshell
Bellman-Ford finds shortest paths from one start node even when edges can have negative weights, which Dijkstra cannot handle. It simply relaxes every edge over and over — V−1 full passes are always enough for the distances to settle. If one more pass still improves something, that proves a negative cycle exists and no shortest path is well-defined.
Ready
Press play to begin the cinematic walkthrough.
Relax every edge V−1 times. Slower than Dijkstra, but it handles negative edge weights (and detects negative cycles).
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Bellman-Ford.