Skip to main content

A Functional, Successor List Based Version of Warshall’s Algorithm with Applications

  • Conference paper
Relational and Algebraic Methods in Computer Science (RAMICS 2011)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6663))

Abstract

We show how formally and systematically to develop a purely functional version of Warshall’s algorithm for computing transitive closures by combining the unfold-fold technique, relation-algebra and data refinement. It is based on an implementation of relations by lists of successor lists. The final version can immediately be implemented in Haskell. This resulting Haskell program has the same runtime complexity as the traditional imperative array-based implementation of Warshall’s algorithm. We also demonstrate how it can be re-used as component in other functional algorithms.

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 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight 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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aarts, A., et al.: Fixed point calculus. Inform. Proc. Lett. 53, 131–136 (1996)

    MathSciNet  Google Scholar 

  2. Aho, A., Garey, M., Ullman, J.: The transitive reduction of a directed graph. SIAM J. of Comput. 1, 131–137 (1972)

    Article  MathSciNet  MATH  Google Scholar 

  3. Antoy, S., Hanus, M.: Functional logic programming. Comm. of the ACM 53, 74–85 (2010)

    Article  Google Scholar 

  4. Berghammer, R., Ehler, H., Zierer, H.: Development of graph algorithms by program transformation. In: Göttler, H., Schneider, H.-J. (eds.) WG 1987. LNCS, vol. 314, pp. 206–218. Springer, Heidelberg (1988)

    Chapter  Google Scholar 

  5. Berghammer, R., von Karger, B.: Algorithms from relational specification. In: Brink, C., Kahl, W., Schmidt, G. (eds.) Relational Methods in Computer Science, pp. 131–149. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  6. Berghammer, R., Neumann, F.: RelView – An OBDD-Based Computer Algebra System for Relations. In: Ganzha, V.G., Mayr, E.W., Vorozhtsov, E.V. (eds.) CASC 2005. LNCS, vol. 3718, pp. 40–51. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  7. Berghammer, R., Fischer, S.: Implementing relational specifications in a constraint functional language. Electr. Notes on Theor. Comput. Sci. 177, 169–183 (2007)

    Article  MATH  Google Scholar 

  8. Berghammer, R.: Ordnungen, Verbände und Relationen mit Anwendungen (Orders, lattices and relations with applications). Vieweg-Teubner, Stuttgart (2008)

    Google Scholar 

  9. Bird, R.: Introduction to functional programming using Haskell, 2nd edn. Prentice-Hall, Englewood Cliffs (1998)

    Google Scholar 

  10. Burstall, R.M., Darlington, J.: A transformation system for developing recursive programs. J. of the ACM 24, 44–67 (1977)

    Article  MathSciNet  MATH  Google Scholar 

  11. Chen, Y.: On the evaluation of large and sparse graph reachability queries. In: Bhowmick, S.S., Küng, J., Wagner, R. (eds.) DEXA 2008. LNCS, vol. 5181, pp. 97–105. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  12. Erwig, M.: Functional programming with graphs. ACM SIGPLAN Notices 32, 52–65 (1997)

    Article  MATH  Google Scholar 

  13. Erwig, M.: Inductive graphs and functional graph algorithms. J. of Funct. Progr. 11, 467–492 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  14. Floyd, R.W.: Algorithm 97 (Shortest path). Comm. of the ACM 5, 345 (1962)

    Article  Google Scholar 

  15. Fredmann, M.L.: New bounds on the complexity of the shortest path problem. SIAM J. on Comput. 5, 83–89 (1976)

    Article  MathSciNet  Google Scholar 

  16. Gibbons, J.: An initial algebra approach to directed graphs. In: Möller, B. (ed.) MPC 1995. LNCS, vol. 947, pp. 282–303. Springer, Heidelberg (1995)

    Chapter  Google Scholar 

  17. Kahl, W.: Semigroupoid interfaces for relation-algebraic programming in Haskell. In: Schmidt, R.A. (ed.) RelMiCS/AKA 2006. LNCS, vol. 4136, pp. 235–250. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  18. King, D.J., Launchbury, J.: Structuring depth-first search algorithms in Haskell. In: ACM Symposium on Principles of Programming, pp. 344–356. ACM, New York (1995)

    Google Scholar 

  19. Launchbury, J.: Graph algorithms with a functional flavour. In: Jeuring, J., Meijer, E. (eds.) AFP 1995. LNCS, vol. 925, pp. 308–331 (2005)

    Google Scholar 

  20. Lohrey, M.: Complexity results for confluence problems. In: Kutyłowski, M., Wierzbicki, T., Pacholski, L. (eds.) MFCS 1999. LNCS, vol. 1672, pp. 114–124. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  21. Penn, G.: The algebraic structure of transitive closure and its application to attributed type signatures. Grammars 3, 295–312 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  22. Schmidt, G., Ströhlein, T.: Relations and graphs. Discrete Mathematics for Computer Scientists. Springer, Heidelberg (1993)

    Book  MATH  Google Scholar 

  23. Schmidt, G.: A proposal for a multilevel relational reference language. J. of Relat. Meth. in Comput. Sci. 1, 314–338 (2004)

    Google Scholar 

  24. Strassen, V.: Gaussian elimination is not optimal. Num. Math. 13, 354–356 (1969)

    Article  MathSciNet  MATH  Google Scholar 

  25. Thompson, S.: Haskell – The craft of functional programming. Addison-Wesley, Reading (1999)

    Google Scholar 

  26. Warshall, S.: A theorem on Boolean matrices. J. of the ACM 9, 11–12 (1962)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Berghammer, R. (2011). A Functional, Successor List Based Version of Warshall’s Algorithm with Applications. In: de Swart, H. (eds) Relational and Algebraic Methods in Computer Science. RAMICS 2011. Lecture Notes in Computer Science, vol 6663. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-21070-9_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-21070-9_10

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-21069-3

  • Online ISBN: 978-3-642-21070-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics