Fully persistent graphs—which one to choose?
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.
- 5.Erwig. M.: Active Patterns. 8th Int. Workshop on Implementation of Functional Languages, LNCS 1268 (1996) 21–40Google Scholar
- 6.Erwig. M.: Functional Programming with Graphs. 2nd ACM SIGPLAN Int. Conf. on Functional Programming (1997) 52–65Google Scholar
- 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.Okasaki, C.: Functional Data Structures, Advanced Functional Programming, LNCS 1129 (1996) 131–158Google Scholar