Near-shortest and K-shortest simple paths

  • Authors:
  • W. Matthew Carlyle;R. Kevin Wood

  • Affiliations:
  • Department of Operations Research, Naval Postgraduate School, Monterey, California 93943;Department of Operations Research, Naval Postgraduate School, Monterey, California 93943

  • Venue:
  • Networks
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present a new algorithm for enumerating all near-shortest simple (loopless) s-t paths in a graph G = (V, E) with nonnegative edge lengths. Letting n = |V| and m = |E|, the time per path enumerated is O(nS(n, m)) given a user-selected shortest-path subroutine with complexity O(S(n, m)). When coupled with binary search, this algorithm solves the corresponding K-shortest paths problem (KSPR) in O(KnS(n, m)(log n+ log cmax)) time, where cmax is the largest edge length. This time complexity is inferior to some other algorithms, but the space complexity is the best available at O(m). Both algorithms are easy to describe, to implement and to extend to more general classes of graphs. In computational tests on grid and road networks, our best polynomial-time algorithm for KSPR appears to be at least an order of magnitude faster than the best algorithm from the literature. However, we devise a simpler algorithm, with exponential worst-case complexity, that is several orders of magnitude faster yet on those test problems. A minor variant on this algorithm also solves “KSPU,” which is analogous to KSPR but with loops allowed. © 2005 Wiley Periodicals, Inc. NETWORKS, Vol. 46(2), 98–109 2005