Abstract
We present a practical algorithm for multiplication of two sparse matrices. In fact if A and B are two matrices of size n with m 1 and m 2 non-zero elements respectively, then our algorithm performs O(min{m 1 n, m 2 n, m 1 m 2}) multiplications and O(k) additions where k is the number of non-zero elements in the tiny matrices that are obtained by the columns times rows matrix multiplication method. Note that in the useful case, k ≤ m 2 n. However, in Proposition 3.3 and Proposition 3.4 we obtain tight upper bounds for the complexity of additions. We also study the complexity of multiplication in a practical case where non-zero elements of A (resp. B) are distributed independently with uniform distribution among columns (resp. rows) of them and show that the expected number of multiplications is O(m 1 m 2/n). Finally a comparison of number of required multiplications in the naïve matrix multiplication, Strassen’s method and our algorithm is given.
Similar content being viewed by others
References
G. Strang, Introduction to Linear Algebra (Wellesley-Cambridge Press, Wellesley, USA, 2003)
V. Strassen, Gaussian elimination is not optimal, Numer. Math. 13, 354–356, 1969
A. Horrowithz, J. Sahny, Fundamentals of Data Structures (Computer Science Press, New York, 1983)
D. Coppersmith, S. Winograd, Matrix multiplication via arithmetic progression, J. Symb. Comput. 9, 251–280, 1990
R. Yuster, U. Zwick, Fast sparse matrix multiplication, ACM T. Alg. 1, 2–13, 2005
D. Coppersmith, Rectangular matrix multiplication revisited, J. Complexity 13, 42–49, 1997
Z. Tang, R. Duraiswami, N. Gummerov, Fast algorithms to compute matrix-vector products for pascal matrices, Technical Reports from UMIACS UMIACS-TR-2004-08, 2004
A. Björck, Block bidiagonal decomposition and least square problems, Perspectives in numerical Analysis, Helsinki, May 27–29, 2008
Author information
Authors and Affiliations
Corresponding author
About this article
Cite this article
Borna, K., Fard, S.A. A note on the multiplication of sparse matrices. centr.eur.j.comp.sci. 4, 1–11 (2014). https://doi.org/10.2478/s13537-014-0201-x
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.2478/s13537-014-0201-x