... X f X s t g X , , ) (X f ) (x g 例例1.9 1.9 00--11背包问题( 背包问题(knapsack problem knapsack problem)) 设有一个容积为 设有一个容积为bb的背包, 的背包,nn个体积分别为 个体积分别为 ,价值分 ,价值分别为 别为 的物品,如何以...
基于8个网页-相关网页
So I haven't done magic, I've given you a really fast way to solve a knapsack problem, but it's still exponential deep down in its heart, in something.
所以我并没有施魔法,我已经告诉了你,一种快速解决背包问题的方法了,但是某些方面它的核心仍然是指数增长的。
Let's now go back and instantiate these ideas for the knapsack problem we looked at last time In particular, for the 0-1 knapsack problem.
让我们回来用具体例子,来说明我们上次看过的背包问题,特别是对0-1背包问题来说。
But let's look for a slight variant of it, where greedy is not so good. And that's what's called the zero-one knapsack problem.
但是让我们找一找它的一些变种,在这些变种中贪婪算法用处不大,这些问题也就是0/1背包问题。
应用推荐