skip to main content
article

Algebraic graphs with class (functional pearl)

Published:07 September 2017Publication History
Skip Abstract Section

Abstract

The paper presents a minimalistic and elegant approach to working with graphs in Haskell. It is built on a rigorous mathematical foundation --- an algebra of graphs --- that allows us to apply equational reasoning for proving the correctness of graph transformation algorithms. Algebraic graphs let us avoid partial functions typically caused by `malformed graphs' that contain an edge referring to a non-existent vertex. This helps to liberate APIs of existing graph libraries from partial functions.

The algebra of graphs can represent directed, undirected, reflexive and transitive graphs, as well as hypergraphs, by appropriately choosing the set of underlying axioms. The flexibility of the approach is demonstrated by developing a library for constructing and transforming polymorphic graphs.

References

  1. Arseniy Alekseyev. 2014. Compositional approach to design of digital circuits. Ph.D. Dissertation. Newcastle University.Google ScholarGoogle Scholar
  2. Jonathan Beaumont, Andrey Mokhov, Danil Sokolov, and Alex Yakovlev. 2015. Compositional design of asynchronous circuits from behavioural concepts. In ACM/IEEE International Conference on Formal Methods and Models for Codesign (MEMOCODE). IEEE, 118–127. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Filippo Bonchi, Pawel Sobocinski, and Fabio Zanasi. 2015. Full abstraction for signal flow graphs. In ACM SIGPLAN Notices, Vol. 50. ACM, 515–526. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Manuel Chakravarty, Gabriele Keller, and Simon Peyton Jones. 2005. Associated type synonyms. In ACM SIGPLAN Notices, Vol. 40. ACM, 241–253. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Derek G Corneil, H Lerchs, and L Stewart Burlingham. 1981. Complement reducible graphs. Discrete Applied Mathematics 3, 3 (1981), 163–174.Google ScholarGoogle ScholarCross RefCross Ref
  6. Stephen Dolan. 2013. Fun with semirings: a functional pearl on the abuse of linear algebra. In ACM SIGPLAN Notices, Vol. 48. ACM, 101–110. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Martin Erwig. 2001. Inductive graphs and functional graph algorithms. Journal of Functional Programming 11, 05 (2001), 467–492. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Jeremy Gibbons. 1995. An initial-algebra approach to directed acyclic graphs. In International Conference on Mathematics of Program Construction. Springer, 282– 303. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Jeremy Gibbons and Nicolas Wu. 2014. Folding domain-specific languages: Deep and shallow embeddings (functional pearl). In ACM SIGPLAN Notices, Vol. 49. ACM, 339–347. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jonathan S Golan. 1999. Semirings and their Applications. Springer Science & Business Media.Google ScholarGoogle Scholar
  11. Frank Harary. 1969. Graph theory. Addison-Wesley.Google ScholarGoogle Scholar
  12. David J King and John Launchbury. 1995. Structuring depth-first search algorithms in Haskell. In Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages. ACM, 344–354. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. John Launchbury and Simon L Peyton Jones. 1994. Lazy functional state threads. In ACM SIGPLAN Notices, Vol. 29. ACM, 24–35. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Saunders Mac Lane and Garrett Birkhoff. 1999. Algebra. Chelsea Publishing Company.Google ScholarGoogle Scholar
  15. Ross M McConnell and Fabien De Montgolfier. 2005. Linear-time modular decomposition of directed graphs. Discrete Applied Mathematics 145, 2 (2005), 198–209. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Andrey Mokhov. 2015. Algebra of switching networks. IET Computers & Digital Techniques (2015).Google ScholarGoogle Scholar
  17. Andrey Mokhov and Victor Khomenko. 2014. Algebra of Parameterised Graphs. ACM Transactions on Embedded Computing Systems 13, 4s (2014), 1–22. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Tadao Murata. 1989. Petri nets: Properties, analysis and applications. Proc. IEEE 77, 4 (1989), 541–580.Google ScholarGoogle ScholarCross RefCross Ref
  19. Peter Selinger. 2010. A survey of graphical languages for monoidal categories. In New structures for physics. Springer, 289–355.Google ScholarGoogle Scholar
  20. Robert E Tarjan and Jan Van Leeuwen. 1984. Worst-case analysis of set union algorithms. Journal of the ACM (JACM) 31, 2 (1984), 245–281. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Jacobo Valdes, Robert E Tarjan, and Eugene L Lawler. 1979. The recognition of series parallel digraphs. In Proceedings of the eleventh annual ACM symposium on Theory of computing. ACM, 1–12. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Algebraic graphs with class (functional pearl)

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 52, Issue 10
      Haskell '17
      October 2017
      211 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/3156695
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
      • cover image ACM Conferences
        Haskell 2017: Proceedings of the 10th ACM SIGPLAN International Symposium on Haskell
        September 2017
        211 pages
        ISBN:9781450351829
        DOI:10.1145/3122955

      Copyright © 2017 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 7 September 2017

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!