Learning to Deliver: a Foundation Model for the Montreal Capacitated Vehicle Routing Problem

Samuel J. K. Chin, Matthias Winkenbach, Akash SrivastavaarXiv 2024 · DOI

Abstract

The Capacitated Vehicle Routing Problem (CVRP) is a fundamental challenge in logistics, traditionally addressed through hand-crafted heuristics or specialized deep learning models that lack flexibility. This paper presents the Foundation Model for the Montreal Capacitated Vehicle Routing Problem (FM-MCVRP), a unified Transformer-based architecture that frames delivery routing as a sequence-to-sequence translation task. By leveraging supervised curriculum learning on millions of problem instances, the model demonstrates the ability to generalize across varying problem sizes and vehicle capacities. Notably, the FM-MCVRP outperforms its heuristic training sources and exhibits zero-shot scalability to problem sizes larger than those encountered during training, offering a robust, single-model solution for real-world logistics.

Introduction

The Capacitated Vehicle Routing Problem (CVRP) is an NP-hard combinatorial optimization problem where a fleet of vehicles must service a set of customers from a central depot while adhering to strict load capacities. While traditional Operations Research (OR) has relied on exact methods or meta-heuristics like the Hybrid Genetic Search (HGS), these approaches often struggle to balance computational speed with solution quality at scale.

Recent advances in Deep Learning (DL) have introduced neural solvers, yet most existing models are "brittle." They are typically trained for a fixed number of customers (e.g., exactly 50 nodes) and fail to generalize when the problem size or vehicle capacity changes. This paper introduces the FM-MCVRP, a model designed to overcome these limitations by treating the routing problem as a natural language processing (NLP) task, creating a "foundation model" capable of handling diverse logistics scenarios within a fixed urban environment.

The Montreal CVRP Framework

The authors focus on the Montreal CVRP, a variant where all potential delivery locations are nodes on a fixed "city" graph containing 10,000 possible addresses. This setup mirrors real-world urban logistics, where a company services different subsets of the same city daily. By grounding the problem in a fixed spatial graph, the model can learn the underlying topology of the service area, improving its ability to predict efficient paths between recurring locations.

Methodology

Architecture: Routing as Translation

The FM-MCVRP adapts the T5 (Text-to-Text Transfer Transformer) architecture. In this framework, the model "translates" a set of problem features into an optimized sequence of stops. Each "token" in this sequence represents a node (customer or depot) described by nine distinct features, including spatial coordinates, demand requirements, and current vehicle load.

Training and Curriculum Learning

To ensure stability and performance, the researchers utilized Supervised Learning rather than Reinforcement Learning. The model was trained on a massive dataset of 38.1 million problem-solution pairs generated by the HGS heuristic. To manage the complexity of the task, the authors employed Curriculum Learning, starting with simple 20-node problems and gradually increasing the difficulty to 400-node instances.

Decoding Strategies

During inference, the model utilizes Nucleus Sampling (top-p). This technique, borrowed from Large Language Models (LLMs), allows the model to explore multiple high-probability routing paths. By sampling 1,000 potential routes and selecting the best one, the model can identify optimizations that a standard greedy search might overlook.

Key Results and Insights

Surpassing the Teacher

One of the most significant findings is that the FM-MCVRP frequently produces routes superior to those generated by the HGS heuristic used to train it. While the training data provided a baseline, the model's ability to sample and evaluate multiple paths allows it to find "lucky" optimizations, effectively outperforming its own "teacher."

Zero-Shot Scalability

The model demonstrated remarkable emergent behavior in scalability. Despite being trained on problems with a maximum of 400 customers, the FM-MCVRP successfully solved instances with 600 and 800 customers with high solution quality. This zero-shot generalization suggests that the model has learned fundamental principles of spatial optimization rather than merely memorizing patterns.

Performance Benchmarks

  • Accuracy: On 400-customer problems, the model's solutions were within 2% of the best-known benchmarks (LKH-3 and HGS).
  • Stability: Unlike previous state-of-the-art neural models like the Attention Model (AM), which often diverge or fail on problems exceeding 400 nodes, the FM-MCVRP remained stable and effective.
  • Efficiency: The model can generate high-quality routes for 400 customers in approximately 6 seconds using greedy decoding, making it suitable for real-time dispatching environments.

Limitations and Future Directions

While the FM-MCVRP represents a leap forward, it faces certain constraints. Its autoregressive nature—predicting one stop at a time—limits parallelization during the decoding phase, making it slower than some non-transformer DL approaches. Additionally, the model requires specific data-ordering techniques to handle permutation invariance, as Transformers do not inherently understand that the input order of customers should not affect the optimal route.

Future research will explore "bootstrapping" techniques, where the model is retrained on its own best-discovered routes to further refine performance. The authors also suggest investigating decoder-only architectures (similar to GPT) to determine if they provide more efficient internal representations of the city graph.

Conclusion

The FM-MCVRP demonstrates that framing vehicle routing as a sequence-to-sequence task allows for the creation of a versatile, unified solver. By moving away from size-specific models toward a foundation model approach, this research paves the way for more flexible and maintainable AI solutions in the logistics and operations research sectors.

Summary updated

BibTeX
@misc{chin2024learning,
  author = {Samuel J. K. Chin and Matthias Winkenbach and Akash Srivastava},
  title = {{Learning to Deliver: a Foundation Model for the Montreal Capacitated Vehicle Routing Problem}},
  year = {2024},
  eprint = {2403.00026},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.00026},
}
Figure