← Wiki Index / Computation & Algorithms / Strassen Algorithm
💻 Computation & Algorithms

Strassen Algorithm

The Strassen algorithm is a sub-cubic divide-and-conquer matrix multiplication method introduced by Volker Strassen in 1969 that computes a 2 × 2 block product using seven recursive multiplications in O(n^2.8074) time.

Strassen Algorithm is a recursive divide-and-conquer algorithm in computation and algorithms and algebraic complexity theory that multiplies two n × n matrices in sub-cubic asymptotic time O(nlog2 7) ≈ O(n2.807355). Published by German mathematician Volker Strassen in a landmark four-page 1969 paper titled "Gaussian Elimination is Not Optimal," the algorithm overturned the long-standing assumption in computational complexity theory that multiplying two n × n matrices inherently requires n3 scalar multiplications (or 2n3 − n2 total arithmetic operations) as defined by the row-by-column inner-product formula.

Analogous to how the Karatsuba algorithm reduces two-limb integer multiplication from 4 scalar products to 3, Strassen discovered a bilinear rank-7 decomposition of the 2 × 2 matrix multiplication tensor that replaces 8 block matrix multiplications with 7 block multiplications and 18 block additions/subtractions (later reduced to 15 additions by Shmuel Winograd in 1971). Because matrix multiplication underpins block LU decomposition, Gaussian elimination, matrix inversion, determinant evaluation, and transitive closure on graphs, Strassen's algorithm reduced the asymptotic complexity of all fundamental dense linear algebra operations to O(nω) where ω ≤ log2 7 ≈ 2.8074, initiating the modern search for the asymptotic matrix multiplication exponent ω.

Block Partitioning and Strassen's Seven Bilinear Products

Naive 2 × 2 Block Multiplication Versus Rank-7 Bilinear Decomposition

Let A, B ∈ Rn×n be square matrices over an arbitrary ring R (not necessarily commutative, allowing recursive application to submatrices) with dimension n = 2k. Partition A, B, and their product C = AB into four (n/2) × (n/2) quadrant blocks:

A = [ A11 A12 ; A21 A22 ], B = [ B11 B12 ; B21 B22 ], C = [ C11 C12 ; C21 C22 ]

Standard block multiplication computes the four quadrants of C via Cij = Ai1B1j + Ai2B2j, which invokes 8 recursive multiplications of (n/2) × (n/2) matrices and 4 block additions, yielding the recurrence T(n) = 8T(n/2) + Θ(n2) = Θ(nlog2 8) = Θ(n3).

Strassen observed that by linearly combining blocks of A and B before multiplying, all four quadrants of C can be reconstructed from just seven intermediate (n/2) × (n/2) matrix products M1, M2, ..., M7:

  1. M1 = (A11 + A22)(B11 + B22)
  2. M2 = (A21 + A22)B11
  3. M3 = A11(B12 − B22)
  4. M4 = A22(B21 − B11)
  5. M5 = (A11 + A12)B22
  6. M6 = (A21 − A11)(B11 + B12)
  7. M7 = (A12 − A22)(B21 + B22)

Notice that Aij always appears on the left and Bkl always appears on the right in every product M1..M7, so the identities hold without assuming commutativity of matrix multiplication (AijBkl ≠ BklAij).

Reconstruction of the Output Quadrants and Winograd's 15-Addition Variant

Expanding the seven products M1 through M7 and cancelling cross terms yields the four output quadrants of C = AB:

  • C11 = M1 + M4 − M5 + M7 = A11B11 + A12B21
  • C12 = M3 + M5 = A11B12 + A12B22
  • C21 = M2 + M4 = A21B11 + A22B21
  • C22 = M1 − M2 + M3 + M6 = A21B12 + A22B22

Counting block additions and subtractions: forming the operands of M1..M7 requires 10 block additions/subtractions, and assembling C11..C22 requires 8 block additions/subtractions, totaling 18 block additions of size (n/2) × (n/2). In 1971, Shmuel Winograd proved that 7 multiplications is the mathematical minimum for 2 × 2 matrices (the tensor rank of ⟨2, 2, 2⟩ is 7) and introduced the Strassen–Winograd variant, which shares intermediate sums to reduce the count from 18 to 15 block additions (the theoretical lower bound for rank-7 schedules established by Robert Probert in 1976).

Asymptotic Complexity, Practical Crossover, and Numerical Stability

Master Theorem Solution and Exact Operation Counts

Applying the Master Theorem to the Strassen–Winograd recurrence for total arithmetic operations T(n) on n = 2k:

T(n) = 7 T(n / 2) + 15 (n / 2)2, with T(1) = 1

Solving this recurrence in closed form yields:

T(n) = 7k + (15 / 4) ∑j=0..k−1 7j (2k−j)2 = 6 · 7k − 5 · 4k = 6 nlog2 7 − 5 n2 ≈ 6 n2.807355

For original 18-addition Strassen, the leading constant is 7nlog2 7 − 6n2. In practical implementations, recursion is not continued down to 1 × 1 scalars; instead, recursion terminates at a crossover threshold n0 ∈ [512, 2048], below which submatrices are multiplied using cache-optimized Level-3 BLAS (dgemm). Stopping after r = 1, 2, or 3 recursive levels reduces total floating-point operations by (7/8)r (12.5%, 23.4%, or 33.0% fewer flops) while preserving hardware vectorization. For non-power-of-two dimensions n, dynamic peeling or even-dimension padding avoids wasting work on zero rows.

Finite-Precision Stability and Subsequent Fast Matrix Multiplication Bounds

Because Strassen's formulas add and subtract submatrices from different rows and columns (such as A11 + A22), cancellation can amplify rounding errors when matrix entries vary widely in magnitude. Nicholas Higham (1990) proved that while classical matrix multiplication satisfies a componentwise backward error bound |Ĉ − AB| ≤ nεmach|A||B| in IEEE 754 arithmetic, Strassen's algorithm satisfies only a normwise bound:

‖*Ĉ* − *AB*‖max ≤ c (n / n0)log2 12 n0 εmach ‖A‖max ‖B‖max

Thus, Strassen's algorithm is weakly stable: it preserves accuracy for well-scaled dense matrices or 1–3 levels of recursion, and is exact over finite fields GF(p) or arbitrary-precision integers (accelerated at the scalar level by the fast Fourier transform). Following Strassen (ω < 2.8074), Victor Pan (1978, ω < 2.796), Don Coppersmith and Shmuel Winograd (1990, ω < 2.375477), Virginia Vassilevska Williams (2012, ω < 2.37287), and Josh Alman and Vassilevska Williams (2021–2024, ω < 2.371339) pushed the theoretical exponent closer to the conjectured limit ω = 2, though Strassen–Winograd remains the primary sub-cubic algorithm with small enough constants for practical deployment.

Matrix Multiplication AlgorithmYearTensor Base CaseAsymptotic Complexity O(nω)Leading Constant / Practical Crossover n0
Classical Row-by-Column (dgemm)Classical2 × 2 in 8 mults, 4 addsO(n3) (2n3 − n2 flops)Constant = 2; optimal for n ≤ 512
Original Strassen Algorithm19692 × 2 in 7 mults, 18 addsO(nlog2 7) ≈ O(n2.807355)Constant = 7; practical for n ≥ 1024
Strassen–Winograd Algorithm19712 × 2 in 7 mults, 15 addsO(nlog2 7) ≈ O(n2.807355)Constant = 6; practical for n ≥ 512–1024
Pan's Trilinear Aggregation197870 × 70 in 143,640 multsO(nlog70 143640) ≈ O(n2.79512)Crossover n0 > 106
Coppersmith–Winograd / Laser Method1990–2024Asymptotic tensor powerO(n2.371339)Galactic algorithm (astronomical constant factor)

Frequently Asked Questions

How does Strassen's algorithm reduce the complexity of matrix inversion and Gaussian elimination?

In the same 1969 paper, Strassen showed that an invertible n × n matrix A partitioned into 2 × 2 blocks can be inverted via its Schur complement S = A22 − A21A11−1A12 using 2 recursive (n/2) × (n/2) inversions and 6 (n/2) × (n/2) matrix multiplications. This recurrence I(n) = 2I(n/2) + O(nω) solves to I(n) = O(nω), reducing LU decomposition, Gaussian elimination, and determinant computation to O(n2.8074).

Why don't standard BLAS libraries always use Strassen's algorithm by default?

Modern CPUs and GPUs have high arithmetic throughput relative to memory bandwidth. Strassen's algorithm requires temporary workspace arrays to hold intermediate block sums (increasing memory traffic) and replaces componentwise stability with normwise stability. Consequently, BLAS libraries use classical cache-blocked dgemm by default and invoke 1–3 levels of Strassen–Winograd only when n ≥ 1024–2048 and workspace memory is available.

What is the minimum known number of multiplications for 3 × 3 matrices?

Whereas the minimal bilinear rank for 2 × 2 matrices is known to be 7 (achieved by Strassen), the minimal rank for 3 × 3 matrices (naive cost 27 multiplications) remains an open problem in algebraic complexity: Julian Laderman constructed a 23-multiplication scheme in 1976 (log3 23 ≈ 2.854, slightly slower than Strassen's log2 7 ≈ 2.807), and the true minimum rank of 3 × 3 matrix multiplication is known to lie between 19 and 23.

References

  1. Strassen, V. (1969). "Gaussian elimination is not optimal." Numerische Mathematik, 13(4), 354–356. https://doi.org/10.1007/BF02165411
  2. Winograd, S. (1971). "On multiplication of 2 × 2 matrices." Linear Algebra and its Applications, 4(4), 381–388. https://doi.org/10.1016/0024-3795(71)90009-790009-7)
  3. Higham, N. J. (1990). "Exploiting fast matrix multiplication within the level 3 BLAS." ACM Transactions on Mathematical Software, 16(4), 352–368. https://doi.org/10.1145/98267.98290
  4. Coppersmith, D., & Winograd, S. (1990). "Matrix multiplication via arithmetic progressions." Journal of Symbolic Computation, 9(3), 251–280. https://doi.org/10.1016/S0747-7171(08)80013-280013-2)
  5. Ballard, G., Demmel, J., Holtz, O., & Schwartz, O. (2012). "Graph expansion and communication costs of fast matrix multiplication." Journal of the ACM, 59(6), 32:1–32:23. https://doi.org/10.1145/2395116.2395121
🧬 Support Open Science
Explore interactive science games on LowKey Games or browse scientific apparel & accessories in the CRV Science Shop.
💡 Spot an inaccuracy or have primary literature to expand this article?
Submit a citation or revision note using your shared CRV Science / LowKey Games profile ID.
Suggest Revision