lec23 - Click to edit Master subtitle style 2/7/11 Sundar...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Click to edit Master subtitle style 2/7/11 Sundar B. CS C341 / I S C361 Data Structures & Algorithms Algorithm Design Techniques Dynamic Programming- Examples- Matrix-Chain Multiplication- Sequence Alignment 11 2/7/11 Sundar B. 2/7/11 Sundar B. Example – Matrix-Chain Multiplication Consider the following expression: M1 * M2 * M3 where Mj is a matrix of dimensions pj-1 * pj for j = 1 to 3 Matrix Multiplication is associative i.e. (M1 * M2 ) * M3 = M1 * (M2 * M3) Exercise: Prove this. Hint: Use Induction. Then the above expression can be evaluated either as (M1 * M2 )* M3 2/7/11 22 Sundar B. 2/7/11 Sundar B. Example – Matrix-Chain Multiplication Consider the following generalized expression: M1 * M2 * … * Mn where Mj is a matrix of dimensions pj-1 * pj for j = 1 to n Problem: Given the above expression, how do we minimize the number of scalar multiplications? This depends on the way the expression is parenthesized (which determines the order of evaluation) Definition: 2/7/11 33 Sundar B. 2/7/11 Sundar B. Example – McM - Brute Force Solution Algorithm BF_MCM: Find all possible parenthesizations For each possible parenthesization, count the scalar multiplications required....
View Full Document

This note was uploaded on 02/07/2011 for the course CS 123 taught by Professor Murali during the Spring '11 term at Birla Institute of Technology & Science, Pilani - Hyderabad.

Page1 / 13

lec23 - Click to edit Master subtitle style 2/7/11 Sundar...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online