Skip to main content

Graph Problems and Vector-Matrix Multiplications in Haskell

  • Conference paper
  • First Online:
Trends in Functional Programming (TFP 2014)

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

Included in the following conference series:

  • 682 Accesses

Abstract

It is a known fact that many graph problems can be restated in terms of an algebraic setting. One particular operation that arises in such a setting is the multiplication of a vector with a matrix. Depending on the underlying algebra the multiplication can carry different reachability semantics (e.g. no additional information, single path prolongation, all path prolongation). We propose an abstraction of this operation that is easily implemented in the functional programming language Haskell, explore the associated framework and provide several applications.

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 34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.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. Berghammer, R.: A functional, successor list based version of warshall’s algorithm with applications. In: de Swart, H. (ed.) RAMICS 2011. LNCS, vol. 6663, pp. 109–124. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  2. Chakravarty, M.M.T., Keller, G.: An approach to fast arrays in haskell. In: Jeuring, J., Jones, S.L.P. (eds.) AFP 2002. LNCS, vol. 2638, pp. 27–58. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  3. Danilenko, N.: Using relations to develop a haskell program for computing maximum bipartite matchings. In: Kahl, W., Griffin, T.G. (eds.) RAMICS 2012. LNCS, vol. 7560, pp. 130–145. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  4. Dinitz, Y.: Dinitz’ algorithm: the original version and even’s version. In: Goldreich, O., Rosenberg, A.L., Selman, A.L. (eds.) Theoretical Computer Science. LNCS, vol. 3895, pp. 218–240. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  5. Dolan, S.: Fun with semirings: a functional pearl on the abuse of linear algebra. In: Morrisett, G., Uustalu, T. (eds.) ICFP 2013, pp. 101–110. ACM (2013)

    Google Scholar 

  6. Elliott, C.: Reimagining Matrices. www.conal.net/blog/posts/reimagining-matrices

  7. Erwig, M.: Inductive Graphs and Functional Graph Algorithms. J. Funct. Program. 11(05), 467–492 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  8. Hinze, R., Paterson, R.: Finger Trees: A Simple General-Purpose Data Structure. J. Funct. Program. 16(2), 197–217 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  9. Hopcroft, J.E., Karp, R.M.: An n\(^{\text{5/2 }}\) Algorithm for Maximum Matchings in Bipartite Graphs. SIAM J. Comput. 2(4), 225–231 (1973)

    Article  MATH  MathSciNet  Google Scholar 

  10. Johnsson, T.: Efficient Graph Algorithms Using Lazy Monolithic Arrays. J. Funct. Program. 8(4), 323–333 (1998)

    Article  MATH  MathSciNet  Google Scholar 

  11. King, D.J., Launchbury, J.: Structuring depth-first search algorithms in haskell. In: Cytron, R.K., Lee, P. (eds.) POPL, pp. 344–354. ACM (1995)

    Google Scholar 

  12. Kozen, D.: On kleene algebras and closed semirings. In: Rovan, B. (ed.) MFCS 1990. LNCS, vol. 452, pp. 26–47. Springer, Heidelberg (1990)

    Chapter  Google Scholar 

  13. Lesniak, M.: Palovca: describing and executing graph algorithms in haskell. In: Russo, C., Zhou, N.-F. (eds.) PADL 2012. LNCS, vol. 7149, pp. 153–167. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  14. Liang, S., Hudak, P., Jones, M.: Monad transformers and modular interpreters. In: Cytron, R.K., Lee, P. (eds.) POPL, pp. 333–343. ACM (1995)

    Google Scholar 

  15. Marlow, S.: The Haskell report. www.haskell.org/onlinereport/haskell2010

  16. Rabhi, F., Lapalme, G.: Algorithms - A Functional Programming Approach. Addison-Wesley (1999)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Nikita Danilenko .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Danilenko, N. (2015). Graph Problems and Vector-Matrix Multiplications in Haskell. In: Hage, J., McCarthy, J. (eds) Trends in Functional Programming. TFP 2014. Lecture Notes in Computer Science(), vol 8843. Springer, Cham. https://doi.org/10.1007/978-3-319-14675-1_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-14675-1_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-14674-4

  • Online ISBN: 978-3-319-14675-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics