# Computing the transitive closure of symmetric matrices

## Abstract

Certain real life binary relations are *symmetric* (map point connections, “iff” mathematical statements, multiprocessor links). Such relations can be represented by *symmetric* 0–1 matrices. Algorithms which take advantage of the symmetry when acting on such matrices, are more efficient than algorithms that are “good for all cases” by assuming a generic (non-symmetric) matrix. No algorithm, to our knowledge, *focusing on symmetric matrices* has been designed up to date for the computation of the transitive closure. In this paper, four algorithms - G, Symmetric, 0-1-G, 1-Symmetric - are given for computing the transitive closure of a symmetric binary relation which is represented by a 0–1 matrix. Algorithms G and 0-1-G pose no restriction on the type of the input matrix, while algorithms Symmetric and 1-Symmetric require it to be symmetric. These four algorithms are compared to Warren's algorithm in terms of the number of page faults incurred. Experimental results indicate that the new algorithms (with the exception of algorithm G) are about 2 times faster than Warren's algorithm for sparse matrices, 10 to 100 times faster for dense matrices, and about 1.4 times faster for medium dense matrices.

## Keywords

Transitive closure symmetric matrix binary relation## Preview

Unable to display preview. Download preview PDF.

## References

- [1]Arlazarov, V. L., Dinic, E. A., Kronrod, M. A., and Faradzev, I. A. “On Economical Construction of the Transitive Closure of an Oriented Graph”,
*Soviet Math. Doklady 11*, 1970, 1209–1210.Google Scholar - [2]Agrawal, R., Borgida A., and Jagadish, H., “Efficient management of transitive relationships in large data and knowledge bases”,
*ACM SIGMOD 1989*, 253–262.Google Scholar - [3]Agrawal, R. and Jagadish, H.V. “Direct Algorithms For Computing the transitive closure Of Database Relations”,
*Proc. 13-th VLDB*, Brighton, England, Sept. 1987.Google Scholar - [4]Baker, J.J. “A note on Multiplying Boolean Matrices”,
*CACM*, 1962, 102.Google Scholar - [5]Bancilhon, F. “Naive Evaluation of Recursively Defined Relations”,
*On Knowledge Based Management Systems — Integrating Database and AI Systems*, M. Brodie and J. Mylopoulos, eds., Springer-Verlag, 1985.Google Scholar - [6]Bancilhon, F. and Ramakrishnan, R. “An Amateur's Introduction to Recursive Query Processing Strategies”
*ACM SIGMOD 1986*, 16–52.Google Scholar - [7]Ioannidis, Y.E.. “On the Computation of the transitive closure of Relational Operators”,
*Proc. 12-th VLDB*, Kyoto, Japan, 1986, 403–411.Google Scholar - [8]Ioannidis, Y.E. and Ramakrishnan, R., “Efficient Transitive Closure of Relational Operators”,
*Proc. 14-th VLDB*, Los Angeles, California, 1988, 382–394.Google Scholar - [9]Jagadish, H.V., Agrawal, R., and Ness, L. “A Study of transitive closure as a Recursion Mechanism”,
*ACM SIGMOD 1987*, 331–344.Google Scholar - [10]Lu, H., “New Strategies for Computing the Transitive Closure of a Database Relation”,
*Proc. 13-th VLDB*, Brighton, England, 1987, 267–247.Google Scholar - [11]Lu, H., Mikkilineni, K., and Richrardson, J.P. “Design and Evaluation of Algorithms to Compute the transitive closure of a Database Relation”
*Proc. IEEE 3-rd Inter. Conf. Data Engineering*, Los Angeles, Feb. 1987, 112–119.Google Scholar - [12]Naughton, J.F., Ramakrishnan, R., Sagiv, Y., and Ullman, J.D., “Efficient evaluation of right-, left-, and multilinear rules”,
*ACM SIGMOD 1989*, 235–242.Google Scholar - [13]Schmitz, L., “An Improved Transitive Closure Algorithm”,
*Computing 30*, 1983, 359–371.Google Scholar - [14]Schnorr, C.P. “An Algorithm for transitive closure with Linear Expected Time”,
*SIAM J. Computing 7*, 1978, 127–133.Google Scholar - [15]Valduriez, P. and Boral, H. “Evaluation of Recursive Queries Using Join Indices”
*Proc. 1-st Inter. Conf. on Expert Database Systems*, Charleston, 1986, 197–208.Google Scholar - [16]Warren, H., Jr. “A Modification of Warshall's Algorithm for the transitive closure of Binary Relations”.
*CACM 18*, 1975, 218–220.Google Scholar - [17]Warshall, S., “A Theorem on Boolean Matrices”,
*Journal of the ACM 9*, 1962, 11–12.Google Scholar