Example: Matrix Multiplication
• We can compute C=AB
recursively by dividing each
matrix into 4 submatrices
• The submatrices of A and B
can be multiplied (using 8
multiplies of matrices of size
n/2)
• Resulting recurrence is
T(n) = 8T(n/2) + O(n2)
• Solution is T(n) = O(n3)
• Strassen found a way to use
just 7 multiplies of matrices
of size n/2
• Recurrence is
T(n) = 7T(n/2) + O(n2)
• Solution is
T(n) = O(nlog 7) » O(n2.81)
• The naive algorithm is better
up to about n = 45
• Strassen’s Algorithm
becomes faster than naive
algorithm at about n = 120
• Current best bound for
matrix multiply is O(n2.376)
CS409 - Spring 2000
8