1, dynamic Planning and division of the similarity point: all of the problem to be solved into several sub-problems, first solve these sub-problems, and then from the solution of sub-problems to get the original problem solution
Different points: suitable for solving problems with dynamic programming, the sub-problems obtained by decomposition are generally not independent of each other.
2. The dynamic programming algorithm is often used to solve problems with some optimal properties. There may be many possible solutions to this type of problem, and each solution corresponds to a value, hoping to find the solution with the best value.
3. The validity of dynamic programming algorithm relies on the overlapping of optimal substructure and sub-problem.
Optimal sub-structure refers to the optimal solution of the problem, which includes the optimum solution of the sub-problem, so that the program can gradually construct the optimal solution of the whole problem from the optimal solution of sub-problem in the way of bottom-up.
Sub-problem overlap refers to the iterative solution of some sub-problems multiple times, dynamic planning can store these solutions.
4, solutions to the problem of dynamic planning:
First: recursion: First from the bottom to the upper end of the advantage: is a large-scale problem to the small problems, easy to think of disadvantages: but inefficient.
Second: iterative recursion: Direct bottom-up advantage efficiency high disadvantage: bad think
Example: Maximum child segments and
Dynamic Programming algorithm