We present two new compact transitive closure representations. The first usesintervals and the second chains to store the closure. Both representations are based on previous methods designed for acyclic graphs. The new representations are applicable to all kinds of graphs, and can be efficiently constructed during a single traversal of the input graph. We compared experimentally the average size of these representations and traditonal list based representations. The inputs were randum graphs. The interval representation outperformed the other representations: it typically required a space at most linear to the number of vertices of the input graph. The chain representation did not save much space compared to a list representation. We also studied the complexity of constructing the interval representation. Our results indicate that in the models of random graphs that we used, the transitive closure can typically be computed in a time linear to the size of the input graph when the interval representation is used. A conclusion is that in a disk environment, the bottleneck of transitive closure computation is typically the traversal of the input, not the construction of the output. Our experimental method is based on a sound statistical approach and it is applicable to other experimental studies of algorithms as well. (Copyright (c) 1996 by Helsinki University of Technology.)
展开▼