Summary
An algorithm is presented for computing the transitive closure of an arbitrary relation which is based upon Tarjan's algorithm [7] for finding the strongly connected components of a directed graph. A new formulation, justifying a somewhat simplified statement of the latter, characterises weaker restrictions on the form of the graph traversal than Tarjan's depth first conditions and reveals aspects of the behaviour of this algorithm which have been obscure hitherto.
If V is the number of vertices in the directed graph representing the relation then the worst case behaviour, O(V 3) is inferior to existing algorithms [1, 2] which require O(V 3/log V) and \(O(V^{log_2 7} log V)\) operations respectively. The best case performance, O(V 2) operations, is better. Viewed in this way, it is similar to other algorithms [5, 6, 8] but it combines the improved efficiency in the presence of strongly connected components which characterises the algorithms in [5, 6] with the advantages of Warshall's algorithm [8], namely, succinctness, a single traversal of the directed graph and ability to exploit the availability of Boolean vector operations.
Similar content being viewed by others
References
Artazarov, V.L., Dinic, E.A., Kronrod, D.A., Faradzev, I.A.: On economical construction of the transitive closure of a directed graph. Soviet Math. Dokl. 11, 1209–1210 (1970)
Furman, F.E.: Application of a method of fast multiplication of matrices in the problem of finding the transitive closure of a graph. Soviet Math. Dokl. 11, 1252 (1970)
Knuth, D.E.: Top-down syntax analysis. Acta Informat. 1, 79–110 (1971)
Knuth, D.E.: The art of computer programming, Vol. 1, 2nd ed. Reading (Mass): Addison-Wesley 1973
Purdom, P.: A transitive closure algorithm. BIT 10, 76–94 (1970)
Syslo, M.M., Dzikiewicz, J.: Computational experiences with some transitive closure algorithms. Computing 15, 33–39 (1975)
Tarjan, R.: Depth-first search and linear graph algorithms. SIAM J. Computing 1, 146–160 (1972)
Warshall, S.: A theorem on Boolean Matrices. J. Assoc. Comput. Mach. 9, 11–12 (1962)
Author information
Authors and Affiliations
Additional information
This research was begun while the authors were visiting Stanford University and was supported in part by National Science Foundation grant DCR72-03752 A02 and by the Office of Naval Research contract NR 044-402
Rights and permissions
About this article
Cite this article
Eve, J., Kurki-Suonio, R. On computing the transitive closure of a relation. Acta Informatica 8, 303–314 (1977). https://doi.org/10.1007/BF00271339
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF00271339