Article 7 Dynamic Planning

Source: Internet
Author: User

Today, I want to share with you a kind of "Dynamic Planning" that is more difficult in algorithm thinking. Dynamic Planning is often used as a "Roundabout tactic" or

Guerrilla warfare: find breakthroughs in sports.

I. Thoughts

First, we need to understand "Dynamic Planning". We must first know what it is called "multi-stage decision-making". In the encyclopedia, we have a wide explanation of this problem, so I will load it out,

You have to have a good taste and analysis.

 

The last sentence in the figure above defines what dynamic planning is to do.

 

Ii. Use Rules

Now we know what problems should be solved in dynamic planning. Under what circumstances should we use dynamic planning?

① Optimization Principle (optimal sub-structure ):

If the optimal policy of a problem is the optimal policy of its sub-problem, the problem is called "optimal sub-structure ".

② No aftereffects:

When a problem is divided into multiple decision-making stages, the policies of the previous stage will not be affected by the policies of the latter stage.

③ Overlapping subproblems:

This nature exposes the nature of Dynamic Planning and solves redundancy issues. We can record repeated sub-Problems for later stage decision-making.

To reduce the complexity of the algorithm.

 

3. Solution steps

① Describe the optimal solution model.

② Recursion defines the optimal solution, that is, constructing a dynamic planning equation.

③ Calculate the optimal solution from bottom to top.

④ Finally, the optimal strategy is obtained based on the calculated optimal value.

 

Iv. differences with other algorithms

① Recursion: recursion uses a "top-down" solution strategy and a possible "sub-problem" for repeated calls. The time complexity is naturally high.

"Dynamic Planning" uses "bottom-up" with temporary memory to save the optimal solution of the previous policy, and the space is changed to time.

② Divide governance: the two are also divided into many sub-problems. The difference is that the sub-Problems in "Dynamic Planning" are interrelated.

③ Greedy

Therefore, the first policy in dynamic planning may be overturned by the latter.

 

V. Example

In dynamic planning, the most classic and famous example is the "backpack problem". Currently:

Apple: 1 kg 12¥

Pears: 1 kg 3¥

Grape: 1 kg 10 ¥

Chestnut: 1 kg 25 ¥

Currently, a backpack can only contain 3kg fruits. How can we maximize the value of an item?

Article 7 Dynamic Planning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.