the interestingand possibly even little surprisingaspect of the dijkstra algorithm is thatat the moment vertex is pulled into cits label [ustores the correct length of shortest path from to thuswhen the algorithm terminatesit will have computed the shortest-path distance from to every vertex of that isit will have solved the single-source shortest path problem it is probably not immediately clear why dijkstra' algorithm correctly finds the shortest path from the start vertex to each other vertex in the graph why is it that the distance from to is equal to the value of the label [uat the time vertex is pulled into the cloud (which is also the time is removed from the priority queue )the answer to this question depends on there being no negative-weight edges in the graphfor it allows the greedy method to work correctlyas we show in the proposition that follows