Dijkstra's Shortest Path Algorithm
Greedy single-source shortest paths with non-negative weights
Click "Next Step" or press → to begin
Distance Table
Priority Queue (min by d[])
Pseudocode
Source
Current (Extract-Min)
Finalized (in S)
Unvisited
Shortest-path edge
Reset
← Previous
Next Step →
Auto Play