**q**_{1}** = (a**_{11}** + a**_{22}**) * (b**_{11}** + b**_{22}**)**
**q**_{2}** = (a**_{21}** + a**_{22}**) * b**_{11}
**q**_{3}** = a**_{11}***( b**_{12}** – b**_{22}**)**
**q**_{4}** = a**_{22}** * (b**_{21}** – b**_{11}**)**
**q**_{5}** = (a**_{11}** + a**_{12}**) * b**_{22}
**q**_{6}** = (a**_{21}** – a**_{11}**) * (b**_{11 }**+ b**_{12}**)**
**q**_{7}** = (a**_{12}** – a**_{22}**) * (b**_{21 }**+ b**_{22}**)**
**It turns out that**
**c**_{11}** = q**_{1}** + q**_{4}** – q**_{5 }**+ q**_{7}
**c**_{12}** = q**_{3}** + q**_{5}
**c**_{21}** = q**_{2}** + q**_{4}
**c**_{22}** = q**_{1}** + q**_{3}** – q**_{2 }**+ q**_{6}
**Note: I haven't actually looked at Strassen's paper. This is just from the text. In going through other books, I saw a different set of products than these. (I also saw these in other books too though.) The different set of products I saw required 24 additions instead of 18, so this is a slight improvement (though not asymptotic) over the other algorithm I saw in a different book.**
**Let's verify a couple of these:**
**q**_{1}** + q**_{4}** – q**_{5 }**+ q**_{7 }**= (a**_{11}** + a**_{22}**) * (b**_{11}** + b**_{22}**) + a**_{22}** * (b**_{21}** – b**_{11}**)**
– **(a**_{11}** + a**_{12}**) * b**_{22}** + (a**_{12}** – a**_{22}**) * (b**_{21 }**+ b**_{22}**)**
**= a**_{11}**b**_{11 }**+ a**_{11}**b**_{22 }**+ a**_{22}**b**_{11 }**+ a**_{22}**b**_{22 }**+ a**_{22}**b**_{21 }**– a**_{22}**b**_{11 }**– a**_{11}**b**_{22 }**– a**_{12}**b**_{22}
**+ a**_{12}**b**_{21 }**+ a**_{12}**b**_{22 }**– a**_{22}**b**_{21 }**– a**_{22}**b**_{22}
**= a**_{11}**b**_{11 }**+ a**_{12}**b**_{21}** , since everything else cancels out.**
**q**_{3}** + q**_{5}** = a**_{11}***( b**_{12}** – b**_{22}**) + (a**_{11}** + a**_{12}**) * b**_{22}
**= a**_{11}**b**_{12 }**– a**_{11}**b**_{22 }**+ a**_{11}**b**_{22 }**+ a**_{12}**b**_{22}
_{ }**= a**_{11}**b**_{12 }**+ a**_{12}**b**_{22}
**I have no idea how Strassen came up with these combinations. He probably realized that he wanted to determine each element in the product using less than 8 multiplications. From there, he probably just played around with it. In the algorithms text by Cormen, Leiserson and Rivest, they show how one could derive these products.**
**If we let T(n) be the running time of Strassen's algorithm, then it satisfies the following recurrence relation:**
**T(n) = 7T(n/2) + O(n**^{2}**)**
**It's important to note that the hidden constant in the O(n**^{2}**) term is larger than the corresponding constant for the standard divide and conquer algorithm for this problem. However, for large matrices this algorithm yields an improvement over the standard one with respect to time.**
**Share with your friends:** |