← Back to All Algorithms
🛤️ Dijkstra's Shortest Path Algorithm
How It Works
Dijkstra finds the shortest path from a source to all other vertices:
Initialize distances: source = 0, all others = ∞
Extract vertex with minimum distance from priority queue
Relax
all edges: if d[u] + weight(u,v) < d[v], update d[v]
Repeat until all vertices are processed
Click "Start" to run Dijkstra from node S
Distance Table
Node
Distance
Previous
Priority Queue
Reset
▶ Start
Step →