The idea of Strassen’s method is to reduce the number of recursive calls to 7. On my homework, we have a problem regarding divide a conquer for matrix multiplication where if you are multiplying a (4x12) by (12x4) the original total of multiplications is 192, but can be further dropped to 147. In the above divide and conquer method, the main component for high time complexity is 8 recursive calls. Strassens Algorithm for Non-Square Matrices. Simple Divide and Conquer also leads to O(N 3), can there be a better way? However, if you break each of the the sub problems into one big chunk and one small chunk, then. If, each level, you break each sub problem into two equal sized chunks, then it will take log2 (n) levels before the sub problem size is broken into chunks of size 1. Which is unfortunately same as the above naive method. 1: Divide and Conquer: Integer Multiplication Karatsuba Multiplication Implementation by Python Merge Sort. Solving a divide and conquer problem will cost you: cost/level number of levels. So the time complexity can be written as T(N) = 8T(N/2) O(N 2)įrom Master's Theorem, time complexity of above method is O(N 3) Strassens Matrix Multiplication is the divide and conquer approach to solve the matrix multiplication problems. Addition of two matrices takes O(N 2) time. In the above method, we do 8 multiplications for matrices of size N/2 x N/2 and 4 additions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |