0% found this document useful (0 votes)
6 views2 pages

Strassens

Stassems multiplication
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Strassens

Stassems multiplication
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CS6402 __ Design and Analysis of Algorithms _ Unit II _____2.

18

2.12 STRASSEN’S MATRIX MULTIPLICATION


The Strassen’s Matrix Multiplication find the product C of two 2 × 2 matrices A and B with
just seven multiplications as opposed to the eight required by the brute-force algorithm.

where

Thus, to multiply two 2 × 2 matrices, Strassen’s algorithm makes 7 multiplications and 18


additions/subtractions, whereas the brute-force algorithm requires 8 multiplications and 4 additions.
These numbers should not lead us to multiplying 2 × 2 matrices by Strassen’s algorithm. Its
importance stems from its asymptotic superiority as matrix order n goes to infinity.

Let A and B be two n × n matrices where n is a power of 2. (If n is not a power of 2,


matrices can be padded with rows and columns of zeros.) We can divide A, B, and their product C
into four n/2 × n/2 submatrices each as follows:

The value C00 can be computed either as A00 * B00 + A01 * B10 or as M1 + M4 − M5 + M7
where M1, M4, M5, and M7 are found by Strassen’s formulas, with the numbers replaced by the
corresponding submatrices. The seven products of n/2 × n/2 matrices are computed recursively by
Strassen’s matrix multiplication algorithm.

The asymptotic efficiency of Strassen’s matrix multiplication algorithm


If M(n) is the number of multiplications made by Strassen’s algorithm in multiplying two
n×n matrices, where n is a power of 2, The recurrence relation is M(n) = 7M(n/2) for n > 1,
M(1)=1.

Since n = 2k,
M(2k) = 7M(2k−1)
= 7[7M(2k−2)]
= 72M(2k−2)
=...
CS6402 __ Design and Analysis of Algorithms _ Unit II _____2.19

= 7iM(2k−i)
=...
= 7kM(2k−k) = 7kM(20) = 7kM(1) = 7k(1) (Since M(1)=1)
M(2k) = 7k.
Since k = log2 n,
M(n) = 7log2 n
= nlog2 7
≈ n2.807
which is smaller than n3 required by the brute-force algorithm.

Since this savings in the number of multiplications was achieved at the expense of making
extra additions, we must check the number of additions A(n) made by Strassen’s algorithm. To
multiply two matrices of order n>1, the algorithm needs to multiply seven matrices of order n/2
and make 18 additions/subtractions of matrices of size n/2; when n = 1, no additions are made since
two numbers are simply multiplied. These observations yield the following recurrence relation:
A(n) = 7A(n/2) + 18(n/2)2 for n > 1, A(1) = 0.
By closed-form solution to this recurrence and the Master Theorem, A(n) ∈ Θ(nlog2 7). which is a
better efficiency class than Θ(n3)of the brute-force method.

Example: Multiply the following two matrices by Strassen’s matrix multiplication algorithm.

A=[ ] B=[ ]

Answer:
C=[ ]= [ ]x[ ]

Where A00 = [ ] A01 = [ ] A10 = [ ] A11 = [ ]

B00 = [ ] B01 = [ ] B10 = [ ] B11 = [ ]

M1 = (A00+A11)*(B00+B11) = [ ]+[ ] * [ ]+[ ] =[ ]∗[ ]=[ ]

Similarly apply Strassen’s matrix multiplication algorithm to find the following.

− − −
M2 = [ ], M3= [ ], M4= [ ], M5= [ ], M6= [ ], M7= [ ]
− − − − −


C00= [ ], C01= [ ], C10= [ ], C11= [ ]

C=[ ] =[ ]

You might also like