Answers are grounded in this paper and cite their sources.
We study the colored knapsack problem (ColKP), a generalization of the classical knapsack problem in which items are partitioned into color classes and selected items must be orderable with no two consecutive items sharing a color. We prove weak NP‐hardness and develop two exact dynamic programming algorithms, running in and time, where is the knapsack capacity. We strengthen both algorithms with dominance and fathoming rules. We further show that the linear‐programming relaxation of the ColKP natural formulation admits an optimum with at most two fractional items and can be solved in time. Computational experiments on instances derived from the colored bin packing problem and on synthetic ColKP instances show that the algorithms perform particularly well on the former, while a general‐purpose solver is preferable for synthetic instances with large capacities.
No takes yet. Share an insight, caveat, or question.
Ciccarelli et al. (2026) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: