Skip to main content
Log in

Dijkstra, Floyd and Warshall meet Kleene

  • Original Article
  • Published:
Formal Aspects of Computing

Abstract

Around 1960, Dijkstra, Floyd and Warshall published papers on algorithms for solving single-source and all-sources shortest path problems, respectively. These algorithms, nowadays named after their inventors, are well known and well established. This paper sheds an algebraic light on these algorithms. We combine the shortest path problems with Kleene algebra, also known as Conway’s regular algebra. This view yields a purely algebraic version of Dijkstra’s shortest path algorithm and the one by Floyd/Warshall. Moreover, the algebraic abstraction yields applications of these algorithms to structures different from graphs and pinpoints the mathematical requirements on the underlying cost algebra that ensure their correctness.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

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

    MATH  Google Scholar 

  2. Backhouse R, Carré B (1975) Regular algebra applied to path-finding problems. IMA J Appl Math 15(2): 161–186

    Article  MATH  Google Scholar 

  3. Backhouse R, van den Eijnde J, van Gasteren A (1994) Calculating path algorithms. Sci Comput Progr 22(1–2): 3–19

    Article  MATH  Google Scholar 

  4. Bellman R (1958) On a routing problem. Quart Appl Math 16: 87–90

    MathSciNet  MATH  Google Scholar 

  5. Berge C (1962) The theory of graphs and its applications. Methuen

  6. Carré B (1971) An algebra for network routing problems. IMA J Appl Math 7: 273–294

    Article  MATH  Google Scholar 

  7. Carré B (1979) Graphs and networks.Oxford applied mathematics and computing science series. Clarendon Press, Oxford University

    Google Scholar 

  8. Coltun R, Ferguson D, Moy J (2008) OSPF for IPv6. RFC 2328 (Standard, Errata Exist)

  9. Conway J (1971) Regular algebra and finite machines. Chapman and Hall, London

  10. Dantzig G (1960) On the shortest route through a network. Manag Sci 6: 187–190

    Article  MathSciNet  MATH  Google Scholar 

  11. Dijkstra E (1959) A note on two problems in connexion with graphs. Numer Mathe 1: 269–271

    Article  MathSciNet  MATH  Google Scholar 

  12. Davey B, Priestley H (2002) Introduction to lattices and order. Cambridge University Press, London

    Book  MATH  Google Scholar 

  13. Floyd R (1962) Algorithm 97: Shortest path. Commun ACM 5: 345

    Article  Google Scholar 

  14. Gondran M, Minoux M (1979) Graphes et algorithmes. Eyrolles

  15. Gondran M, Minoux M (1988) Graphs and Algorithms. Wiley

  16. Gondran M, Minoux M (2008) Graphs, Dioids and Semirings—new models and algorithms. Springer, Berlin

    MATH  Google Scholar 

  17. Höfner P, McIver A (2011) Towards an algebra of routing tables. In: de Swart H (ed) Relations and Kleene algebra in computer science, lecture notes in computer science, vol 6663. Springer, Berlin, pp 212–229

    Google Scholar 

  18. Hollenberg M (1998) Equational axioms of test algebra. In: Nielsen M, Thomas W (eds) CSL ’97: selected papers from the 11th international workshop on computer science logic, lecture notes in computer science, vol 1414

  19. Höfner P, Struth G (2007) Automated reasoning in Kleene algebra. In: Pfennig F (ed) Automated deduction, lecture notes in artificial intelligence, vol 4603. Springer, Berlin, pp 279–294

    Google Scholar 

  20. Kleene S (1951) Representation of events in nerve nets and finite automata. Technical Report RM-704, RAND Corporation RAND Research Memorandum

  21. Kleene SC (1952) Introduction to metamathematics. Van Nostrand

  22. Kozen D (1994) A completeness theorem for Kleene algebras and the algebra of regular events. Inf Comput 110(2): 366–390

    Article  MathSciNet  MATH  Google Scholar 

  23. Kozen D (1997) Kleene algebra with tests. ACM Trans Progr Lang Syst 19(3): 427–443

    Article  Google Scholar 

  24. Lengauer T, Theune D (1991) Efficient algorithms for path problems with general cost citeria. In: Leach Albert J, Burkhard Monien B, Rodríguez-Artalejo M (eds) Automata, languages and programming, 18th International colloquium, ICALP91, Madrid, Spain, July 8–12, 1991, proceedings. Lecture notes in computer science vol 510. Springer, Berlin, pp 314–326

  25. Lengauer T, Theune D (1991) Unstructured path problems and the making of semirings (preliminary version). In: Dehne F, Sack J-R, Santoro N (eds) Algorithms and data structures, 2nd workshop WADS ’91, Ottawa, Canada, August 14–16, 1991, proceedings. Lecture notes in computer science, vol 519. Springer, Berlin, pp 189–200

  26. Moy J (1998) OSPF version 2. RFC 2328 (Standard, Errata Exist)

  27. Oran D (1990) IS-IS protocol specification (IETF). RFC 1142 (Informational)

  28. Perkins C, Belding-Royer E, Das S (2003) Ad hoc on-demand distance vector (AODV) routing. RFC 3561 (Experimental)

  29. Roy B (1959) Transitivité et connexité. Comptes Rendus de l’Académie des Sci Paris 249: 216–218

    MATH  Google Scholar 

  30. Tarjan R. (1981) A unified approach to path problems. J ACM 28: 577–593

    Article  MathSciNet  MATH  Google Scholar 

  31. Warshall S (1962) A theorem on boolean matrices. J ACM 9(1): 11–12

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Bernhard Möller.

Additional information

by Eerke Boiten and Jim Woodcock

It is our pleasure to dedicate this paper to Charles Carroll Morgan on the occasion of his 60th birthday.With this paperwe try to combine two of Carroll’s various research interests: Programming Methodology and Algorithmic Calculi. The former includes problem-solving techniques, such as algorithms, the latter includes the study of calculation of programs from specifications, in particular, formal refinement techniques. We illustrate this with a fresh look at path problems in graphs, a topic which is regaining interest in connection with protocol verification, another of Carroll’s interests.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Höfner, P., Möller, B. Dijkstra, Floyd and Warshall meet Kleene. Form Asp Comp 24, 459–476 (2012). https://doi.org/10.1007/s00165-012-0245-4

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00165-012-0245-4

Keywords

Navigation