Steps for dynamic planning problems
1. Describe the structure of the optimal solution
2, recursive definition of the value of the optimal solution
3. Calculate the value of the optimal solution from the bottom up
4, the optimal solution is constructed by the result of calculation.
In general, the 3rd step is to record some additional information,
There is another way to calculate the bottom-up step, which can be calculated from the top of the memo.
15.1 assembly line Scheduling
15.2 matrix chain Multiplication
15.3 Dynamic Programming Principles
Optimization problems should have two elements: optimal substructure, sub-problem overlap
Methods for discovering the optimal substructure:
1. Make a choice:
2. Assume that you know which option can get the best results
3. Determine which sub-problems the optimal selection will produce
4, the solution of the problem and the solution of the female problem
To portray sub-problem spaces as concise as possible:
In the problem of steel bar cutting, as long as you know the length, in matrix multiplication, you need to know the starting point and the end
15.4 Longest common sub-sequence
15.5 Best binary search tree
Is the same as the matrix multiplication method.
"Introduction to Algorithms", 15th chapter, dynamic programming