Find the shortest paths from source 0 to all
other nodes using Dijkstra’s Algorithm.
Show every step of building the tree.
Attachments:
![](https://hi-static.z-dn.net/files/d07/58208ddc2f840732057b7202245d44b3.jpg)
Answers
Answered by
3
Pick the vertex with minimum distance value and not already included in SPT (not in sptSET). The vertex 1 is picked and added to sptSet. So sptSet now becomes {0, 1}. Update the distance values of adjacent vertices of 1. The distance value of vertex 2 becomes 12.
Pick the vertex with minimum distance value and not already included in SPT (not in sptSET). Vertex 7 is picked. So sptSet now becomes {0, 1, 7}. Update the distance values of adjacent vertices of 7. The distance value of vertex 6 and 8 becomes finite (15 and 9 respectively).
Similar questions