Deep Reinforcement Learning for Solving the Heterogeneous Capacitated Vehicle Routing Problem

Jingwen Li, Yining Ma, Ruize Gao, Zhiguang Cao, Andrew Lim, Wen Song, Jie Zhang · DOI

Abstract

Traditional Deep Reinforcement Learning (DRL) approaches to the Capacitated Vehicle Routing Problem (CVRP) typically assume a homogeneous fleet of vehicles. However, real-world logistics often rely on heterogeneous fleets with varying capacities and speeds. This paper presents a novel DRL framework utilizing a dual-decoder attention mechanism to address the Heterogeneous CVRP (HCVRP). By simultaneously selecting the optimal vehicle and the next customer node, the proposed model achieves competitive solution quality compared to state-of-the-art heuristics while significantly reducing computational overhead. We evaluate the model on both synthetic and benchmark datasets, demonstrating its effectiveness in minimizing total distance (Min-Sum) and fleet completion time (Min-Max).

1. Introduction

The Capacitated Vehicle Routing Problem (CVRP) is a fundamental optimization challenge in logistics, focused on determining the most efficient routes for a fleet of vehicles to deliver goods to a set of customers. While many DRL-based solvers have been developed for this problem, they often simplify the scenario by assuming all vehicles are identical. In practice, fleets are frequently heterogeneous, comprising vehicles with different load capacities and travel speeds. This heterogeneity introduces significant complexity, as the solver must account for vehicle-specific constraints and performance metrics.

This research addresses the HCVRP by optimizing for two distinct objectives:

  1. Min-Sum: Minimizing the total distance or time traveled by the entire fleet to reduce operational costs.
  2. Min-Max: Minimizing the time taken by the longest route, which ensures workload balancing and faster overall service completion.

2. Methodology

The proposed architecture is an end-to-end model based on the Transformer framework, consisting of a single encoder and a specialized dual-part decoder.

2.1 Encoder Architecture

The encoder transforms raw input data—including customer coordinates, demand requirements, and vehicle capacities—into high-dimensional embeddings. It utilizes self-attention mechanisms to capture the spatial relationships and dependencies between all nodes in the network, providing a comprehensive representation of the problem state.

2.2 Dual-Decoder Mechanism

The core innovation of this work is the dual-decoder, which makes two coordinated decisions at each step of the routing process:

  • Vehicle Selection Decoder: This component evaluates the current state of the fleet, including vehicle locations, remaining capacities, and accumulated travel times, to determine which vehicle is best suited for the next movement.
  • Node Selection Decoder: Once a vehicle is selected, this decoder identifies the optimal customer node for that specific vehicle to visit next.

To provide a global view of the fleet's progress, the model incorporates "Route Feature Embeddings," which use max-pooling to aggregate information from all current partial routes. This allows the model to make informed decisions based on the state of the entire system rather than just the active vehicle.

2.3 Training

The model is trained using Policy Gradient methods with a greedy rollout baseline. This reinforcement learning approach allows the network to learn optimal routing strategies through trial and error, rewarding sequences that minimize the target objective (Min-Sum or Min-Max).

3. Experimental Evaluation

The model was tested on synthetic datasets with 40 to 160 customers and fleets of 3 (V3) or 5 (V5) heterogeneous vehicles. Additionally, the researchers utilized the CVRPLib public benchmark to assess the model's robustness against various customer distributions.

3.1 Performance and Speed

The DRL framework demonstrated a significant advantage in computational efficiency. For a problem involving 120 customers, the DRL model generated solutions in seconds, whereas the state-of-the-art heuristic, Slack Induction Search (SISR), required several minutes. While SISR maintained a slight edge in raw solution quality on certain benchmarks, the DRL model remained highly competitive.

3.2 Min-Max Objective Success

The DRL model proved particularly effective for the Min-Max objective. In large-scale scenarios (e.g., V5-C140 and V5-C160), the DRL approach using sampling outperformed SISR within a fixed time budget. This success is attributed to the model's ability to perform "dynamic vehicle switching," where it can jump between vehicles to balance workloads effectively—a capability often lacking in traditional construction heuristics.

3.3 Generalization

The model exhibited strong zero-shot generalization. A model trained on 60 customers could be applied to instances with 100 or 120 customers with minimal loss in solution quality. This suggests that the attention mechanism learns generalizable routing principles rather than overfitting to specific map configurations.

4. Discussion and Limitations

Despite its strengths, the model faces challenges regarding out-of-distribution generalization. Performance slightly decreased when applied to non-uniform customer distributions that differed from the training data. Furthermore, the current framework assumes static constraints; real-world variables such as fluctuating travel times or dynamic order arrivals are not yet accounted for.

5. Conclusion

This paper demonstrates that a DRL framework with a dual-decoder attention mechanism can effectively solve the Heterogeneous Capacitated Vehicle Routing Problem. By providing a superior trade-off between computation time and solution quality, particularly for the Min-Max objective, this approach offers a promising alternative to traditional heuristics in time-sensitive logistics environments. Future work will explore the integration of time windows and stochastic elements to further align the model with real-world operational demands.

Summary updated

BibTeX
@article{li2021deep,
  author = {Jingwen Li and Yining Ma and Ruize Gao and Zhiguang Cao and Andrew Lim and Wen Song and Jie Zhang},
  title = {{Deep Reinforcement Learning for Solving the Heterogeneous Capacitated Vehicle Routing Problem}},
  journal = {IEEE Trans. Cybernetics},
  year = {2021},
  doi = {10.1109/tcyb.2021.3111082},
}
Figure