English

The Input/Output Complexity of Sparse Matrix Multiplication

Data Structures and Algorithms 2014-03-17 v1

Abstract

We consider the problem of multiplying sparse matrices (over a semiring) where the number of non-zero entries is larger than main memory. In the classical paper of Hong and Kung (STOC '81) it was shown that to compute a product of dense U×UU \times U matrices, Θ(U3/(BM))\Theta \left(U^3 / (B \sqrt{M}) \right) I/Os are necessary and sufficient in the I/O model with internal memory size MM and memory block size BB. In this paper we generalize the upper and lower bounds of Hong and Kung to the sparse case. Our bounds depend of the number N=nnz(A)+nnz(C)N = \mathtt{nnz}(A)+\mathtt{nnz}(C) of nonzero entries in AA and CC, as well as the number Z=nnz(AC)Z = \mathtt{nnz}(AC) of nonzero entries in ACAC. We show that ACAC can be computed using O~(NBmin(ZM,NM))\tilde{O} \left(\tfrac{N}{B} \min\left(\sqrt{\tfrac{Z}{M}},\tfrac{N}{M}\right) \right) I/Os, with high probability. This is tight (up to polylogarithmic factors) when only semiring operations are allowed, even for dense rectangular matrices: We show a lower bound of Ω(NBmin(ZM,NM))\Omega \left(\tfrac{N}{B} \min\left(\sqrt{\tfrac{Z}{M}},\tfrac{N}{M}\right) \right) I/Os. While our lower bound uses fairly standard techniques, the upper bound makes use of ``compressed matrix multiplication'' sketches, which is new in the context of I/O-efficient algorithms, and a new matrix product size estimation technique that avoids the ``no cancellation'' assumption.

Keywords

Cite

@article{arxiv.1403.3551,
  title  = {The Input/Output Complexity of Sparse Matrix Multiplication},
  author = {Rasmus Pagh and Morten Stöckel},
  journal= {arXiv preprint arXiv:1403.3551},
  year   = {2014}
}

Comments

Submitted to ICALP 2014

R2 v1 2026-06-22T03:26:50.660Z