Dynamic Programming: Chain Matrix Multiplication
koushikdasika.com
koushikdasika.com
I didn't understand the statement that
The boxes with hyphens will be ignored because matrix multiplication works from left to right, not the other way around.
(from Preliminaries 3: Cost table). Matrix multiplication is associative, so can be grouped as you like, and then reduced 'left to right' or 'right to left'. I think the relevant point is that the cost is symmetric, in the sense that the two orders of reduction give the same cost; so there's no need to fill in the sub-diagonal entries. Is that correct?Finally, I'm sorry to have to nit-pick that the plural of 'matrix' is 'matrices' (just one 'i'). At least you didn't use singular 'matrice'. :-)
Is the author trying to redefine what Dynamic Programming means or is he just totally confusing its reader by actually using a DP algo but saying he's not using the technical definition!?
I mean: he's basically saying that Dynamic Programming is "Divide and Conquer". I'm not sure I follow him.
Especially seen that, contrarily to memoization (yes, "memoization", not "memorization", there's no 'r'), DP doesn't just compute and cache what's necessary but computes everything. In that DP really doesn't look like "a subproblem which is easier to solve".
Dynamic programming has a very precise meaning:
Dynamic Programming can be seen as divide and conquer but using memoization to avoid recalculations.
The "subproblems easier to solve" are not easier complexity-wise but easier in the sense that we are solving a smaller subinstance of the main problem.