简体   繁体   English

受限制的背包没有重量

[英]Constrained Knapsack without weight

I just came across the following problem(it reminds me of the knapsack-problem, but there a some differences): 我刚刚遇到了以下问题(它让我想起背包问题,但有一些不同之处):

You are given a number n of items which you have to put inside your knapsack with a maximum profit. 您将获得n个物品,您必须将这些物品放入背包中并获得最大利润。 Each item has a specific profit value and a specific shape. 每个项目都有特定的利润值和特定的形状。 Because of their shape, some items cannot be put into the knapsack together. 由于它们的形状,有些物品不能放在背包里。 Unlike the normal knapsack-problem there is no maximum weight that limits the number of items in the knapsack. 与普通的背包问题不同,没有最大重量限制了背包中的物品数量。 You are also given a list for each item. 您还会获得每个项目的列表。 In that list you can see the items that can be put into the knapsack with the corresponding item. 在该列表中,您可以看到可以使用相应项目放入背包的物品。

Is there an algorithm that calculates the optimum solution? 有算法可以计算出最优解吗? Or is it an NP-complete problem? 还是NP完全问题? In that case, is there a method of approximation? 在那种情况下,有一种近似方法吗?

I think that this is NPC. 我认为这是NPC。

The polynomial verification requirement is trivial. 多项式验证要求是微不足道的。

The reduction is to the Maximal Independent Set problem. 减少是最大独立集问题。 For each MIS instance G = (V, E) , construct a set of items V with unit profit each. 对于每个MIS实例G =(V,E) ,构造一组具有单位利润的项目V. For each item v ∈ V , the list of items with which it can be placed is the set of vertices to which it doesn't share an edge. 对于每个项v∈V ,可以放置它的项列表是它不共享边的顶点集。 Ie, if G(v) is the list of items that can go with v , then G(v) = {w | 即,如果G(v)是可以与v一起使用的项目列表,那么G(v)= {w | (u, w) ∉ E} . (你好)∉E}

If there is a solution with profit k for the new problem, then it uses k items that are not in each other's lists. 如果存在针对新问题的利润k的解决方案,则它使用不在彼此列表中的k个项目。 It follows that there is a solution of size k to the independent set problem. 由此得出,存在大小为k的独立集问题的解。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM