← Back to Learn

Dijkstra's Shortest Path

Find the shortest path between two nodes in a weighted graph. Step through the algorithm to see how the priority queue explores nodes in order of increasing distance.

286982518A0srcBCDEFdstunvisitedfrontiercurrentvisitedpath
0/14
speed
6
nodes
9
edges
dist F
0
visited
nodes 6
seed ⓘ 42
visit
Initialize: set dist[A] = 0, all others ∞. Add source to priority queue.
complexity
O((V+E) log V)

© 2026 Dantzig. Optimisation made accessible.

Powered by HiGHS