Content:
- Dynamic planning, which divides the problem into small problems and begins with solving these small problems
- A dynamic planning solution for learning how to design problems
9.1 knapsack problem
How to make the goods in the backpack the highest value?
If you try all the possibilities, the run time is O (2n).
9.2 knapsack Problem FAQ
9.2.7 dealing with interdependent situations
Dynamic planning works only if each sub-problem is discrete. That is, there can be no dependency between sub-problems.
9.2.8 according to the design of dynamic planning, at most only two self-backpacks, that is not involved in more than two sub-backpacks, but the sub-backpack may also contain a sub-backpack.
9.2.9 optimal solution may cause the backpack not to fill 9
9.3 Longest Common substring
- Dynamic programming can find the optimal solution under a given constraint condition
- When the problem can be decomposed into separate and discrete sub-problems, dynamic planning can be used to solve
9.4 Summary
- Dynamic planning is useful when you need to lower the right-hand side of an indicator under a given constraint
- When a problem can be divided into discrete sub-problems, dynamic planning can be used to solve
- Each dynamic planning scenario involves a grid
- The value in the cell is usually the value you want to optimize
- Each cell is a sub-problem, so you need to consider how to divide the problem into sub-problems
- No house, no room. Formula for computing dynamic programming solutions
Dynamic Programming C language
69067708
Algorithm diagram-Dynamic programming