The colored knapsack problem: structural properties and exact algorithms
Abstract 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.
Authors
- Erik Mühmer (ORCID: https://orcid.org/0000-0003-1114-3800)
- Fabio Ciccarelli (ORCID: https://orcid.org/0009-0005-5795-5574)
- Alexander Helber
Institutions
- Sapienza University of Rome (IT)
- RWTH Aachen University (DE)
Publication Details
- Journal
- International Transactions in Operational Research
- Published
- 2026-11-17
- DOI
- https://doi.org/10.1111/itor.70302
- Citations
- 1
- Primary Topic
- Optimization and Packing Problems
- Type
- article
- Field-Weighted Citation Impact
- 1.73