Qing North School dp graph theory Camp Travel day2

 

Dp am talking about digital and knapsack problem.

Talk about backpack:

Full backpack: I changed the order:

 

Multiple backpack:

 Multiple backpack Optimization:

So put each item into these groups, then put them into different items, it becomes a 01 knapsack problem;

Sliding window value takes the most problems. Monotonous queue optimization.

The method is simple, wherein in each group can be enumerated a computing article.

Tips:

 

 

Some ignorant. . .

Finally, to the digital link :( dp nausea the morning.)

dp method:

Determine the upper bound.

If we want to enumerate to 2147, currently it has to enumerate the second place, if the enumeration to 1, then we say that he has reached the upper bound, the next one can enumerate from 0 to 4. If this bit is 0, the next one is due no matter how much this number will never be greater than the original number, it can be any enumerated from 0-9. After a few as well.

in the afternoon:

Then say the tree dp:

Foreword
1: dynamic programming associated with spanning tree or graph of.
2: each of them subtree substructure, incorporated parent node, the tree has a natural note substructure.
It is very beautiful very conducive to the dp.
3: clever use of Bfs or Dfs sequence, you can optimize the problem, or get a good solution.
4: may be combined with the tree data structure.
5: Dp time complexity of the tree to be carefully calculated, part of the problem can be shared equally complexity analysis.
6: generally located f [u] represents the best value u subtree or is that the number of programs.
Or F [u] [k] u denotes the subtree extensions optimum value of k by considering the often subtree root node
Case transferred. 
first question:

 

end

Guess you like

Origin www.cnblogs.com/lbssxz/p/11318909.html