在coursera上学习discrete optimization时关于dynamic programming的笔记整理

Dynamic programming is somehow like filling a table.
Usually the current problem can be divided into several subproblem which is in the same form as the original problem, dynamic programming is similar to the recurrence strategy (named divided and conquer), they both solve the subproblem first and use the solution of subproblem to acquire the solution of the original problem.
But the difference between dynamic programming and divide and conquer is that divide and conquer use the strategy solving from the top to the bottom, on the contrary, dynamic programming solve from the bottom. It solves the most basic problem first and store it in a table, regardless whether it will be used in the following process. And use the data has been filled in the table to compute the data to be filled in the table.
In dynamic programming, the subproblems usually are not separated or independent, so dynamic programming comparing to divide and conquer can avoid computing the same subproblem for many times.
Take the Fibonacci number for an example. Dynamic programming compute from 1,1,2,3,4,5… every Fibonacci number is computed for only one time. The divide and conquer, however, compute from f(n)=f(n-1)+f(n-2), it compute f(n)and f(n-1) for one time, but f(n-2) for two times, f(n-3) for three times and so on and so forth.

发布了4 篇原创文章 · 获赞 0 · 访问量 132

猜你喜欢

转载自blog.csdn.net/louislin_buaa/article/details/104197064
今日推荐