Bellman-Ford Algorithm

The Bellman-Ford algorithm computes shortest paths from a source vertex to all other vertices in a weighted graph. Unlike Dijkstra's algorithm, Bellman-Ford can handle graphs with negative weight edges and detect negative weight cycles.

This visualization demonstrates the Bellman-Ford algorithm on a graph with vertices A, B, C, and D, with some negative edges.

Iteration: 0 of 4
Initializing: Set distance to source A as 0 and all others as infinity
Vertex A B C D
Distance 0
Previous - - - -