Transitive closure algorithms based on graph traversal
- 1 September 1993
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Database Systems
- Vol. 18 (3) , 512-576
- https://doi.org/10.1145/155271.155273
Abstract
Several graph-based algorithms have been proposed in the literature to compute the transitive closure of a directed graph. We develop two new algorithms (Basic_TC and Gobal_DFTC) and compare the performance of their implementations in a disk-based environment with a well-known graph-based algorithm proposed by Schmitz. Our algorithms use depth-first search to traverse a graph and a technique called marking to avoid processing some of the arcs in the graph. They compute the closure by processing nodes in reverse topological order, building descendent sets by adding the descendent sets of children. While the details of these algorithms differ considerably, one important difference among them is the time at which descendent set additions are performed. Basic_TC, results in superior performance. The first reason is that early additions result in larger descendent set sizes on the average over the duration of the execution, thereby causing more I/O; very often this turns out to more than offset the gains of not having to fetch certain sets again to add them. The second reason is that information collected in the first pass can be used to apply several optimizations in the second pass. To the extent possible, we also adapt these algorithms to perform path computations. Again, our performance comparison confirms the trends seen in reachability queries. Taken in conjunction with another performance study our results indicate that all graph-based algorithms significantly outperform other types of algorithms such as Seminaive and Warren.Keywords
This publication has 13 references indexed in Scilit:
- Performance evaluation of algorithms for transitive closureInformation Systems, 1992
- Efficient algorithms for the instantiated transitive closure queriesIEEE Transactions on Software Engineering, 1991
- Direct transitive closure algorithms: design and performance evaluationACM Transactions on Database Systems, 1990
- A sensitive transitive closure algorithmInformation Processing Letters, 1981
- On computing the transitive closure of a relationActa Informatica, 1977
- A modification of Warshall's algorithm for the transitive closure of binary relationsCommunications of the ACM, 1975
- Depth-First Search and Linear Graph AlgorithmsSIAM Journal on Computing, 1972
- A transitive closure algorithmBIT Numerical Mathematics, 1970
- A Theorem on Boolean MatricesJournal of the ACM, 1962
- A note on two problems in connexion with graphsNumerische Mathematik, 1959