"Introduction to Algorithms", 15th chapter, dynamic programming

Source: Internet
Author: User

Steps for dynamic planning problems

1. Describe the structure of the optimal solution

2, recursive definition of the value of the optimal solution

3. Calculate the value of the optimal solution from the bottom up

4, the optimal solution is constructed by the result of calculation.

In general, the 3rd step is to record some additional information,

There is another way to calculate the bottom-up step, which can be calculated from the top of the memo.

15.1 assembly line Scheduling

15.2 matrix chain Multiplication

15.3 Dynamic Programming Principles

Optimization problems should have two elements: optimal substructure, sub-problem overlap

Methods for discovering the optimal substructure:

1. Make a choice:

2. Assume that you know which option can get the best results

3. Determine which sub-problems the optimal selection will produce

4, the solution of the problem and the solution of the female problem

To portray sub-problem spaces as concise as possible:

In the problem of steel bar cutting, as long as you know the length, in matrix multiplication, you need to know the starting point and the end

15.4 Longest common sub-sequence

15.5 Best binary search tree

Is the same as the matrix multiplication method.

"Introduction to Algorithms", 15th chapter, 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.