Title: Fast%20Sparse%20Matrix%20Multiplication
1Fast SparseMatrix Multiplication
- Raphael YusterHaifa University (Oranim)
- Uri ZwickTel Aviv University
- ESA 2004
2Matrix multiplication
j
i
?
3Matrix multiplication
Authors Complexity
- n3
Strassen (1969) n2.81
Coppersmith, Winograd (1990) n2.38
4Sparse Matrix Multiplication
?
n - number of rows and columnsm - number of
non-zero elements
The distribution of the non-zeroelements in the
matrices is arbitrary!
5Sparse Matrix Multiplication
j
k
k
?
Each element of B is multiplied by at most n
elements from A. Complexity mn
6Matrix multiplication
Authors Complexity
Coppersmith, Winograd (1990) n2.38
- mn
here m0.7n1.2n2o(1)
Can we do something better?
7Comparison
mn
m0.7n1.2n2
?
n2.38
Complexity n?
r (mnr)
8A closer look at the naïve algorithm
?
9Complexity of the naïve algorithm
Complexity
where
Can it really be that bad?
10Best case for naïve algorithm
Regular case
11Worst case for naïve algorithm
12Worst case for naïve algorithm
0
?
0
13Rectangular Matrix multiplication
Coppersmith (1997) Complexity
n1.85p0.54n2o(1)
For p n0.29, complexity n2o(1) !!!
14The combined algorithm
Fast rectangularmatrix multiplication
Naïve sparsematrix multiplication
Assume a1b1 a2b2 anbn
Choose 0 p n
Compute AB A1B1 A2B2
15Analysis of combined algorithm
Theorem There exists a 1pn for which
16Multiplying three sparse matrices
?
?
A
B
C
n - number of rows and columnsm - number of
non-zero elements
17Applications
- Computing the square of a sparse graph
- Finding short cycles (YZ04)
- Other applications?
18Open 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?