Finding the shortest path between two points in a graph is a classic algorithms question with many good answers (Dijkstra\'s algorithm, Bellman-Ford, etc.) My question is w
You're looking for Yen's algorithm for finding K shortest paths. The kth shortest path will then be the last path in that set.
K
k
Here's an implementation of Yen's algorithm.
And here's the original paper describing it.