Fully persistent graphs—which one to choose?

  • Martin Erwig
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1467)


Functional programs, by nature, operate on functional, or persistent, data structures. Therefore, persistent graphs are a prerequisite to express functional graph algorithms. In this paper we describe two implementations of persistent graphs and compare their running times on different graph problems. Both data structures essentially represent graphs as adjacency lists. The first uses the version tree implementation of functional arrays to make adjacency lists persistent. An array cache of the newest graph version together with a time stamping technique for speeding up deletions makes it asymptotically optimal for a class of graph algorithms that use graphs in a single-threaded way. The second approach uses balanced search trees to store adjacency lists. For both structures we also consider several variations, for example, ignoring edge labels or predecessor information.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Adams, S.: Efficient Sets—A Balancing Act. Journal of Functional Programming 3 (1993) 553–561CrossRefGoogle Scholar
  2. 2.
    Aasa, A., Holström, S., Nilsson, C: An Efficiency Comparison of Some Representations of Purely Functional Arrays, BIT 28 (1988) 490–503MATHMathSciNetCrossRefGoogle Scholar
  3. 3.
    Briggs, P., Torczon, L.: An Efficient Representation for Sparse Sets, ACM Letters on Programming Languages 2 (1993) 59–69CrossRefGoogle Scholar
  4. 4.
    Driscoll, J.R., Sarnak, N., Sleator, D.D., Tarjan, R.E.: Making Data Structures Persistent. Journal of Computer and System Sciences 38 (1989) 86–124MATHMathSciNetCrossRefGoogle Scholar
  5. 5.
    Erwig. M.: Active Patterns. 8th Int. Workshop on Implementation of Functional Languages, LNCS 1268 (1996) 21–40Google Scholar
  6. 6.
    Erwig. M.: Functional Programming with Graphs. 2nd ACM SIGPLAN Int. Conf. on Functional Programming (1997) 52–65Google Scholar
  7. 7.
    Field, A.J., Harrison, P.G.: Functional Programming. Addison-Wesley, Wokingham, England (1988)MATHGoogle Scholar
  8. 8.
    Moss, G.E., Runciman, C: Auburn: A Kit for Benchmarking Functional Data Structures. 9th Int. Workshop on Implementation of Functional Languages, this LNCS volume (1997)Google Scholar
  9. 9.
    Okasaki, C.: Functional Data Structures, Advanced Functional Programming, LNCS 1129 (1996) 131–158Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1998

Authors and Affiliations

  • Martin Erwig
    • 1
  1. 1.Praktische Informatik IVFern Universität HagenHagenGermany

Personalised recommendations