为什么在方阵乘法的递归中输入大小除以 2 而不是 4?

Why is the input size divided by 2 and not 4 in the recurrence of square matrix multiplication?

在分析方阵乘法运行时,了解到运行时是

对于朴素的分治法,

对于 Strassen 的方法。

为什么 N 除以 2 而不是 4?

我的理解是, (8 for naive, 7 for Strassen) is the number of recursions that each level introduces, or the growth rate of subproblems. The divisor is the factor of reduction of the problem. The 加数的系数是每个特定递归节点的运行时间。

如果朴素算法和 Strassen 的方法都将输出矩阵划分为 matrices where 是行数和列数,问题是不是减少了 4 倍而不是 2 倍,因为在每个级别我们正在解决 4 个较小矩阵的问题?

下面是我从 GeeksforGeeks 获得的原始方法的图像:

来自 Introduction to Algorithms, 3rd Edition,第 1 页。 77:

Let T(n) be the time to multiply two n x n matrices using this [the naive matrix multiplication] procedure.

n不是任何一个矩阵中元素的个数,它是一个维度。因此,由于矩阵 维度 被递归地分成两半,因此除数是 2 而不是 4.