A Fast Output-Sensitive Algorithm for Boolean Matrix Multiplication

We use randomness to exploit the potential sparsity of the Boolean matrix product in order to speed up the computation of the product. Our new fast output-sensitive algorithm for Boolean matrix product and its witnesses is randomized and provides the Boolean product and its witnesses almost certainly. Its worst-case time performance is expressed in terms of the input size and the number of non-zero entries of the product matrix. It runs in time $\widetilde{O}(n^{2}s^{\omega/2-1})$, where the input matrices have size n×n, the number of non-zero entries in the product matrix is at most s, ω is the exponent of the fast matrix multiplication and $\widetilde{O}(f(n))$ denotes O(f(n)log dn) for some constant d. By the currently best bound on ω, its running time can be also expressed as $\widetilde{O}(n^{2}s^{0.188})$. Our algorithm is substantially faster than the output-sensitive column-row method for Boolean matrix product for s larger than n1.232 and it is never slower than the fast $\widetilde{O}(n^{\omega})$-time algorithm for this problem. By applying the fast rectangular matrix multiplication, we can refine our upper bound further to the form $\widetilde{O}(n^{\omega(\frac{1}{2}\log_{n}s,1,1)})$, where ω(p,q,t) is the exponent of the fast multiplication of an np×nq matrix by an nq×nt matrix.We also present a partial derandomization of our algorithm as well as its generalization to include the Boolean product of rectangular Boolean matrices. Finally, we show several applications of our output-sensitive algorithms.

[1]  A. George,et al.  Graph theory and sparse matrix computation , 1993 .

[2]  Raphael Yuster,et al.  Fast sparse matrix multiplication , 2004, TALG.

[3]  Don Coppersmith,et al.  Matrix multiplication via arithmetic progressions , 1987, STOC.

[4]  Noga Alon,et al.  The Space Complexity of Approximating the Frequency Moments , 1999 .

[5]  Noga Alon,et al.  Derandomization, witnesses for Boolean matrix multiplication and construction of perfect hash functions , 1994, Algorithmica.

[6]  Edith Cohen,et al.  Structure Prediction and Computation of Sparse Matrix Products , 1998, J. Comb. Optim..

[7]  C. R. Subramanian,et al.  Almost optimal (on the average) algorithms for boolean matrix product witnesses, computing the diameter , 1998 .

[8]  Raphael Yuster,et al.  All-Pairs Bottleneck Paths in Vertex Weighted Graphs , 2007, SODA '07.

[9]  Andrzej Lingas,et al.  Faster algorithms for finding lowest common ancestors in directed acyclic graphs , 2007, Theor. Comput. Sci..

[10]  Edith Cohen,et al.  Estimating the size of the transitive closure in linear time , 1994, Proceedings 35th Annual Symposium on Foundations of Computer Science.

[11]  Don Coppersmith,et al.  Rectangular Matrix Multiplication Revisited , 1997, J. Complex..

[12]  Wojciech Rytter,et al.  Fast Recognition of Pushdown Automaton and Context-free Languages , 1986, Inf. Control..

[13]  Noga Alon,et al.  Witnesses for Boolean matrix multiplication and for shortest paths , 1992, Proceedings., 33rd Annual Symposium on Foundations of Computer Science.

[14]  Robert H. Halstead,et al.  Matrix Computations , 2011, Encyclopedia of Parallel Computing.

[15]  Rasmus Pagh,et al.  Faster join-projects and sparse matrix multiplications , 2009, ICDT '09.

[16]  A. Joffe On a Set of Almost Deterministic $k$-Independent Random Variables , 1974 .

[17]  J. Ian Munro,et al.  Efficient Determination of the Transitive Closure of a Directed Graph , 1971, Inf. Process. Lett..

[18]  Raimund Seidel,et al.  On the all-pairs-shortest-path problem , 1992, STOC '92.

[19]  Victor Y. Pan,et al.  Fast Rectangular Matrix Multiplication and Applications , 1998, J. Complex..

[20]  Alan M. Frieze,et al.  Min-Wise Independent Permutations , 2000, J. Comput. Syst. Sci..

[21]  Kurt Mehlhorn,et al.  Monotone Switching Circuits and Boolean Matrix Product , 1975, MFCS.

[22]  Vaughan R. Pratt,et al.  The power of negative thinking in multiplying Boolean matrices , 1974, STOC '74.

[23]  R. Motwani,et al.  On Diameter Verification and Boolean Matrix Multiplication. , 1995 .

[24]  Rajeev Motwani,et al.  Randomized algorithms , 1996, CSUR.

[25]  Andrzej Lingas,et al.  LCA Queries in Directed Acyclic Graphs , 2005, ICALP.

[26]  Mike Paterson,et al.  Complexity of Monotone Networks for Boolean Matrix Product , 1974, Theor. Comput. Sci..

[27]  Manindra Agrawal,et al.  PRIMES is in P , 2004 .

[28]  Oded Goldreich,et al.  On the power of two-point based sampling , 1989, J. Complex..