200 likes | 456 Views
Fast Sparse Matrix Multiplication. Raphael Yuster Haifa University (Oranim) Uri Zwick Tel Aviv University ESA 2004. Matrix multiplication. j. i. =. . Matrix multiplication. Sparse Matrix Multiplication. =. . n - number of rows and columns m - number of non-zero elements.
E N D
Fast SparseMatrix Multiplication Raphael YusterHaifa University (Oranim) Uri ZwickTel Aviv University ESA 2004
Matrix multiplication j i =
Sparse Matrix Multiplication = n - number of rows and columnsm - number of non-zero elements The distribution of the non-zeroelements in the matrices is arbitrary!
Sparse Matrix Multiplication j k k = Each element of B is multiplied by at most n elements from A. Complexity:mn
Matrix multiplication Can we do something better?
Comparison mn m0.7n1.2+n2 n2.38 Complexity = n r (m=nr)
= A closer look at the naïve algorithm =
Complexity of the naïve algorithm Complexity = where Can it really be that bad?
Best case for naïve algorithm Regular case:
Worst case for naïve algorithm 0 = 0
p n n n = n p Rectangular Matrix multiplication Coppersmith (1997):Complexity ≤ n1.85p0.54+n2+o(1) For p ≤ n0.29, complexity = n2+o(1) !!!
B1 A2 A1 B2 Complexity: The combined algorithm Fast rectangularmatrix multiplication Naïve sparsematrix multiplication Assume:a1b1 ≥ a2b2 ≥ … ≥ anbn Choose: 0 ≤ p ≤ n Compute:AB = A1B1+ A2B2
Lemma: Analysis of combined algorithm Theorem:There exists a 1≤p≤n for which
Complexity of new algorithm: m0.64n1.46+n2+o(1) Multiplying three sparse matrices A B C n - number of rows and columnsm - number of non-zero elements
Applications • Computing the square of a sparse graph • Finding short cycles (YZ’04) • Other applications?
Open problems • A faster, more sophisticated, algorithmfor sparse matrix multiplication? • A faster algorithm for multiplying three or more sparse matrices? • An O(m1-n1+) transitive closure algorithm?