Expand description
The K shortest loopless paths between two vertices by Yen’s algorithm (SciPy’s yen).
See the book entry Matchings, k shortest paths and Laplacians.
Functions§
- yen
- The
kshortest loopless paths fromsourcetosink, shortest first, as(length, vertices)(SciPy’syen). Yen’s algorithm takes each path found so far and, for every vertex on it (the spur), finds the shortest path from the spur that leaves the common prefix differently from every path already found, avoiding the prefix’s vertices; the best of these candidates is the next path. Weights must be non-negative. Fewer thankpaths are returned if fewer exist.