Dijkstra's shortest path animated: settle the closest node, relax its edges, watch distances improve — with a live distance table and pseudocode.
Tip: use samples, upload, copy, download, and send-to actions inside the workspace where available.
Dijkstra's Algorithm Visualizer animates the single-source shortest path algorithm on a weighted graph: the closest unsettled node is picked, its edges are relaxed one at a time, and the distance table updates in front of you. The part students usually miss — that relaxation only ever improves a distance, and that a node is final the moment it is settled — is exactly the part this makes visible, because you watch tentative distances shrink and then freeze.
Bellman-Ford relaxes every edge repeatedly and detects negative cycles.
Open toolinit: dist[A] = 0, every other dist = ∞ · priority queue: A(0)
| node | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| dist[v] | 0 | ∞ | ∞ | ∞ | ∞ | ∞ | ∞ |
| prev[v] | — | · | · | · | · | · | · |
| status | frontier | unseen | unseen | unseen | unseen | unseen | unseen |
1Dijkstra from A: always settle the closest unsettled node — with non-negative weights its distance can never improve again.
dist[start] = 0, rest ∞while unsettled nodes remain:u = closest unsettled; settle itfor each edge (u, v, w):if dist[u]+w < dist[v]: updatedist[] holds shortest distances
Settle the closest unsettled node, relax its edges, repeat. Correct only with non-negative weights (else Bellman-Ford).