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 ×U matrices, \(\Theta \left( U^3 / (B \sqrt{M}) \right)\) I/Os are necessary and sufficient in the I/O model with internal memory size M and memory block size B.
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) of nonzero entries in A and C, as well as the number Z =nnz(AC) of nonzero entries in AC.
We show that using \(\tilde{O} \left( \tfrac{N}{B} \min\left(\sqrt{\tfrac{Z}{M}},\tfrac{N}{M}\right) \right)\) I/Os, AC can be computed 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 \(\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.
This work is supported by the Danish National Research Foundation under the Sapere Aude program.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Aggarwal, A., Vitter, J.S.: The Input/Output complexity of sorting and related problems. Commun. ACM 31(9), 1116–1127 (1988)
Alon, N., Yuster, R., Zwick, U.: Color-coding. J. ACM (4), 844–856
Alon, N., Yuster, R., Zwick, U.: Finding and counting given length cycles. Algorithmica 17(3), 209–223 (1997)
Amossen, R.R., Campagna, A., Pagh, R.: Better size estimation for sparse matrix products. APPROX/RANDOM 2010, 406–419 (2010)
Amossen, R.R., Pagh, R.: Faster join-projects and sparse matrix multiplications. In: ICDT 2009, pp. 121–126. ACM (2009)
Bender, M., Brodal, G., Fagerberg, R., Jacob, R., Vicari, E.: Optimal sparse matrix dense vector multiplication in the I/O-model. TCS 47(4), 934–962 (2010)
Boyer, R.S., Moore, J.S.: MJRTY - A fast majority vote algorithm. Technical Report AI81-32 (February 1, 1981)
Cohen, E.: Estimating the size of the transitive closure in linear time. In: SFCS 1994, pp. 190–200. IEEE Computer Society, Washington, DC (1994)
Cohen, E.: Structure prediction and computation of sparse matrix products. Journal of Combinatorial Optimization 2(4), 307–332 (1998)
Demaine, E.D.: Cache-oblivious algorithms and data structures. In: Lecture Notes from the EEF Summer School on Massive Data Sets, June 27-July 1 (2002)
Flajolet, P., Martin, G.N.: Probabilistic Counting Algorithms for Data Base Applications. Journal of Computer and System Sciences
Greiner, G., Jacob, R.: The I/O complexity of sparse matrix dense matrix multiplication. In: López-Ortiz, A. (ed.) LATIN 2010. LNCS, vol. 6034, pp. 143–156. Springer, Heidelberg (2010)
Irony, D., Toledo, S., Tiskin, A.: Communication lower bounds for distributed-memory matrix multiplication. JPDC 64(9), 1017–1026 (2004)
Jia-Wei, H., Kung, H.T.: I/O complexity: The red-blue pebble game. In: STOC 1981, pp. 326–333. ACM (1981)
Kane, D.M., Nelson, J., Woodruff, D.P.: An optimal algorithm for the distinct elements problem. In: PODS 2010, pp. 41–52. ACM (2010)
McGregor, A.: Algorithms for Signals, book draft (2013)
Motwani, R., Raghavan, P.: Randomized Algorithms. Cambridge University Press, New York (1995)
Mulmuley, K., Vazirani, U., Vazirani, V.: Matching is as easy as matrix inversion. Combinatorica 7(1), 105–113 (1987)
Pagh, R.: Compressed matrix multiplication. ACM Trans. Comput. Theory 5(3), 9:1–9:17 (2013)
Pagh, R., Silvestri, F.: The input/output complexity of triangle enumeration. arXiv preprint arXiv:1312.0723 (2013)
Pietracaprina, A., Pucci, G., Riondato, M., Silvestri, F., Upfal, E.: Space-round tradeoffs for mapreduce computations. In: ICS, pp. 235–244. ACM (2012)
Rabin, M.O., Vazirani, V.V.: Maximum matchings in general graphs through randomization. J. Algorithms 10(4), 557–567 (1989)
Strassen, V.: Gaussian elimination is not optimal. Numerische Mathematik 13(4), 354–356 (1969)
van Dongen, S.: Graph Clustering by Flow Simulation. PhD thesis, University of Utrecht (2000)
Williams, R., Yu, H.: Finding orthogonal vectors in discrete structures. In: SODA 2014, ch. 135, pp. 1867–1877 (2014)
Williams, V.V.: Multiplying matrices faster than coppersmith-winograd. In: STOC 2012, pp. 887–898. ACM, New York (2012)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Pagh, R., Stöckel, M. (2014). The Input/Output Complexity of Sparse Matrix Multiplication. In: Schulz, A.S., Wagner, D. (eds) Algorithms - ESA 2014. ESA 2014. Lecture Notes in Computer Science, vol 8737. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-44777-2_62
Download citation
DOI: https://doi.org/10.1007/978-3-662-44777-2_62
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-662-44776-5
Online ISBN: 978-3-662-44777-2
eBook Packages: Computer ScienceComputer Science (R0)