Skip to main content

All Pairs Shortest Paths in Sparse Graphs

2004; Pettie

  • Reference work entry
  • 663 Accesses

Keywords and Synonyms

Shortest route; Quickest route        

Problem Definition

Given a communications network or road network one of the most natural algorithmic questions is how to determine the shortest path from one point to another. The all pairs shortest path problem (APSP) is, given a directed graph \( { G=(V,E,\ell) } \), to determine the distance and shortest path between every pair of vertices, where \( { |V|=n, |E|=m, } \) and \( { \ell\colon E\rightarrow \mathbb{R} } \) is the edge length (or weight) function. The output is in the form of two \( { n\times n } \) matrices: D(u, v) is the distance from u to v and \( { S(u,v) = w } \) if (u, w) is the first edge on a shortest path from u to v. The APSP problem is often contrasted with the point-to-point and single source (SSSP) shortest path problems. They ask for, respectively, the shortest path from a given source vertex to a given target vertex, and all shortest paths from a given source vertex.

Definition of Distance

If ℓ assigns...

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   399.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    If all edges have length −1 then \( { D(u,v) = -(n-1) } \) if and only if G contains a Hamiltonian path [7] from u to v.

  2. 2.

    The fastest known \( { (\min,+) } \) matrix multiplier runs n \( O(n^3(\log \log n)^3/(\log n)^2) \) time [3].

Recommended Reading

  1. Aho, A.V., Hopcroft, J.E., Ullman, J.D.: The design and analysis of computer algorithms. Addison‐Wesley, Reading (1975)

    Google Scholar 

  2. Bast, H., Funke, S., Matijevic, D., Sanders, P., Schultes, D.: In transit to constant shortest-path queries in road networks. In: Proc. 9th Workshop on Algorithm Engineering and Experiments (ALENEX), 2007

    Google Scholar 

  3. Chan, T.: More algorithms for all-pairs shortest paths in weighted graphs. In: Proc. 39th ACM Symposium on Theory of Computing (STOC), 2007, pp. 590–598

    Google Scholar 

  4. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms. MIT Press, Cambridge (2001)

    MATH  Google Scholar 

  5. Demetrescu, C., Goldberg, A.V., Johnson, D.: 9th DIMACS Implementation challenge – shortest paths. http://www.dis.uniroma1.it/~challenge9/ (2006)

  6. Fredman, M.L.: New bounds on the complexity of the shortest path problem. SIAM J. Comput. 5(1), 83–89 (1976)

    Article  MathSciNet  MATH  Google Scholar 

  7. Garey, M.R., Johnson, D.S.: Computers and Intractability: a guide to NP‐Completeness. Freeman, San Francisco (1979)

    MATH  Google Scholar 

  8. Goldberg, A.V.: AVG Lab. http://www.avglab.com/andrew/

  9. Goldberg, A.V.: Shortest path algorithms: Engineering aspects. In: Proc. 12th Int'l Symp. on Algorithms and Computation (ISAAC). LNCS, vol. 2223, pp. 502–513. Springer, Berlin (2001)

    Google Scholar 

  10. Goldberg, A.V., Kaplan, H., Werneck, R.: Reach for A*: efficient point-to-point shortest path algorithms. In: Proc. 8th Workshop on Algorithm Engineering and Experiments (ALENEX), 2006

    Google Scholar 

  11. Knopp, S., Sanders, P., Schultes, D., Schulz, F., Wagner, D.: Computing many-to-many shortest paths using highway hierarchies. In: Proc. 9th Workshop on Algorithm Engineering and Experiments (ALENEX), 2007

    Google Scholar 

  12. Pettie, S.: On the comparison‐addition complexity of all-pairs shortest paths. In: Proc. 13th Int'l Symp. on Algorithms and Computation (ISAAC), 2002, pp. 32–43

    Google Scholar 

  13. Pettie, S.: A new approach to all-pairs shortest paths on real-weighted graphs. Theor. Comput. Sci. 312(1), 47–74 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  14. Pettie, S., Ramachandran, V.: Minimizing randomness in minimum spanning tree, parallel connectivity and set maxima algorithms. In: Proc. 13th ACM-SIAM Symp. on Discrete Algorithms (SODA), 2002, pp. 713–722

    Google Scholar 

  15. Pettie, S., Ramachandran, V.: A shortest path algorithm for real-weighted undirected graphs. SIAM J. Comput. 34(6), 1398–1431 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  16. Pettie, S., Ramachandran, V., Sridhar, S.: Experimental evaluation of a new shortest path algorithm. In: Proc. 4th Workshop on Algorithm Engineering and Experiments (ALENEX), 2002, pp. 126–142

    Google Scholar 

  17. Thorup, M.: Undirected single‐source shortest paths with positive integer weights in linear time. J. ACM 46(3), 362–394 (1999)

    Article  MathSciNet  MATH  Google Scholar 

  18. Venkataraman, G., Sahni, S., Mukhopadhyaya, S.: A blocked all-pairs shortest paths algorithm. J. Exp. Algorithms 8 (2003)

    Google Scholar 

  19. Zwick, U.: Exact and approximate distances in graphs – a survey. In: Proc. 9th European Symposium on Algorithms (ESA), 2001, pp. 33–48. See updated version at http://www.cs.tau.ac.il/~zwick/

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer-Verlag

About this entry

Cite this entry

Pettie, S. (2008). All Pairs Shortest Paths in Sparse Graphs. In: Kao, MY. (eds) Encyclopedia of Algorithms. Springer, Boston, MA. https://doi.org/10.1007/978-0-387-30162-4_11

Download citation

Publish with us

Policies and ethics