, Volume 13, Issue 5, pp 426–441 | Cite as

All-pairs shortest paths and the essential subgraph

  • C. C. McGeoch


The essential subgraph H of a weighted graph or digraphG contains an edge (v, w) if that edge is uniquely the least-cost path between its vertices. Let s denote the number of edges ofH. This paper presents an algorithm for solving all-pairs shortest paths onG that requires O(ns+n2 logn) worst-case running time. In general the time is equivalent to that of solvingn single-source problems using only edges inH. For general models of random graphs and digraphsG, s=0(n logn) almost surely. The subgraphH is optimal in the sense that it is the smallest subgraph sufficient for solving shortest-path problems inG. Lower bounds on the largest-cost edge ofH and on the diameter ofH andG are obtained for general randomly weighted graphs. Experimental results produce some new conjectures about essential subgraphs and distances in graphs with uniform edge costs.

Key words

All-pairs shortest path Single-source shortest path Random graph Random weighted graph Graph diameter Minimum spanning tree Essential arcs 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    R. K. Ahuja, K. Mehlhorn, J. B. Orlin, and R. E. Tarjan. Faster algorithms for the shortest path problem.J. Assoc. Comput. Mach.,37 (1990), 213–223.Google Scholar
  2. [2]
    N. Alon, Z. Galil, and O. Margalit. On the exponent of the all pairs shortest path problem.Proc. 32nd FOCS, 1991, pp. 569–575.Google Scholar
  3. [3]
    G. Ausiello, G. F. Italiano, A. M. Spaccamela, and U. Nanni. Incremental algorithms for minimal length paths.Proc. First SODA, 1990 pp. 12–21.Google Scholar
  4. [4]
    J. L. Bentley and J. B. Saxe. Generating sorted lists of random numbers.ACM Trans. Math. Software,6(3) (1980), 359–364.Google Scholar
  5. [5]
    P. A. Bloniarz. A shortest-path algorithm with expected time o(n2 logn log* n).SIAM J. Comput.,12(3) (1983), 588–600.Google Scholar
  6. [6]
    B. Bollobás.Random Graphs. Academic Press, New York, 1985.Google Scholar
  7. [7]
    E. W. Dijkstra. A note on two problems in connexion with graphs.Numer. Math.,1 (1959), 269–271.Google Scholar
  8. [8]
    P. Erdös and A. Rényi. On random graphs, I.Publ. Math. Debrecen,6 (1959), 290–297.Google Scholar
  9. [9]
    R. W. Floyd. Algorithm 97: Shortest path.Comm. ACM,5 (1962), 345.Google Scholar
  10. [10]
    M. L. Fredman. New bounds on the complexity of the shortest path problem.SIAM J. Comput.,5 (1976), 83–89.Google Scholar
  11. [11]
    M. L. Fredman and R. E. Tarjan. Fibonacci heaps and their uses in improved network optimization algorithms.J. Assoc. Comput. Mach.,34(3) (1987), 596–615.Google Scholar
  12. [12]
    M. L. Fredman and D. E. Willard. Trans-dichotomous algorithms for minimum spanning trees and shortest paths.Proc. 31st FOCS, October 1990, pp. 719–725.Google Scholar
  13. [13]
    A. M. Frieze. On the value of a random minimum spanning tree problem.Discrete Appl. Math.,10 (1985), 47–56.Google Scholar
  14. [14]
    A. M. Frieze and G. R. Grimmet. The shortest-path problem for graphs with random arc-lengths.Discrete Appl. Math.,10 (1985), 57–77.Google Scholar
  15. [15]
    R. Hassin and E. Zemel. On the shortest paths in graphs with random weights.Math. Oper. Res.,10(4) (1985), 557–564.Google Scholar
  16. [16]
    D. B. Johnson. Efficient algorithms for shortest paths in sparse networks.J. Assoc. Comput. Mach.,24 (1977), 1–13.Google Scholar
  17. [17]
    D. R. Karger, D. Koller, and S. J. Phillips. Finding the hidden path: time bounds for all-pairs shortest paths.SIAM J. Comput.,22(6) (1993), 1199–1217.Google Scholar
  18. [18]
    A. Moffat and T. Takoaka. An all pairs shortest path algorithm with expected time o(n2 logn).SIAM J. Comput.,16(6) (1987), 1023–1031.Google Scholar
  19. [19]
    K. V. S. Ramaro and S. Venkatesan. On finding and updating shortest paths distributively.J. Algorithms,13 (1992), 235–257.Google Scholar
  20. [20]
    P. Robert. An algorithm for finding the essential sets of arcs of certain graphs.J. Combin. Theory,10 (1971), 288–298.Google Scholar
  21. [21]
    R. Sedgewich.Algorithms. Addison-Wesley, Reading, MA, 1988.Google Scholar
  22. [22]
    P. M. Spira. A new algorithm for finding all shortest paths in a graph of positive arcs in average time 0(n2 logn).SIAM J. Comput.,2(1) (1973) 28–32.Google Scholar
  23. [23]
    R. E. Tarjan.Data Structures and Network Algorithms. Society for Industrial and Applied Mathematics, Philadelphia, PA, 1983.Google Scholar
  24. [24]
    B. W. Weide. Random graphs and graph optimization problems.SIAM J. Comput.,9(3) (1980), 552–557.Google Scholar

Copyright information

© Springer-Verlag New York Inc 1995

Authors and Affiliations

  • C. C. McGeoch
    • 1
  1. 1.Department of Mathematics and Computer ScienceAmherst CollegeAmherstUSA

Personalised recommendations