哪位高手能帮小弟我看看这个动态规划有关问题如何弄
谁能帮我看看这个动态规划问题怎么弄
Recall the greedy algorithm for Knapsack from the notes.
Show that, for every constant c < 2, there is an instance of Knapsack
for which the greedy algorithm produces a solution that is greater than
c times optimal. (Hint: recall the example given in class with capacity
19 with three items: u1
with weight 11 and value 11.1, one with weight
10 and value 10, and one with weight 9 and value 9. In this case, the
optimal solution has value 19, whereas the greedy solution provides a
solution of value 11.1.)
------解决方案--------------------
这就不关动态规划什么事。让你举例贪心的反例而已。
Recall the greedy algorithm for Knapsack from the notes.
Show that, for every constant c < 2, there is an instance of Knapsack
for which the greedy algorithm produces a solution that is greater than
c times optimal. (Hint: recall the example given in class with capacity
19 with three items: u1
with weight 11 and value 11.1, one with weight
10 and value 10, and one with weight 9 and value 9. In this case, the
optimal solution has value 19, whereas the greedy solution provides a
solution of value 11.1.)
------解决方案--------------------
这就不关动态规划什么事。让你举例贪心的反例而已。