Algorithm diagram-Dynamic programming

Source: Internet
Author: User

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

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.