DIJKSTRA (G, w, s)
- INITIALIZE SINGLE-SOURCE (G, s)
- S ← { } // S will ultimately contains vertices of final shortest-path weights from s
- Initialize priority queue Q i.e., Q ← V[G]
- while priority queue Q is not empty do
- u ← EXTRACT_MIN(Q) // Pull out new vertex
- S ← S È {u}
// Perform relaxation for each vertex v adjacent to u - for each vertex v in Adj[u] do
- Relax (u, v, w)
Above is the algorithm for dijkstra’s minimum path. Click below for more…