Please wait
Loading technology simulations
The requested content is still loading.
Finished experimenting?
Save one completion to this browser's signed guest ledger, or directly to your account when signed in.
Please wait
Loading technology simulations
The requested content is still loading.
Save one completion to this browser's signed guest ledger, or directly to your account when signed in.
1dist[src] = 0, rest = ∞2while unsettled nodes remain:3 u = unsettled node with min dist // priority queue4 for (v, w) in edges(u): if dist[u]+w < dist[v]:5 dist[v] = dist[u]+w; prev[v] = u // relax
This Dijkstra simulator runs single-source shortest paths on a weighted node-link graph, so the greedy heart of the algorithm is visible. Each step extracts the unsettled node with the smallest tentative distance (the priority-queue frontier), settles it in green, then relaxes its edges — an edge lights amber, and if dist[u] + weight beats the neighbour's current distance the neighbour flashes green and its label drops. Distance labels sit above every node, a live table tracks all distances and how many are settled, and the final shortest-path tree is highlighted. A cost card contrasts scanning all nodes (O(V²)) with a binary-heap priority queue (O((V+E) log V)). The signature interaction: Predict mode pauses before each extract-min and asks you to click the node you think is settled next — the one with the smallest distance.
dijkstra's algorithm · shortest path · weighted graph · priority queue · edge relaxation · greedy algorithm · O((V+E) log V)
Browse all Technology simulations →
Free to use in your browser — no signup required. Found a bug or have an idea to make it better? Tell us.