English

Knapsack: Connectedness, Path, and Shortest-Path

Data Structures and Algorithms 2024-01-25 v4 Artificial Intelligence

Abstract

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(2twlogtwpoly(min{s2,d2}))O\left(2^{tw\log tw}\cdot\text{poly}(\min\{s^2,d^2\})\right) where tw,s,dtw,s,d are respectively treewidth of the graph, size, and target value of the knapsack. We further exhibit a (1ϵ)(1-\epsilon) factor approximation algorithm running in time O(2twlogtwpoly(n,1/ϵ))O\left(2^{tw\log tw}\cdot\text{poly}(n,1/\epsilon)\right) for every ϵ>0\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.

Keywords

Cite

@article{arxiv.2307.12547,
  title  = {Knapsack: Connectedness, Path, and Shortest-Path},
  author = {Palash Dey and Sudeshna Kolay and Sipra Singh},
  journal= {arXiv preprint arXiv:2307.12547},
  year   = {2024}
}

Comments

Accepted in LATIN 2024

R2 v1 2026-06-28T11:38:19.614Z