Dijkstra’s S.P. Body
Dijkstra’s S.P. Body
Find the element y of FRINGE_SET with minimum weight;
Add the vertex y, and edge [y,parent[y]] to S.P. tree;
Remove y from FRINGE_SET;
For all vertices z adjacent to y do
If z is not in FRINGE_SET then
Add z to FRINGE_SET;
Set weight(z) to weight([y,z]) + weight(y);
Set Parent[z] to y;
Else
if weight(y) + weight([y,z]) < weight(z) then
Set weight(z) to weight(y) + weight([y,z]);
Set Parent[z] to y;
End If
End If
End For