Isn't Dijkstra's Algorithm used for finding the shortest distance from the source vertex to a target vertex? In this problem there isn't a designated target, because it must visit all vertices, and a different target may result in a shorter distance.