Question: Consider the following greedy algorithm for the problem of the chain multiplication of n matrices A 1 , A 2 , ..., A n .
Consider the following greedy algorithm for the problem of the chain multiplication of n matrices A1, A2, ..., An. We assume that for all 1 kn, the size of the matrix Ak is pk-1 x pk.
At each step : Find the maximum value of pk, where 1
a) Analyze the complexity in the worst cases, of the algorithm above, considering as elementary operations the number of multiplications. b) Show that the algorithm above does not always give an optimal solution (give an example of sequence of matrices where the algorithm does not work)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
