An Experimental Study on Approximating K Shortest Simple Paths

  • Asaf Frieder
  • Liam Roditty
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6942)


We have conducted an extensive experimental study on approximation algorithms for computing k shortest simple paths in weighted directed graphs. Very recently, Bernstein [2] presented an algorithm that computes a 1 + ε approximated k shortest simple paths in O(ε − 1 k(m + nlogn)log2 n) time. We have implemented Bernstein’s algorithm and tested it on synthetic inputs and real world graphs (road maps). Our results reveal that Bernstein’s algorithm has a practical value in many scenarios. Moreover, it produces in most of the cases exact paths rather than approximated. We also present a new variant for Bernstein’s algorithm. We prove that our new variant has the same upper bounds for the running time and approximation as Bernstein’s original algorithm. We have implemented and tested this variant as well. Our testing show that this variant, which is based on a simple theoretical observation, is better than Bernstein’s algorithm in practice.


Short Path Simple Path Naive Algorithm Weighted Directed Graph Replacement Path 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Aingworth, D., Chekuri, C., Indyk, P., Motwani, R.: Fast estimation of diameter and shortest paths (without matrix multiplication). SIAM J. Comput. 28(4), 1167–1181 (1999)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Bernstein, A.: A nearly optimal algorithm for approximating replacement paths and k shortest simple paths in general graphs. In: Proc. of 21st SODA, pp. 742–755 (2010)Google Scholar
  3. 3.
    Brander, A.W., Sinclair, M.C.: A comparative study of k-shortest path algorithms. In: Proc. 11th UK Performance Engineering Worksh. for Computer and Telecommunications Systems (September 1995)Google Scholar
  4. 4.
    Demetrescu, C., Thorup, M., Chowdhury, R., Ramachandran, V.: Oracles for distances avoiding a failed node or link. SIAM J. Comput. 37(5), 1299–1318 (2008)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Dor, D., Halperin, S., Zwick, U.: All-pairs almost shortest paths. SIAM J. Comput. 29(5), 1740–1759 (2000)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Eppstein, D.: Finding the k shortest paths. SIAM Journal on Computing 28(2), 652–673 (1998)MathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    Gotthilf, Z., Lewenstein, M.: Improved algorithms for the k simple shortest paths and the replacement paths problems. Inf. Process. Lett. 109(7), 352–355 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  8. 8.
    Hadjiconstantinou, E., Christofides, N.: An efficient implementation of an algorithm for finding K shortest simple paths. Networks 34(2), 88–101 (1999)MathSciNetCrossRefzbMATHGoogle Scholar
  9. 9.
    Hershberger, J., Maxel, M., Suri, S.: Finding the k shortest simple paths: A new algorithm and its implementation. ACM Transactions on Algorithms 3, 45 (2007)MathSciNetCrossRefGoogle Scholar
  10. 10.
    Hershberger, J., Suri, S.: Vickrey prices and shortest paths: what is an edge worth? In: Proc. of 42nd FOCS, pp. 252–259 (2001)Google Scholar
  11. 11.
    Katoh, N., Ibaraki, T., Mine, H.: An efficient algorithm for K shortest simple paths. Networks 12(4), 411–427 (1982)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Lawler, E.L.: A procedure for computing the K best solutions to discrete optimization problems and its application to the shortest path problem. Management Science 18, 401–405 (1971/1972)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Martins, E., Pascoal, M., Esteves dos Santos, J.: Deviation algorithms for ranking shortest paths. Int. J. Found. Comp. Sci. 10(3), 247–263 (1999)MathSciNetCrossRefzbMATHGoogle Scholar
  14. 14.
    Perko, A.: Implementation of algorithms for K shortest loopless paths. Networks 16, 149–160 (1986)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    Roditty, L.: On the k shortest simple paths problem in weighted directed graphs. SIAM Journal on Computing, 2363–2376 (2010)Google Scholar
  16. 16.
    Roditty, L., Zwick, U.: Replacement paths and k simple shortest paths in unweighted directed graphs. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C., Yung, M. (eds.) ICALP 2005. LNCS, vol. 3580, pp. 249–260. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  17. 17.
    Vassilevska Williams, V., Williams, R.: Subcubic equivalences between path, matrix and triangle problems. In: Proc. FOCS (2010)Google Scholar
  18. 18.
    Vassilevska Williams, V.: Faster replacement paths. In: Proc. of 22th SODA (2011)Google Scholar
  19. 19.
    Yen, J.Y.: Finding the K shortest loopless paths in a network. Management Science 17, 712–716 (1970/1971)MathSciNetCrossRefzbMATHGoogle Scholar
  20. 20.
    Zwick, U.: All pairs shortest paths using bridging sets and rectangular matrix multiplication. JACM 49(3), 289–317 (2002)MathSciNetCrossRefzbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Asaf Frieder
    • 1
  • Liam Roditty
    • 1
  1. 1.Department of Computer ScienceBar-Ilan UniversityRamat-GanIsrael

Personalised recommendations