Skip to main content

Shortest Paths

  • Chapter
  • 8602 Accesses

Part of the book series: Algorithms and Computation in Mathematics ((AACIM,volume 5))

Abstract

One of the most common applications of graphs in everyday life is representing networks for traffic or for data communication. The schematic map of the German motorway system in the official guide, the railroad or bus lines in a public transportation system, and the network of routes an airline offers are routinely represented by graphs. Therefore, it is obviously of great practical interest to study paths in such graphs. In particular, we often look for paths which are good or even best in some respect: sometimes the shortest or the fastest route is required, sometimes we want the cheapest path or the one which is safest—for example, we might want the route where we are least likely to encounter a speed-control installation. Thus we will study shortest paths in graphs and digraphs in this chapter; as we shall see, this is a topic whose interest extends far beyond traffic networks. We will present some useful theoretical concepts (e.g., the Bellman equations, shortest path threes, and path algebras) as well as the most important algorithms for finding shortest paths (in particular, breadth first search, the algorithm of Dijkstra, and the algorithm of Floyd and Warshall). We also discuss two applications, namely to project scheduling and to finding optimal connections in a public transportation system.

So many paths that wind and wind…

Ella Wheeler Wilcox

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   54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD   109.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

Learn about institutional subscriptions

Notes

  1. 1.

    Recall that a queue is a data structure for which elements are always appended at the end, but removed at the beginning (first in—first out). For a discussion of the implementation of queues we refer to [AhoHU83] or [CorLRS09].

  2. 2.

    For nonnegative length functions, the undirected case can be treated by considering the complete orientation \(\stackrel{\rightarrow}{G}\) instead of G. If we want to allow edges of negative length, we need a construction which is considerably more involved, see Sect. 14.6.

  3. 3.

    In particular, we may apply this technique to the distances in G, since they satisfy Bellman’s equations, which again proves the existence of SP-trees (under the stronger assumption that (G,w) contains only cycles of positive length).

  4. 4.

    I owe the material of this section to my former student, Dr. Michael Guckert.

  5. 5.

    Remember the Circle line in the London Underground system!

  6. 6.

    We will neglect the amount of time a train stops at station v i . This can be taken into account by either adding it to the travelling time f(e i ) or by introducing an additional term w L (v i ) which then has to be added to t L (v i−1)+f(e i ).

  7. 7.

    Note that we cannot just put t L (v 0)=0, as different lines may leave their start stations at different times.

  8. 8.

    More precisely, the trains of line L leave station v at these times, that is, they reach v a little bit earlier. We assume that this short time interval suffices for the process of changing trains, so that we can leave this out of our considerations as well.

  9. 9.

    It is obvious how this notion could be applied in the context of traffic or communication networks.

  10. 10.

    This section is included just to provide some more theoretical background. As it will not be used in the rest of the book, it may be skipped.

  11. 11.

    This assumption does not always hold in practice. For instance, gozinto graphs containing cycles are quite common in chemical production processes; see [Mul66].

References

  1. Aho, A.V., Hopcroft, J.E., Ullman, J.D.: Data Structures and Algorithms. Addison Wesley, Reading (1983)

    MATH  Google Scholar 

  2. Ahuja, R.K., Mehlhorn, K., Orlin, J.B., Tarjan, R.E.: Faster algorithms for the shortest path problem. J. Assoc. Comput. Mach. 37, 213–223 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  3. Althöfer, I.: On optimal realizations of finite metric spaces by graphs. Discrete Comput. Geom. 3, 103–122 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  4. Ausiello, G., Italiano, G.F., Marchetti Spaccamela, A., Nanni, U.: Incremental algorithms for minimal length paths. J. Algorithms 12, 615–638 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  5. Bandelt, H.-J.: Recognition of tree matrices. SIAM J. Discrete Math. 3, 1–6 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  6. Bar-Ilan, J., Kortsarz, G., Peleg, D.: How to allocate network centers. J. Algorithms 15, 385–415 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  7. Bellman, R.E.: On a routing problem. Q. Appl. Math. 16, 87–90 (1958)

    MATH  Google Scholar 

  8. Bermond, J.C. (ed.): Interconnection Networks. North Holland, Amsterdam (1992)

    MATH  Google Scholar 

  9. Bertsekas, D.P.: A simple and fast label correcting algorithm for shortest paths. Networks 23, 703–709 (1993)

    Article  MATH  Google Scholar 

  10. Bien, F.: Constructions of telephone networks by group representations. Not. Am. Math. Soc. 36, 5–22 (1989)

    MathSciNet  MATH  Google Scholar 

  11. Brucker, P., Burkard, R.E., Hurink, J.: Cyclic schedules for r irregularly occurring events. J. Comput. Appl. Math. 30, 173–189 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  12. Bunemann, P.: A note on the metric properties of trees. J. Comb. Theory, Ser. B 17, 48–50 (1974)

    Article  Google Scholar 

  13. Burkard, R.E.: Optimal schedules for periodically recurring events. Discrete Appl. Math. 15, 167–180 (1986)

    Article  MathSciNet  MATH  Google Scholar 

  14. Carré, P.A.: An algebra for network routing problems. J. Inst. Math. Appl. 7, 273–294 (1971)

    Article  MathSciNet  MATH  Google Scholar 

  15. Carré, P.A.: Graphs and Networks. Oxford University Press, Oxford (1979)

    MATH  Google Scholar 

  16. Chung, F.R.K.: Diameters of communication networks. Proc. Symp. Pure Appl. Math. 34, 1–18 (1986)

    Google Scholar 

  17. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press, Cambridge (2009)

    MATH  Google Scholar 

  18. Dijkstra, E.W.: A note on two problems in connexion with graphs. Numer. Math. 1, 269–271 (1959)

    Article  MathSciNet  MATH  Google Scholar 

  19. Domschke, W.: Schedule synchronization for public transit networks. OR Spektrum 11, 17–24 (1989)

    Article  MATH  Google Scholar 

  20. Dress, A.: Trees, tight extensions of metric spaces, and the cohomological dimension of certain groups: A note on combinatorial properties of metric spaces. Adv. Math. 53, 321–402 (1984)

    Article  MathSciNet  MATH  Google Scholar 

  21. Floyd, R.W.: Algorithm 97, shortest path. Commun. ACM 5, 345 (1962)

    Article  Google Scholar 

  22. Ford, L.R.: Network Flow Theory. Rand Corp., Santa Monica (1956)

    Google Scholar 

  23. Frederickson, G.N.: Fast algorithms for shortest paths in planar graphs. SIAM J. Comput. 16, 1004–1022 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  24. Fredman, M.L., Tarjan, R.E.: Fibonacci heaps and their uses on improved network optimization algorithms. J. Assoc. Comput. Mach. 34, 596–615 (1987)

    Article  MathSciNet  Google Scholar 

  25. Fredman, M.L., Willard, D.E.: Trans-dichotomous algorithms for minimum spanning trees and shortest paths. J. Comput. Syst. Sci. 48, 533–551 (1994)

    Article  MathSciNet  MATH  Google Scholar 

  26. Gallo, G., Pallottino, S.: Shortest path algorithms. Ann. Oper. Res. 13, 3–79 (1988)

    Article  MathSciNet  Google Scholar 

  27. Gondran, M., Minoux, N.: Graphs and Algorithms. Wiley, New York (1984)

    MATH  Google Scholar 

  28. Guckert, M.: Anschlußoptimierung in öffentlichen Verkehrsnetzen—Graphentheoretische Grundlagen, objektorientierte Modellierung und Implementierung. Ph.D. Thesis, Universität Marburg (1996)

    Google Scholar 

  29. Guldan, F.: Maximization of distances of regular polygones on a circle. Appl. Math. 25, 182–195 (1980)

    MathSciNet  MATH  Google Scholar 

  30. Hakimi, S.L., Yau, S.S.: Distance matrix of a graph and its realizability. Q. Appl. Math. 22, 305–317 (1964)

    MathSciNet  Google Scholar 

  31. Hu, T.C.: The maximum capacity route problem. Oper. Res. 9, 898–900 (1961)

    Article  Google Scholar 

  32. Hung, M.S., Divoky, J.J.: A computational study of efficient shortest path algorithms. Comput. Oper. Res. 15, 567–576 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  33. Imrich, W., Simões-Pereira, J.M.S., Zamfirescu, C.M.: On optimal embeddings of metrics in graphs. J. Comb. Theory, Ser. B 36, 1–15 (1984)

    Article  MATH  Google Scholar 

  34. Itai, A., Rodeh, M.: Finding a minimum circuit in a graph. SIAM J. Comput. 7, 413–423 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  35. Kalaba, R.: On some communication network problems. In: Bellman, R.E., Hall, M. (eds.) Combinatorial Analysis, pp. 261–280. Am. Math. Soc., Providence (1960)

    Google Scholar 

  36. Kay, D.C., Chartrand, G.: A characterization of certain Ptolemaic graphs. Can. J. Math. 17, 342–346 (1965)

    Article  MathSciNet  MATH  Google Scholar 

  37. Kuich, W., Salomaa, A.: Semirings, Automata, Languages. Springer, Berlin (1986)

    Book  MATH  Google Scholar 

  38. Lawler, E.L.: Combinatorial Optimization: Networks and Matriods. Holt, Rinehart and Winston, New York (1976)

    Google Scholar 

  39. Lawler, E.L., Lenstra, J.K., Rinnooy Kan, A.H.G., Shmoys, D.B.: Sequencing and scheduling: algorithms and complexity. In: Graves, S.C., Rinnooy Kan, A.H.G., Zipkin, P.H. (eds.) Logistics of Production and Inventory, pp. 445–522. Elsevier, Amsterdam (1993)

    Chapter  Google Scholar 

  40. Mehlhorn, K.: Data Structures and Algorithms. Springer, Berlin (1984)

    Google Scholar 

  41. Mehlhorn, K., Sanders, P.: Algorithms and Data Structures. The Basic Toolbox. Springer, Berlin (2008)

    MATH  Google Scholar 

  42. Mehlhorn, K., Schmidt, B.H.: On BF-orderable graphs. Discrete Appl. Math. 15, 315–327 (1986)

    Article  MathSciNet  MATH  Google Scholar 

  43. Monien, B.: The complexity of determining a shortest cycle of even length. Computing 31, 355–369 (1983)

    Article  MathSciNet  MATH  Google Scholar 

  44. Moore, E.F.: The shortest path through a maze. In: Proc. Int. Symp. on Theory of Switching Part II, pp. 285–292. Harvard University Press, Cambridge (1959)

    Google Scholar 

  45. Müller-Merbach, H.: Die Anwendung des Gozinto-Graphs zur Berechnung des Roh- und Zwischenproduktbedarfs in chemischen Betrieben. Ablauf- Plan.forsch. 7, 189–198 (1966)

    Google Scholar 

  46. Müller-Merbach, H.: Die Inversion von Gozinto-Matrizen mit einem graphen-orientierten Verfahren. Elektron. Datenverarb. 11, 310–314 (1969)

    Google Scholar 

  47. Müller-Merbach, H.: Operations Research, 3rd edn. Franz Vahlen, München (1973)

    Google Scholar 

  48. Schnorr, C.P.: An algorithm for transitive closure with linear expected time. SIAM J. Comput. 7, 127–133 (1978)

    Article  MathSciNet  Google Scholar 

  49. Shimbel, A.: Structure in communication nets. In: Proc. Symp. Information Networks, pp. 199–203. Polytechnic Institute of Brooklyn, New York (1955)

    Google Scholar 

  50. Siklóssy, L., Tulp, E.: Trains, an active time-table searcher. In: ECAI’89, pp. 170–175 (1989)

    Google Scholar 

  51. Simões-Pereira, J.M.S.: An optimality criterion for graph embeddings of metrics. SIAM J. Discrete Math. 1, 223–229 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  52. Strang, G.: Linear Algebra and Its Applications, 3rd edn. Harcourt Brace Jovanovich, San Diego (1993)

    Google Scholar 

  53. Taha, H.A.: Operations Research, 5th edn. Macmillan, New York (1992)

    MATH  Google Scholar 

  54. Takaoka, T.: A new upper bound on the complexity of the all pairs shortest path problem. Inf. Process. Lett. 43, 195–199 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  55. Tarjan, R.E.: In: Data Structures and Network Algorithms. Soc. Ind. Appl. Math., Philadelphia (1983)

    Chapter  Google Scholar 

  56. Warshall, S.: A theorem on Boolean matrices. J. Assoc. Comput. Mach. 9, 11–12 (1962)

    Article  MathSciNet  MATH  Google Scholar 

  57. Winkler, P.: The complexity of metric realization. SIAM J. Discrete Math. 1, 552–559 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  58. Yuster, R., Zwick, U.: Finding even cycles even faster. SIAM J. Discrete Math. 10, 209–222 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  59. Zimmermann, U.: Linear and Combinatorial Optimization in Ordered Algebraic Structures. North Holland, Amsterdam (1981)

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Jungnickel, D. (2013). Shortest Paths. In: Graphs, Networks and Algorithms. Algorithms and Computation in Mathematics, vol 5. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-32278-5_3

Download citation

Publish with us

Policies and ethics