[Paper Review] Reinforcement Learning to Solve NP-hard Problems: an Application to the CVRP
This paper applies deep reinforcement learning (DRL) to solve the NP-hard Capacitated Vehicle Routing Problem (CVRP), using a Transformer-based policy network trained via REINFORCE to generate solutions autoregressively. Despite not matching the best-known solutions, the DRL approach achieves near-optimal results up to 10x faster than traditional solvers, enabling rapid inference on unseen instances and demonstrating strong potential for real-time commercial applications.
In this paper, we evaluate the use of Reinforcement Learning (RL) to solve a classic combinatorial optimization problem: the Capacitated Vehicle Routing Problem (CVRP). We formalize this problem in the RL framework and compare two of the most promising RL approaches with traditional solving techniques on a set of benchmark instances. We measure the different approaches with the quality of the solution returned and the time required to return it. We found that despite not returning the best solution, the RL approach has many advantages over traditional solvers. First, the versatility of the framework allows the resolution of more complex combinatorial problems. Moreover, instead of trying to solve a specific instance of the problem, the RL algorithm learns the skills required to solve the problem. The trained policy can then quasi instantly provide a solution to an unseen problem without having to solve it from scratch. Finally, the use of trained models makes the RL solver by far the fastest, and therefore make this approach more suited for commercial use where the user experience is paramount. Techniques like Knowledge Transfer can also be used to improve the training efficiency of the algorithm and help solve bigger and more complex problems.
Motivation & Objective
- To evaluate deep reinforcement learning as a scalable, generalizable alternative to traditional exact and heuristic methods for solving NP-hard combinatorial optimization problems.
- To assess the performance of DRL on the Capacitated Vehicle Routing Problem (CVRP), a classic and computationally challenging routing problem.
- To compare RL-based solutions with established solvers (e.g., LKH3) in terms of solution quality, inference speed, and training efficiency.
- To explore knowledge transfer techniques—specifically TSP policy reuse—to accelerate training and improve generalization across problem instances.
- To investigate whether RL can learn effective heuristics automatically, without hand-crafted rules, and generalize to unseen problem instances.
Proposed method
- Formalizes the CVRP as a sequential decision-making problem within a reinforcement learning framework, where the agent selects the next customer to visit based on the current state.
- Employs a Transformer-based neural network with multi-head attention to encode the state of the vehicle routing environment, enabling permutation-invariant representation of customer locations.
- Trains the policy network using the REINFORCE algorithm with policy gradients to maximize expected reward (i.e., minimize total route cost).
- Applies knowledge transfer by initializing the RL policy with a pre-trained TSP policy, reducing training time and improving convergence on CVRP instances.
- Uses a beam search inference strategy during deployment to generate high-quality solutions quickly from the trained policy.
- Evaluates performance on standard benchmark instances (e.g., CMT1, CMT2) using metrics like solution cost, gap to optimal, and inference time.
Experimental results
Research questions
- RQ1Can deep reinforcement learning learn effective heuristics for the CVRP without hand-coded rules, and how does its solution quality compare to traditional solvers?
- RQ2How does the inference speed of the RL-based solver compare to exact and heuristic methods like LKH3, especially on unseen problem instances?
- RQ3To what extent can knowledge transfer from a pre-trained TSP policy improve training efficiency and solution quality for the more complex CVRP?
- RQ4Does the RL policy generalize well to new, unseen CVRP instances without retraining, and how quickly can it produce solutions?
- RQ5Can the RL framework handle more complex variants of the VRP (e.g., with stochastic demand or time windows) more naturally than classical MILP-based approaches?
Key findings
- The RL-based solver returns solutions with a mean cost of 531.9 on the CMT1 benchmark (n=50, Q=160), achieving a 1.4% gap to the optimal solution, comparable to the best-known heuristics.
- Despite not matching the optimal solution, the RL model produces a near-optimal solution over 10 times faster than the LKH3 heuristic solver, which requires over a minute to converge.
- The use of a pre-trained TSP policy for knowledge transfer reduced training time and improved convergence, with the same solution quality (1.4% gap) on CMT1 as the generic training approach.
- The trained RL policy generalizes effectively: it can generate high-quality solutions for new, unseen CVRP instances in near-instantaneous time, without retraining.
- The RL framework is inherently more flexible and scalable than traditional methods, enabling rapid deployment for real-world applications where low-latency response is critical.
- The method demonstrates potential for solving complex VRP variants with dynamic or uncertain parameters (e.g., stochastic demand), which are difficult to model with standard MILP formulations.
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.