in reply to coding of algorithms is inherently procedural
Even the Cormen et al book does dynamic programming this way (starting with the recursive optimality). In general, this is enough to describe a memoized dynamic programming algorithm, since the details are always the same for these kinds of problems. I consider this more of a logic programming formulation. It doesn't say "do this, do that", it only gives a production rule for constructing optimal subproblems and some base cases.m[i,i] = 0 m[i,j] = min { m[i,k] + m[k+1,j] + p[i-1]*p[k]*p[j] } i<=k<j
blokhead
|
|---|