Deep Reinforcement Learning for Generalizable Multi-Knapsack Optimization in Retail Packaging
DOI:
https://doi.org/10.19139/soic-2310-5070-4105Keywords:
deep reinforcement learning, multi-knapsack optimization, action masking, proximal policy optimization, generalization, retail packagingAbstract
Classical metaheuristics such as Particle Swarm Optimization (PSO), Genetic Algorithm (GA), and Simulated Annealing (SA) achieve high solution quality for the Multi-Constraint Multi-Knapsack Parcel Optimization Problem (MCMKPOP) but require full re-optimization whenever bin configurations change, making them impractical for dynamic retail environments. This paper proposes a deep reinforcement learning framework based on Proximal Policy Optimization (PPO) that maximizes total retail price across all bins subject to simultaneous budget and weight constraints, with three key architectural components: action masking to enforce feasibility, a shaped dense reward function to guide item-selection behavior at each step, and categorical feature embeddings to encode semantic product attributes. The agent is trained once on a fixed set of bin configurations and applied to unseen configurations without retraining. Experiments use a real-world dataset of 1,733 retail items collected from 18 Indonesian souvenir stores, allocated across 10 heterogeneous bins. On the training configuration, PPO achieves 99.68% of the total budget capacity (4,000,000 IDR), within 0.31 percentage points of SA and PSO, while requiring 0.30 seconds per inference compared to 82.26 seconds for SA and 45.99 seconds for PSO. Generalization experiments across 21 unseen bin configurations show a mean quality advantage of 0.43 percentage points over PSO re-optimization with a mean speedup of 24.5 times. An ablation study with Bonferroni-corrected Wilcoxon signed-rank tests confirms that action masking is indispensable (removal causes a 99.12 percentage point collapse), shaped reward contributes 1.28 percentage points, and categorical embeddings provide a statistically significant improvement of 0.12 percentage points (p < 0.001). These findings demonstrate that PPO can serve as a practical, generalizable solver for constrained multi-knapsack problems by trading a small quality margin for orders-of-magnitude reduction in deploymenttime computation.Downloads
Published
2026-08-12
How to Cite
Rizqa, I., Syukur, A., Marjuni, A., & Rijati, N. (2026). Deep Reinforcement Learning for Generalizable Multi-Knapsack Optimization in Retail Packaging. Statistics, Optimization & Information Computing. https://doi.org/10.19139/soic-2310-5070-4105
License
Copyright (c) 2026 Ifan Rizqa, Abdul Syukur, Aris Marjuni, Nova Rijati

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).