The same as divide and conquer, firstly we divide the problem, than we do the decision depends on the last result we got : this need us to stock the result somewhere to avoid recalculations. This is the most different from Divide : we need to stock the result and this result can be used in next steps.
when to use :
- optimization principle : if the problem is about find optimized solution, the sub problems should be about find optimized solutions, too.
- when this stat is done, the stats after this is not influenced by this stat.
- sub problems are not independent, they have overlapping (重叠)
初始状态→│决策1│→│决策2│→…→│决策n│→结束状态
- divide the stages (阶段) in term of time or space for the problem, and all these stages can be sorted
- decide stat value and stats
- from "how to do decision" to "how the stat transforms"
- find boundary conditions
- recursive program
- Fibonaci polynomial
- Knapsack Problem
- 最长公共子序列
- Floyd-Warshall算法
- Viterbi算法
No comments:
Post a Comment