Skip to main content
Log in

On computing the transitive closure of a relation

  • Published:
Acta Informatica Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. 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)

    Google Scholar 

  2. 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)

    MATH  Google Scholar 

  3. Knuth, D.E.: Top-down syntax analysis. Acta Informat. 1, 79–110 (1971)

    MATH  Google Scholar 

  4. Knuth, D.E.: The art of computer programming, Vol. 1, 2nd ed. Reading (Mass): Addison-Wesley 1973

    Google Scholar 

  5. Purdom, P.: A transitive closure algorithm. BIT 10, 76–94 (1970)

    Article  MATH  Google Scholar 

  6. Syslo, M.M., Dzikiewicz, J.: Computational experiences with some transitive closure algorithms. Computing 15, 33–39 (1975)

    Google Scholar 

  7. Tarjan, R.: Depth-first search and linear graph algorithms. SIAM J. Computing 1, 146–160 (1972)

    Article  MATH  MathSciNet  Google Scholar 

  8. Warshall, S.: A theorem on Boolean Matrices. J. Assoc. Comput. Mach. 9, 11–12 (1962)

    MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

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

Reprints 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

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00271339

Keywords

Navigation