What is the time complexity of matrix multiplication of sparse integer matrices with $m_{in}$ nonzeros in the input and $m_{out}$ nonzeros in the output? This paper provides improved upper bounds for this question for almost any choice of $m_{in}$ vs. $m_{out}$, and provides evidence that these new bounds might be optimal up to further progress on fast matrix multiplication. Our main contribution is a new algorithm that reduces sparse matrix multiplication to dense (but smaller) rectangular matrix multiplication. Our running time thus depends on the optimal exponent $\omega(a,b,c)$ of multiplying dense $n^a\times n^b$ by $n^b\times n^c$ matrices. We discover that when $m_{out}=\Theta(m_{in}^r)$ the time complexity of sparse matrix multiplication is $O(m_{in}^{\sigma+\epsilon})$, for all $\epsilon > 0$, where $\sigma$ is the solution to the equation $\omega(\sigma-1,2-\sigma,1+r-\sigma)=\sigma$. No matter what $\omega(\cdot,\cdot,\cdot)$ turns out to be, and for all $r\in(0,2)$, the new bound beats the state of the art, and we provide evidence that it is optimal based on the complexity of the all-edge triangle problem. In particular, in terms of the input plus output size $m = m_{in} + m_{out}$ our algorithm runs in time $O(m^{1.3459})$. Even for Boolean matrices, this improves over the previous $m^{\frac{2\omega}{\omega+1}+\epsilon}=O(m^{1.4071})$ bound [Amossen, Pagh; 2009], which was a natural barrier since it coincides with the longstanding bound of all-edge triangle in sparse graphs [Alon, Yuster, Zwick; 1994]. We find it interesting that matrix multiplication can be solved faster than triangle detection in this natural setting. In fact, we establish an equivalence to a special case of the all-edge triangle problem.
翻译:给定输入中非零元数量为$m_{in}$、输出中非零元数量为$m_{out}$的稀疏整数矩阵乘法,其时间复杂度是多少?本文针对几乎所有$m_{in}$与$m_{out}$的比值关系,给出了该问题改进的上界,并提供了证据表明这些新上界在快速矩阵乘法取得进一步进展前可能已达到最优。我们的主要贡献是一种新算法,该算法将稀疏矩阵乘法归约为稠密(但规模更小)的矩形矩阵乘法。因此,我们的运行时间依赖于最优指数$\omega(a,b,c)$——即乘法$n^a\times n^b$与$n^b\times n^c$稠密矩阵的指数。我们发现,当$m_{out}=\Theta(m_{in}^r)$时,对所有$\epsilon>0$,稀疏矩阵乘法的时间复杂度为$O(m_{in}^{\sigma+\epsilon})$,其中$\sigma$是方程$\omega(\sigma-1,2-\sigma,1+r-\sigma)=\sigma$的解。无论$\omega(\cdot,\cdot,\cdot)$的最终取值如何,且对所有$r\in(0,2)$,该新界均超越了现有最优结果,我们基于全边三角形问题的复杂度提供了其最优性的证据。特别地,按输入输出总规模$m = m_{in} + m_{out}$衡量,我们的算法运行时间为$O(m^{1.3459})$。即便对于布尔矩阵,这也改进了此前$m^{\frac{2\omega}{\omega+1}+\epsilon}=O(m^{1.4071})$的界 [Amossen, Pagh; 2009],该界因与稀疏图中全边三角形问题的长期最优界 [Alon, Yuster, Zwick; 1994] 一致而成为自然屏障。值得注意的是,在此自然设定下,矩阵乘法可被求解得比三角形检测更快。事实上,我们将其等价于全边三角形问题的一个特例。