Lec 6
Lec 6
Based on: Thomas H. Cormen, Charles E. Leiserson, and Ronald L. Rivest, “Introduction to Algorithms”, 3rd Edition, The MIT
Press, 2009.
Last Lecture
◼ Review for Recurrence Relations
◼ Divide and Conquer Design Approach
◼ Binary Search
◼ Merge Sort
◼ Recurrence Relation for Merge Sort
◼ Analysis Merge Sort Recurrence
◼ Solving Recurrence Relations
◼ Recurrence Tree
◼ Master Theorem
◼ Iteration Method
Page 2
Contents
◼ Matrix Multiplication: Simple Divide and Conquer
◼ Analysis of Matrix Multiplication
◼ Strassen’s Algorithm for Matrix Multiplication
◼ Analysis of Strassen’s Algorithm
◼ Solving Recurrence Relations
◼ Changing Variables
Page 3
4.2 Strassen’s algorithm for matrix multiplication
P.75
Matrix Multiplication
◼ Compute the matrix product C = A x B, for two n x n
matrices
4
Matrix Multiplication: A Simple Divide-and-Conquer
Algorithm P.69
◼ So, C =
5
Matrix Multiplication: A Simple Divide-and-Conquer
Algorithm P.69
6
Matrix Multiplication: A Simple Divide-and-Conquer
Algorithm P.77
◼ T[n] = ( n3 )
8
Matrix Multiplication: A Simple Divide-and-
Conquer Algorithm
, where T(1)=1
Matrix Multiplication: A Simple Divide-and-
Conquer Algorithm
Now
Also,
Hence,
Matrix Multiplication: Strassen’s Algorithm P.79
Z = A1 x A2
12