Algorithms, Programming, Interview, Python.
this set is empty. Initialize all vertices in the input graph with an infinite distance value. Assign the distance value as 0 for the source vertex so that it is picked first. While SPT doesn’t include all vertices: 1. Pick a vertex u which is not there in SPT and has a minimum distance value. 2.