[Paper Review] A State Aggregation Approach for Solving Knapsack Problem with Deep Reinforcement Learning
This paper proposes a deep reinforcement learning (DRL) approach for the 0-1 Knapsack Problem using state aggregation to reduce the state space and improve learning efficiency. By applying tabular reinforcement learning to discretize item features and training an Advantage Actor-Critic (A2C) policy network, the method achieves near-optimal solutions across diverse instance sizes (up to 500 items), outperforming greedy heuristics and DRL without aggregation in solution quality and sample efficiency.
This paper proposes a Deep Reinforcement Learning (DRL) approach for solving knapsack problem. The proposed method consists of a state aggregation step based on tabular reinforcement learning to extract features and construct states. The state aggregation policy is applied to each problem instance of the knapsack problem, which is used with Advantage Actor Critic (A2C) algorithm to train a policy through which the items are sequentially selected at each time step. The method is a constructive solution approach and the process of selecting items is repeated until the final solution is obtained. The experiments show that our approach provides close to optimal solutions for all tested instances, outperforms the greedy algorithm, and is able to handle larger instances and more flexible than an existing DRL approach. In addition, the results demonstrate that the proposed model with the state aggregation strategy not only gives better solutions but also learns in less timesteps, than the one without state aggregation.
Motivation & Objective
- To overcome the limitations of existing DRL methods for the Knapsack Problem, such as intractable state space growth and poor generalization across instance sizes.
- To improve upon the greedy heuristic by learning adaptive selection policies through deep reinforcement learning.
- To develop a generalizable DRL framework that can be trained once for N items and applied to any instance of size up to N.
- To reduce the state space size via feature-based state aggregation while preserving solution quality and accelerating learning.
Proposed method
- A state aggregation strategy is applied to discretize continuous item features (value, weight, value-to-weight ratio) using tabular reinforcement learning to derive an optimal aggregation policy.
- The aggregated features form a compact state embedding that reduces the effective state space size, enhancing generalization and training efficiency.
- An Advantage Actor-Critic (A2C) algorithm is used to train a deep neural network policy that selects items sequentially based on the aggregated state.
- The policy network has N outputs (one per item), and actions are selected via greedy or softmax decoding to build a solution step-by-step until knapsack capacity is reached.
- The method is trained once on a set of instances and then generalized to new instances of the same or smaller size without retraining.
- The approach is evaluated on three instance types: random, fixed capacity, and hard instances near the phase transition, with sizes 50, 300, and 500.
Experimental results
Research questions
- RQ1Can state aggregation in DRL significantly reduce the state space of the Knapsack Problem while preserving solution quality?
- RQ2Does the proposed DRL method with state aggregation outperform greedy heuristics and existing DRL baselines in solution quality and learning speed?
- RQ3Can a single DRL model trained on instances of size N be generalized to solve instances of any size up to N?
- RQ4How does state aggregation affect performance on hard instances near the phase transition, where solution space is large but optimal solutions are rare?
- RQ5Does the use of tabular RL to derive the aggregation policy lead to better generalization and faster convergence in the downstream DRL training?
Key findings
- The proposed DRL with state aggregation achieves near-optimal solutions for all tested instances, including 500-item instances, with average solution values within two decimal places of optimal.
- For 500-item hard instances (HI), the DRL with aggregation method achieved 133 more highest-value solutions than the DRL without aggregation, despite fewer optimal solutions.
- The DRL with aggregation method required approximately 10,000 fewer timesteps to converge, demonstrating faster learning.
- On 300- and 500-item instances, the DRL with aggregation outperformed the DRL without aggregation in terms of solution quality (average value) and number of highest-value solutions.
- State aggregation was most beneficial for hard instances with large feasible solution spaces; it was less effective for small-capacity instances with few feasible solutions.
- The method generalizes well: a model trained on N items can solve any instance up to size N, overcoming the size-specific limitation of prior DRL approaches.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.