Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .

0 of .
Results for:
P. 1
06) # Dynamic Programming

# 06) # Dynamic Programming

Ratings: (0)|Views: 2 |Likes:

### Availability:

See more
See less

05/03/2012

pdf

text

original

Dynamic Programming

Dynamic Programming
"
Dynamic programming algorithm stores the results forsmall subproblems and looks them up, rather thanrecomputing them, when it needs them later to solvelarger subproblems
"
Steps in developing a dynamic programmingalgorithm

Characterize the structure of an optimal solution
Recursively define the value of an optimal solution
Compute the value of an optimal solution in a bottom-up fashion
Construct an optimal solution from computedinformation

Matrix chain multiplicationProblem: We are given a sequence(chain)<A
1
, A
2
, A
3
,…A
n
> of n matrices to bemultiplied, we wish to compute theproductA
1
A
2….
A
n
Since matrix multiplication is associativeso all ways of parenthesization willyield the same answer.The product of A
1
A
2
A
3
A
4
can beparenthesized in five distinct ways: