We study the knapsack problem with graph theoretic constraints. That is, we assume that there exists a graph structure on the set of items of knapsack and the solution also needs to satisfy certain graph theoretic properties on top of knapsack constraints. In particular, we need to compute in the connected knapsack problem a connected subset of items which has maximum value subject to the size of knapsack constraint. We show that this problem is strongly NP-complete even for graphs of maximum degree four and NP-complete even for star graphs. On the other hand, we develop an algorithm running in time $O\left(2^{tw\log tw}\cdot\text{poly}(\min\{s^2,d^2\})\right)$ where $tw,s,d$ are respectively treewidth of the graph, size, and target value of the knapsack. We further exhibit a $(1-\epsilon)$ factor approximation algorithm running in time $O\left(2^{tw\log tw}\cdot\text{poly}(n,1/\epsilon)\right)$ for every $\epsilon>0$. We show similar results for several other graph theoretic properties, namely path and shortest-path under the problem names path-knapsack and shortestpath-knapsack. Our results seems to indicate that connected-knapsack is computationally hardest followed by path-knapsack and shortestpath-knapsack.
翻译:我们研究具有图论约束的背包问题。即假设背包物品集合上存在图结构,且解需在满足背包约束的同时满足特定图论性质。具体而言,在连通背包问题中,我们需要计算满足背包容量约束下价值最大的连通物品子集。我们证明该问题在最大度为四的图中为强NP完全问题,甚至在星形图中仍为NP完全问题。另一方面,我们设计了运行时间为$O\left(2^{tw\log tw}\cdot\text{poly}(\min\{s^2,d^2\})\right)$的算法,其中$tw,s,d$分别表示图的树宽、背包容量与目标值。进一步地,我们给出了对任意$\epsilon>0$运行时间为$O\left(2^{tw\log tw}\cdot\text{poly}(n,1/\epsilon)\right)$的$(1-\epsilon)$近似算法。针对其他图论性质(如路径与最短路径),我们在路径背包问题和最短路径背包问题中得到了类似结果。研究表明,连通背包问题的计算难度最大,其次为路径背包问题和最短路径背包问题。