What is matrix multiplication?

I’m trying to understand what a chain matrix multiplication is and how it differs from regular multiplication. I checked several sourcers, but everything seems to be very academically explained for me to understand.

I assume this is a form of dynamic programming algorithm to optimize the operation, but I did not go further.

thanks

+4
source share
2 answers

Multiple multiplication is just a series of multiplications. A * B * C * D. Initially, he had nothing about programming and dynamic programming. But there is a good rule (associative law) A * (B * C) = (A * B) * C, but the computational cost of these expressions is different. Thus, there is a problem of optimal distribution of brackets. it was an intro. now read the wiki.

+6
source

Matrix chain multiplication is a problem that can be solved using the Dynamic Programming approach, it requires the right brackets with matrices to multiply the given matrices with a minimum number of multiplications. Example

M1 = 12 x 20 M2 = 20 x 15 M3 = 15 x 30 

There are two ways to solve this problem, depending on where you start to multiply your matrices.

 1). ((M1 x M2) x M3) 2). (M1 x (M2 x M3)) 

At first only 3600 + 5400 = 9000 multiplications are required.
The second solution requires 9,000 + 7,200 = 16,200 multiplications.
Here we choose the first second, because it needs less than the number of multiplications.
Your program should be able to tell the user how to copy matrices to minimize multiplications ( Optimization Problem )

0
source

Source: https://habr.com/ru/post/1310276/


All Articles