Abstract
Suppose a directed graph has its arcs stored in secondary memory, and we wish to compute its transitive closure, also storing the result in secondary memory. We assume that an amount of main memory capable of holdings “values” is available, and thats lies betweenn, the number of nodes of the graph, ande, the number of arcs. The cost measure we use for algorithms is theI/O complexity of Kung and Hong, where we count 1 every time a value is moved into main memory from secondary memory, or vice versa.
In the dense case, wheree is close ton 2, we show that I/O equal toO(n 3/√s) is sufficient to compute the transitive closure of ann-node graph, using main memory of sizes. Moreover, it is necessary for any algorithm that is “standard,” in a sense to be defined precisely in the paper. Roughly, “standard” means that paths are constructed only by concatenating arcs and previously discovered paths. For the sparse case, we show that I/O equal toO(n 2√e/s) is sufficient, although the algorithm we propose meets our definition of “standard” only if the underlying graph is acyclic. We also show thatΩ(n 2√e/s) is necessary for any standard algorithm in the sparse case. That settles the I/O complexity of the sparse/acyclic case, for standard algorithms. It is unknown whether this complexity can be achieved in the sparse, cyclic case, by a standard algorithm, and it is unknown whether the bound can be beaten by nonstandard algorithms.
We then consider a special kind of standard algorithm, in which paths are constructed only by concatenating arcs and old paths, never by concatenating two old paths. This restriction seems essential if we are to take advantage of sparseness. Unfortunately, we show that almost another factor ofn I/O is necessary. That is, there is an algorithm in this class using I/OO(n 3√e/s) for arbitrary sparse graphs, including cyclic ones. Moreover, every algorithm in the restricted class must useΩ(n 3√e/s/log3 n) I/O, on some cyclic graphs.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.References
A. Agrawal and H.V. Jagadish, Direct algorithms for computing the transitive closure of database relations,Proc. Int. Conf. on Very Large Data Bases (1987) pp. 255–266.
A.V. Aho, J.E. Hopcroft and J.D. Ullman,The Design and Analysis of Computer Algorithms (Addison-Wesley, Reading, MA, 1974).
V.E. Benes,Mathematical Theory of Connecting Networks and Telephone Traffic (Academic Press, New York, 1965)
D. Coppersmith and S. Winograd, Matrix multiplication via arithmetic progressions,Proc. 19th Annual ACM Symp. on the Theory of Computing (1987) pp. 1–6.
H.-T. Kung and J.-W. Hong, The red-blue pebble game,Proc. 13th Annual ACM Symp. on the Theory of Computing (1980) pp. 326–333.
J.E. Hopcroft and R.E. Tarjan, Efficient algorithms for graph manipulation, Comm. ACM 16: 6 (1973) 372–378.
Y.E. Ioannidis and R. Ramakrishnan, Efficient transitive closure algorithms, CSTR-765, Dept. of CS, Univ. of Wisconsin (1988).
G.L. Lovasz,Combinatorial Problems and Exercises (North-Holland, Amsterdam, 1979).
A.C. McKellar and E.G. Coffman, Organizing matrices and matrix operations for paged memory systems, Comm. ACM 12: 3 (1969) 153–165.
J.D. Ullman,Principles of Database and Knowledge-Base Systems, Vol. 1: Classical Database Systems (Computer Science Press, New York, 1989).
J.D. Ullman,Principles of Database and Knowledge-Base Systems, Vol. 2: The New Technologies (Computer Science Press, New York, 1989).
H.S. Warren, A modification of Warshall's algorithm for the transitive closure of binary relations, Comm. ACM 18: 4 (1975) 218–220.
S. Warshall, A theorem on Boolean matrices, J. ACM 9: 1 (1962) 11–12.
Author information
Authors and Affiliations
Additional information
The work of this author was partially supported by NSF grant IRI-87-22886, IBM contract 476816, Air Force grant AFOSR-88-0266 and a Guggenheim fellowship.
Rights and permissions
About this article
Cite this article
Ullman, J.D., Yannakakis, M. The input/output complexity of transitive closure. Ann Math Artif Intell 3, 331–360 (1991). https://doi.org/10.1007/BF01530929
Issue Date:
DOI: https://doi.org/10.1007/BF01530929