Home▸Algorithms & AI▸Bellman-Ford Algorithm: Shortest Paths with Negative Weights

Bellman-Ford Algorithm: Shortest Paths with Negative Weights

A flat map of the Bellman-Ford algorithm on a weighted directed graph with negative edges: one edge test per step, live distance badges, the predecessor tree and a plot of every distance estimate after each pass. Same shared model and numerical checks as the 3D version.

Algorithms & AI2DModerate60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
Bellman-Ford Algorithm: Shortest Paths with Negative Weights ↗ Open standalone

Watch Bellman-Ford relax every edge of a weighted directed graph, pass after pass. Distance estimates grow as columns on pedestals, the amber pipe is the edge under test, cyan pipes form the shortest-path tree, and a reachable negative cycle is traced in red. Change the graph, the scanning order, a global weight shift and the source vertex, with live relaxation counts and numerical checks against Floyd-Warshall and Dijkstra. Board, pedestals and flag modelled in Blender.

⚙ Under the hood

A flat map of the Bellman-Ford algorithm on a weighted directed graph with negative edges: one edge test per step, live distance badges, the predecessor tree and a plot of every distance estimate after each pass. Same shared model and numerical checks as the 3D version.

Bellman-FordShortest PathGraph AlgorithmsNegative CycleEdge Relaxation

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)