Abstract
We describe a new algorithm to enumerate the k shortest simple (loopless) paths in a directed graph and report on its implementation. Our algorithm is based on a replacement paths algorithm proposed by Hershberger and Suri [2001], and can yield a factor Θ(n) improvement for this problem. But there is a caveat: The fast replacement paths subroutine is known to fail for some directed graphs. However, the failure is easily detected, and so our k shortest paths algorithm optimistically uses the fast subroutine, then switches to a slower but correct algorithm if a failure is detected. Thus, the algorithm achieves its Θ(n) speed advantage only when the optimism is justified. Our empirical results show that the replacement paths failure is a rare phenomenon, and the new algorithm outperforms the current best algorithms; the improvement can be substantial in large graphs. For instance, on GIS map data with about 5,000 nodes and 12,000 edges, our algorithm is 4--8 times faster. In synthetic graphs modeling wireless ad hoc networks, our algorithm is about 20 times faster.
- Brander, A., and Sinclair, M. 1995. A comparative study of K-shortest path algorithms. In Proceedings of 11th UK Performance Engineering Workshop, 370--379.Google Scholar
- Dial, R., Glover, F., Karney, D., and Klingman, D. 1979. A computational analysis of alternative algorithms and labeling techniques for finding shortest path trees. Netw. 9, 3, 215--248.Google ScholarCross Ref
- Eppstein, D. 1998. Finding the k shortest paths. SIAM J. Comput. 28, 2, 652--673. Google ScholarDigital Library
- Fox, B. L. 1975. k-th shortest paths and applications to the probabilistic networks. In Proceedings of the ORSA/TIMS Joint National Meeting 23, B263.Google Scholar
- Fredman, M. 1976. New bounds on the complexity of the shortest path problem. SIAM J. Comput. 5, 83--89.Google ScholarDigital Library
- Fredman, M., and Tarjan, R. 1987. Fibonacci heaps and their uses in improved network optimization algorithms. J. ACM 34, 596--615. Google ScholarDigital Library
- Hadjiconstantinou, E., and Christofides, N. 1999. An efficient implementation of an algorithm for finding K shortest simple paths. Netw. 34, 2, 88--101.Google ScholarCross Ref
- Hershberger, J., and Suri, S. 2001. Vickrey prices and shortest paths: What is an edge worth? In Proceedings of the 42nd Annual IEEE Symposium on Foundations of Computer Science (FOCS), 252--259. Google ScholarDigital Library
- Hershberger, J., and Suri, S. 2002. Erratum to “Vickrey prices and shortest paths: What is an edge worth?”. In Proceedings of the 43rd Annual IEEE Symposium on Foundations of Computer Science (FOCS), 809. Google ScholarDigital Library
- Hershberger, J., Suri, S., and Bhosle, A. 2007. On the difficulty of some shortest path problems. ACM Trans. Alg. 3, 1, Article 5. http://doi.acm.org/10.1145/1219944.1219951. Google ScholarDigital Library
- Hoffman, W., and Pavley, R. 1959. A method for the solution of the Nth best path problem. J. ACM 6, 506--514. Google ScholarDigital Library
- Jiménez, V. M., and Marzal, A. 2003. A lazy version of Eppstein's K shortest paths algorithm. In Proceedings of the 2nd International Workshop on Experimental and Efficient Algorithms (WEA). Lecture Notes in Computer Science, vol. 2647. Springer, 179--190. Google ScholarDigital Library
- Katoh, N., Ibaraki, T., and Mine, H. 1982. An efficient algorithm for k shortest simple paths. Netw. 12, 411--427.Google ScholarCross Ref
- Lawler, E. L. 1972. A procedure for computing the K best solutions to discrete optimization problems and its application to the shortest path problem. Manag. Sci. 18, 401--405.Google ScholarCross Ref
- Malik, K., Mittal, A. K., and Gupta, S. K. 1989. The k most vital arcs in the shortest path problem. Oper. Res. Lett. 8, 223--227.Google ScholarDigital Library
- Martins, E., and Pascoal, M. 2003. A new implementation of Yen's ranking loopless paths algorithm. 4OR Quart. J. Belgian, French, Italian Oper. Res. Soc. 1, 2, 121--134.Google Scholar
- Martins, E., Pascoal, M., and Santos, J. 1997. A new algorithm for ranking loopless paths. Tech. Rep. Universidade de Coimbra, Portugal.Google Scholar
- Perko, A. 1986. Implementation of algorithms for K shortest loopless paths. Netw. 16, 149--160.Google ScholarCross Ref
- Pollack, M. 1961. The kth best route through a network. Oper. Res. 9, 578.Google ScholarDigital Library
- Seidel, R. 1995. On the all-pairs-shortest-path problem in unweighted undirected graphs. Journal of Comput. Syst. Sci. 51, 3, 400--403. Google ScholarDigital Library
- Yen, J. Y. 1971. Finding the K shortest loopless paths in a network. Manag. Sci. 17, 712--716.Google ScholarDigital Library
- Yen, J. Y. 1972. Another algorithm for finding the K shortest loopless network paths. In Proceedings of the 41st Meeting of the Operations Research Society of America, vol. 20.Google Scholar
- Zwick, U. 2002. All pairs shortest paths using bridging sets and rectangular matrix multiplication. J. ACM 49, 3, 289--317. Google ScholarDigital Library
Index Terms
- Finding the k shortest simple paths: A new algorithm and its implementation
Recommendations
Improved algorithms for the k simple shortest paths and the replacement paths problems
Given a directed, non-negatively weighted graph G=(V,E) and s,t@?V, we consider two problems. In the k simple shortest paths problem, we want to find the k simple paths from s to t with the k smallest weights. In the replacement paths problem, we want ...
Finding k shortest simple paths in directed graphs: A node classification algorithm
We propose a new exact algorithm for enumerating k shortest simple paths in a directed graph with n nodes and m edges. The algorithm has a complexity of Oknm+nlogn and follows the same process as Yen's deviation algorithm, but the candidate paths are ...
Finding non-dominated bicriteria shortest pairs of disjoint simple paths
In this paper we introduce a method to compute non-dominated bicriteria shortest pairs, each including two disjoint simple paths. The method is based on an algorithm for ranking pairs of disjoint simple paths by non-decreasing order of cost, that is an ...
Comments