你可以构建所有子集,检查重量是否小于背包的重量,然后选择最大值的子集。
You could construct all subsets, check that the weight is less than the weight of the knapsack, and then choose the subset with the maximum value.
在你看来,一个是另一个的子集吗?
这样将在左边窗格中打开您的子集。
As you have discovered in recent problem set, it is possible to construct all subsets of a set.
正如你在最近的问题集中发现的,构建集合的所有子集是可行的。
And now we want to find the subset of a that has the maximum value, subject to the weight constraint.
会有一个值与其对应,现在我们想要找出满足,重量约束条件的a的最大值子集。
It's just like if you restrict me to only a subset of numbers, only the odd numbers, still there's an infinity of odd numbers.
这就像,如果你把我限制在数字的子集,只是奇数,但奇数的数量却仍然是无限多的
应用推荐