Dynamic Programming algorithm

Source: Internet
Author: User

1, dynamic Planning and division of the similarity point: all of the problem to be solved into several sub-problems, first solve these sub-problems, and then from the solution of sub-problems to get the original problem solution

Different points: suitable for solving problems with dynamic programming, the sub-problems obtained by decomposition are generally not independent of each other.

2. The dynamic programming algorithm is often used to solve problems with some optimal properties. There may be many possible solutions to this type of problem, and each solution corresponds to a value, hoping to find the solution with the best value.

3. The validity of dynamic programming algorithm relies on the overlapping of optimal substructure and sub-problem.

Optimal sub-structure refers to the optimal solution of the problem, which includes the optimum solution of the sub-problem, so that the program can gradually construct the optimal solution of the whole problem from the optimal solution of sub-problem in the way of bottom-up.

Sub-problem overlap refers to the iterative solution of some sub-problems multiple times, dynamic planning can store these solutions.

4, solutions to the problem of dynamic planning:

First: recursion: First from the bottom to the upper end of the advantage: is a large-scale problem to the small problems, easy to think of disadvantages: but inefficient.

Second: iterative recursion: Direct bottom-up advantage efficiency high disadvantage: bad think

Example: Maximum child segments and

Dynamic Programming algorithm

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.