Skip to main content

All Pairs Shortest Paths in Sparse Graphs

  • Reference work entry
  • First Online:
Encyclopedia of Algorithms
  • 674 Accesses

Years and Authors of Summarized Original Work

  • 2004; Pettie

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, l), to determine the distance and shortest path between every pair of vertices, where \(\vert V \vert = n,\vert E\vert = m\), and l : E →  is the edge length (or weight) function. The output is in the form of two n × 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 only non-negative edge lengths then the...

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 1,599.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 1,999.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Recommended Reading

  1. Aho AV, Hopcroft JE, Ullman JD (1975) The design and analysis of computer algorithms. Addison-Wesley, Reading

    MATH  Google Scholar 

  2. Bast H, Funke S, Matijevic D, Sanders P, Schultes D (2007) In transit to constant shortest-path queries in road networks. In: Proceedings of the 9th workshop on algorithm engineering and experiments (ALENEX), San Francisco

    Google Scholar 

  3. Chan T (2007) More algorithms for all-pairs shortest paths in weighted graphs. In: Proceedings of the 39th ACM symposium on theory of computing (STOC), San Diego, pp 590–598

    Google Scholar 

  4. Cormen TH, Leiserson CE, Rivest RL, Stein C (2001) Introduction to algorithms. MIT, Cambridge

    MATH  Google Scholar 

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

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

    Article  MathSciNet  MATH  Google Scholar 

  7. Garey MR, Johnson DS (1979) Computers and intractability: a guide to NP-completeness. Freeman, San Francisco

    MATH  Google Scholar 

  8. Goldberg AV (2001) Shortest path algorithms: engineering aspects. In: Proceedings of the 12th international symposium on algorithms and computation (ISAAC), Christchurch. LNCS, vol 2223. Springer, Berlin, pp 502–513

    Google Scholar 

  9. Goldberg AV, Kaplan H, Werneck R (2006) Reach for A*: efficient point-to-point shortest path algorithms. In: Proceedings of the 8th workshop on algorithm engineering and experiments (ALENEX), Miami

    Google Scholar 

  10. Knopp S, Sanders P, Schultes D, Schulz F, Wagner D (2007) Computing many-to-many shortest paths using highway hierarchies. In: Proceedings of the 9th workshop on algorithm engineering and experiments (ALENEX), New Orleans

    Google Scholar 

  11. Pettie S (2002) On the comparison-addition complexity of all-pairs shortest paths. In: Proceedings of the 13th international symposium on algorithms and computation (ISAAC), Vancouver, pp 32–43

    Google Scholar 

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

    Article  MathSciNet  MATH  Google Scholar 

  13. Pettie S, Ramachandran V (2002) Minimizing randomness in minimum spanning tree, parallel connectivity and set maxima algorithms. In: Proceedings of the 13th ACM-SIAM symposium on discrete algorithms (SODA), San Francisco, pp 713–722

    Google Scholar 

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

    Article  MathSciNet  MATH  Google Scholar 

  15. Pettie S, Ramachandran V, Sridhar S (2002) Experimental evaluation of a new shortest path algorithm. In: Proceedings of the 4th workshop on algorithm engineering and experiments (ALENEX), San Francisco, pp 126–142

    Google Scholar 

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

    Article  MathSciNet  MATH  Google Scholar 

  17. Vassilevska Williams V, Williams R (2010) Subcubic equivalences between path, matrix, and triangle problems. In Proceedings of the 51st IEEE symposium on foundations of computer science (FOCS), Los Alamitos, pp 645–654

    Google Scholar 

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

    Google Scholar 

  19. Williams R (2014) Faster all-pairs shortest paths via circuit complexity. In Proceedings of the 46th ACM symposium on theory of computing (STOC), New York, pp 664–673

    Google Scholar 

  20. Zwick U (2001) Exact and approximate distances in graphs – a survey. In: Proceedings of the 9th European symposium on algorithms (ESA), Aarhus, pp 33–48. See updated version at http://www.cs.tau.ac.il/~zwick/

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Seth Pettie .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer Science+Business Media New York

About this entry

Cite this entry

Pettie, S. (2016). All Pairs Shortest Paths in Sparse Graphs. In: Kao, MY. (eds) Encyclopedia of Algorithms. Springer, New York, NY. https://doi.org/10.1007/978-1-4939-2864-4_11

Download citation

Publish with us

Policies and ethics