Dynamic programming theory

Basic idea

Dynamic programming algorithms are usually used to solve problems with certain optimal properties. In such problems, there may be many feasible solutions. Each solution corresponds to a value, we have the hope of finding the optimal value solution. Dynamic programming algorithm to divide and conquer Similarly, the basic idea is to solve the problem will be broken down into several sub-questions, the first sub-problem solving, solution of the original problem and the solution obtained from these sub-issues. Different from the divide and conquer method, it is suitable for problems solved by dynamic programming, and the sub-problems obtained after decomposition are often not independent of each other. If the divide-and-conquer method is used to solve such problems, the number of sub-problems obtained by decomposition is too large, and some sub-problems are repeatedly calculated many times. If we can save the answers to the sub-questions that have been solved, and then find the answers that have been found when needed, this can avoid a lot of double calculations and save time. We can use a table to record the answers to all solved sub-questions. Regardless of whether the sub-problem will be used in the future, as long as it has been calculated, the results will be filled in the table. This is the basic idea of ​​the dynamic programming method. The specific dynamic programming algorithms are various, but they have the same form filling form.

 

 

classification

Dynamic programming can be generally divided into four categories: linear dynamic rules, regional dynamic rules, tree dynamic rules, and backpack dynamic rules.
 
Examples:
Linear dynamic rules: intercept missiles, chorus formations, mine digging, build schools, swordsman duels, etc .;
Regional dynamic rules: merging stones, adding binary trees, counting the number of words, artillery deployment, etc .;
Tree-shaped dynamic rules: greedy nine-headed dragon, binary search tree, party joy, digital triangle, etc .;
Backpack problem: 01 backpack problem, complete backpack problem, group backpack problem, 2D backpack, packing problem, milking ( Tongji ACM question 1132), etc .;
 
Applications:
Shortest path problem, project management , network flow optimization, etc .;
POJ dynamic planning topic list:
Easy:
  1018,1050,1083,1088,1125,1143,1157,1163,1178,1179,1189,1191,1208,1276,1322,1414,1456,1458,1609,1644,1664,1690,1699,1740, 1742,1887,1926,1936,1952,1953,1958,1959,1962,1975,1989,2018,2029,2039,2063,2081,2082,2181,2184,2192,2231,2279,2329,2336,2346, 2353, 2355, 2356, 2385, 2392, 2424.
Not easy:
  1019, 1037, 1080, 1112, 1141, 1170, 1192, 1239, 1655, 1695, 1707, 1733 (interval subtraction, addition and collection), 1737, 1837, 1850, 1920 (enhanced version of the Hanolta), 1934 (All longest common subsequences), 1964 (Maximum rectangular area, O (n * m) algorithm), 2138,2151,2161,2178.
Recommended:
  1015, 1635, 1636, 1671, 1682, 1692, 1704, 1717, 1722, 1726, 1732, 1770, 1821, 1853, 1949, 2019, 2127, 2176, 2228, 2287, 2342, 2374, 2378, 2384, 2411.  [1] 

 

 

 

https://www.cnblogs.com/hithongming/p/9229871.html

Guess you like

Origin www.cnblogs.com/BlairGrowing/p/12735294.html