Groups
Category
Level
Dijkstraโs algorithm can be adapted to track the second shortest path by keeping the best and second-best distances per vertex.
0-1 BFS is a shortest path algorithm specialized for graphs whose edge weights are only 0 or 1.