Table of Contents

6.2. Principles of Dynamic Programming: Memoization or iteration over Subproblems


Designing the Algorithm


The key to the efficient solution found by Memoization is the array M that keeps track of the previously computed solutions. Once we have the array M, the problem is solved: M[n] contains the value of the optimal solution on the full instance and Find-Solution can be used to trace back through M efficiently and return an optimal solution.
Algorithm

Iterative-Compute-OPT
M[0] = 0

For j = 1,2,…,n
M[j] = max(vj + M[p(j)],M[j-1])

Endfor


Analyzing the Algorithm


Basic outline of Dynamic Programming

Polynomial number of subproblems

Solution to original problem can be easily computed from solutions to subproblems

Natural ordering of subproblems, easy to compute recurrence

This section was both short and straightforward. I give it an 8/10