Chapter 2AlgorithmGetting started
Divide and conquer method-algorithms are commonly used when the structure is recursive.
Chapter 4 Dynamic Planning
I. The optimal solution of a problem contains an optimal solution of its subproblems, which is the optimal sub-structure. One problem with the optimal sub-structure is that dynamic planning may be applicable (or greedy algorithms ).
You can use the optimal solution of a subproblem to construct an optimal solution.
Sub-problems are independent, that is, the solution of a sub-problem does not affect the solution of other sub-problems, in order to have an optimal sub-structure.
A common mode that can be followed:
1) One solution to the problem can be to make a choice. For example, select an assembly station.
2) for a given problem, it is known that it is a choice that can lead to the optimal solution (the optimal solution of the sub-problem), and you do not have to worry about how to determine this choice.
3) determine which sub-problems will occur and how to describe the sub-problems.
4) "Clipboard": Used to prove that the solution of the subproblem used is also optimal in an optimal solution of the problem. That is, anyway.
II. Subproblem overlap is the second sign of dynamic planning. The bottom-up table method calculates the optimal cost.
3. The dynamic planning time depends on two factors: the total number of subproblems and the number of choices for each subproblem.
Example: LCs problem: describe the structure of the optimal solution --> recursively define the value of an optimal solution --> calculate the value of the optimal solution --> construct the optimal solution
(LCS is a dynamic planning algorithm for removing sub-problems due to the problem conditions, and the editing distance is also. Neither assembly line scheduling nor matrix chain multiplication)
Chapter 4 basic graph algorithms
I. Breadth-first search)
Queue Shortest Path
Breadth priority tree
II. Deepth-first search)