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 k * Ak + 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!