Skip to main content

Graph algorithms with a functional flavour

  • Conference paper
  • First Online:
Book cover Advanced Functional Programming (AFP 1995)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 925))

Included in the following conference series:

Abstract

Graph algorithms have long been a challenge to program in a pure functional language. Previous attempts have either tended to be unreadable, or have failed to achieve standard asymptotic complexity measures. We explore a number of graph search algorithms in which we achieve standard complexities, while significantly improving upon traditional imperative presentations. In particular, we construct the algorithms from reusable components, so providing a greater level of modularity than is typical elsewhere. Furthermore, we provide examples of correctness proofs which are quite different from traditional proofs, largely because they are not based upon reasoning about the dynamic process of graph traversal, but rather reason about a static value.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. T.H.Corman, C.E.Leiserson, and R.L.Rivest, Introduction to Algorithms. MIT Press, MA, 1990.

    Google Scholar 

  2. J.Darlington and R.Burstall, A System which Automatically Improves Programs. Acta Informatica, 6(1), pp 41–60, 1976.

    Google Scholar 

  3. R.Harrison, Abstract Data Types in Standard ML. John Wiley and Sons, 1993.

    Google Scholar 

  4. I.Holyer, Functional Programming with Miranda. Pitman, London, 1991.

    Google Scholar 

  5. J.E.Hopcroft and R.E.Tarjan, Algorithm 447: Efficient Algorithms for Graph Manipulation. Communications of the ACM, 16(6), pp 372–378.

    Google Scholar 

  6. R.J.M.Hughes, Lazy Memo Functions. Proc. FPCA 85, Nancy, LNCS 201, Springer-Verlag, 1985.

    Google Scholar 

  7. T.Johnsson, Efficient Graph Algorithms Using Lazy Monolithic Arrays, unpublished.

    Google Scholar 

  8. D.King and J.Launchbury, Structuring Depth-First Search Algorithms in Haskell. Proc. POPL, San Francisco, CA, 1995.

    Google Scholar 

  9. J.Launchbury and S.Peyton Jones, Lazy Functional State Threads. Proc. PLDI, Orlando, FL, 1994.

    Google Scholar 

  10. J.Launchbury and S.Peyton Jones, State in Haskell. LASC Special issue on State in Programming Languages, to appear.

    Google Scholar 

  11. U.Manber, Introduction to Algorithms—A Creative Approach. Addison-Wesley, MA, 1989.

    Google Scholar 

  12. E.Moggi, Computational Lambda-Calculus and Monads. Proc LICS, Asilomar, CA, 1989.

    Google Scholar 

  13. L.C.Paulson, ML for the working programmer. Cambridge University Press, 1991.

    Google Scholar 

  14. M.Sharir, A Strong-Connectivity Algorithm and its Application in Data Flow Analysis. Computers and Mathematics with Applications, 7(1), pp 67–72.

    Google Scholar 

  15. R.E.Tarjan, Depth-first Search and Linear Graph Algorithms. SIAM J. of Computing, 1(2), pp 146–160.

    Google Scholar 

  16. P.Wadler, Comprehending Monads, Proc. L&FP, Nice, France, 1990.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Johan Jeuring Erik Meijer

Rights and permissions

Reprints and permissions

Copyright information

© 1995 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Launchbury, J. (1995). Graph algorithms with a functional flavour. In: Jeuring, J., Meijer, E. (eds) Advanced Functional Programming. AFP 1995. Lecture Notes in Computer Science, vol 925. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-59451-5_9

Download citation

  • DOI: https://doi.org/10.1007/3-540-59451-5_9

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-59451-2

  • Online ISBN: 978-3-540-49270-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics