Groups
Category
Dijkstra's algorithm finds shortest path distances from one source to all vertices when all edge weights are non-negative.
Dijkstraโs algorithm can be adapted to track the second shortest path by keeping the best and second-best distances per vertex.