skip to main content
research-article

All-pairs shortest paths in O(n2) time with high probability

Published: 04 September 2013 Publication History

Abstract

We present an all-pairs shortest path algorithm whose running time on a complete directed graph on n vertices whose edge weights are chosen independently and uniformly at random from [0,1] is O(n2), in expectation and with high probability. This resolves a long-standing open problem. The algorithm is a variant of the dynamic all-pairs shortest paths algorithm of Demetrescu and Italiano [2006]. The analysis relies on a proof that the number of locally shortest paths in such randomly weighted graphs is O(n2), in expectation and with high probability. We also present a dynamic version of the algorithm that recomputes all shortest paths after a random edge update in O(log2n) expected time.

References

[1]
Addario-Berry, L., Broutin, N., and Lugosi, G. 2010. The longest minimum-weight path in a complete graph. Combinato. Probab. Comput. 19, 1, 1--19.
[2]
Bloniarz, P. A. 1983. A shortest-path algorithm with expected time O(n2log n log* n). SIAM J. Comput. 12, 3, 588--600.
[3]
Boucheron, S., Lugosi, G., and Bousquet, O. 2003. Concentration inequalities. In Advanced Lectures on Machine Learning, 208--240.
[4]
Cooper, C., Frieze, A., Mehlhorn, K., and Priebe, V. 2000. Average-case complexity of shortest-paths problems in the vertex-potential model. Rand. Struct. Algorithms 16, 1, 33--46.
[5]
Davis, R. and Prieditis, A. 1993. The expected length of a shortest path. Info. Proc. Lett. 46, 3, 135--141.
[6]
Demetrescu, C., Faruolo, P., Italiano, G. F., and Thorup, M. 2006. Does path cleaning help in dynamic all-pairs shortest paths? In Proceedings of the 14th ESA, 732--743.
[7]
Demetrescu, C. and Italiano, G. F. 2004. A new approach to dynamic all pairs shortest paths. J. ACM 51, 6, 968--992.
[8]
Demetrescu, C. and Italiano, G. F. 2006. Experimental analysis of dynamic all pairs shortest path algorithms. ACM Trans. Algor. 2, 4, 578--601.
[9]
Devroye, L. 1987. Branching processes in the analysis of the heights of trees. Acta Info. 24, 3, 277--298.
[10]
Dial, R. B. 1969. Algorithm 360: shortest-path forest with topological ordering. Comm. ACM 12, 11, 632--633.
[11]
Dijkstra, E. W. 1959. A note on two problems in connexion with graphs. Numerische Mathematik 1, 269--271.
[12]
Dinic, E. A. 1978. Economical algorithms for finding shortest paths in a network. In Y. Popkov and B. Shmulyian, Eds., Transportation Modeling Systems. Institute for System Studies, Moscow, CIS. 36--44.
[13]
Fredman, M. L. and Tarjan, R. E. 1987. Fibonacci heaps and their uses in improved network optimization algorithms. J. ACM 34, 3, 596--615.
[14]
Friedrich, T. and Hebbinghaus, N. 2008. Average update times for fully-dynamic all-pairs shortest paths. In Proceedings of 19th ISAAC, 692--703.
[15]
Frieze, A. and Mcdiarmid, C. 1997. Algorithmic theory of random graphs. Rand. Struct. Algorithms 10, 1--2, 5--42.
[16]
Frieze, A. M. and Grimmett, G. R. 1985. The shortest-path problem for graphs with random arc-lengths. Disc. Appl. Math. 10, 57--77.
[17]
Goldberg, A. V. 2008. A practical shortest path algorithm with linear expected time. SIAM J. Comput. 37, 5, 1637--1655.
[18]
Hagerup, T. 2006. Simpler computation of single-source shortest paths in linear average time. Theory Comput. Syst. 39, 1, 113--120.
[19]
Hassin, R. and Zemel, E. 1985. On shortest paths in graphs with random weights. Math. Oper. Res. 10, 4, 557--564.
[20]
Janson, S. 1999. One, two and three times log n/n for paths in a complete graph with random weights. Combinatorics, Probab. Comput. 8, 4, 347--361.
[21]
Karger, D. R., Koller, D., and Phillips, S. J. 1993. Finding the hidden path: Time bounds for all-pairs shortest paths. SIAM J. Comput. 22, 1199--1217.
[22]
Maurer, A. 2003. A bound on the deviation probability for sums of non-negative random variables. J. Inequal. Pure Appl. Math. 4, 1, Article 15.
[23]
McGeoch, C. C. 1995. All-pairs shortest paths and the essential subgraph. Algorithmica 13, 426--441.
[24]
Mehlhorn, K. and Priebe, V. 1997. On the all-pairs shortest-path algorithm of Moffat and Takaoka. Rand. Struct. Algorithms 10, 1--2, 205--220.
[25]
Meyer, U. 2003. Average-case complexity of single-source shortest-paths algorithms: Lower and upper bounds. J. Algorithms 48, 1, 91--134.
[26]
Mitzenmacher, M. and Upfal, E. 2005. Probability and Computing, Randomized Algorithms and Probabilistic Analysis. Cambridge University Press.
[27]
Moffat, A. and Takaoka, T. 1987. An all pairs shortest path algorithm with expected time O(n2log n). SIAM J. Comput. 16, 6, 1023--1031.
[28]
Moon, J. W. 1974. The distance between nodes in recursive trees. In Combinatorics (Proceedings of British Combinatorial Conference, Univ. Coll. Wales, Aberystwyth, 1973), 125--132. London Mathematical Society Lecture Note Series, No. 13, Cambridge University Press, London UK.
[29]
Pettie, S. 2004. A new approach to all-pairs shortest paths on real-weighted graphs. Theoret. Comput. Sci. 312, 1, 47--74.
[30]
Smythe, R. T. and. Mahmoud, H. M. 1995. A survey of recursive trees. Theory Probab. Math. Stat. 51, 1--29.
[31]
Spira, P. M. 1973. A new algorithm for finding all shortest paths in a graph of positive arcs in average time O(n2 log2 n). SIAM J. Comput. 2, 1, 28--32.
[32]
Thorup, M. 1999. Undirected single-source shortest paths with positive integer weights in linear time. J. ACM 46, 362--394.
[33]
Thorup, M. 2004. Fully-dynamic all-pairs shortest paths: Faster and allowing negative cycles. In Proceedings of 9th SWAT, 384--396.
[34]
Thorup, M. 2005. Worst-case update times for fully-dynamic all-pairs shortest paths. In Proceedings of 37th STOC, 112--119.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Journal of the ACM
Journal of the ACM  Volume 60, Issue 4
August 2013
213 pages
ISSN:0004-5411
EISSN:1557-735X
DOI:10.1145/2508028
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 04 September 2013
Accepted: 01 April 2013
Revised: 01 January 2013
Received: 01 May 2011
Published in JACM Volume 60, Issue 4

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Shortest paths
  2. probabilistic analysis

Qualifiers

  • Research-article
  • Research
  • Refereed

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)12
  • Downloads (Last 6 weeks)1
Reflects downloads up to 19 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2023)The Floyd‐Warshall all‐pairs shortest paths algorithm for disconnected and very sparse graphsSoftware: Practice and Experience10.1002/spe.318853:6(1287-1303)Online publication date: Feb-2023
  • (2019)Public-Key Cryptography in the Fine-Grained SettingAdvances in Cryptology – CRYPTO 201910.1007/978-3-030-26954-8_20(605-635)Online publication date: 18-Aug-2019
  • (2017)On the longest path of a randomly weighted tournamentDiscrete Applied Mathematics10.1016/j.dam.2017.07.003230:C(121-132)Online publication date: 30-Oct-2017
  • (2017)Solving all-pairs shortest path by single-source computationsDiscrete Applied Mathematics10.1016/j.dam.2017.03.008231:C(119-130)Online publication date: 20-Nov-2017
  • (2016)A Web Based Decision Support System (DSS) for Individuals' Urban Travel AlternativesCivil and Environmental Engineering10.4018/978-1-4666-9619-8.ch025(576-596)Online publication date: 2016
  • (2016)A Web Based Decision Support System (DSS) for Individuals' Urban Travel AlternativesUsing Decision Support Systems for Transportation Planning Efficiency10.4018/978-1-4666-8648-9.ch006(145-167)Online publication date: 2016
  • (2015)A Forward-Backward Single-Source Shortest Paths AlgorithmSIAM Journal on Computing10.1137/14097097544:3(698-739)Online publication date: Jan-2015
  • (2015)Random Shortest PathsAlgorithmica10.1007/s00453-014-9901-973:1(42-62)Online publication date: 1-Sep-2015

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media