Dijkstra's Algorithm Step-by-Step
Flowcharts & Algorithms diagram · made in Skemio

What it shows
- Uses a priority queue (min-heap) to extract the nearest unvisited node.
- Relaxes edge weights: dist[v] = min(dist[v], dist[u] + weight).
- Requires non-negative weights; runs in O((V + E) log V) with heaps.
The takeaway
Dijkstra is greedy relaxation: visit the closest unvisited node, update its neighbors, and repeat.
- #dijkstra
- #algorithms
- #graphtheory
- #compsci
- #programming





