Learning to Insert for Constructive Neural Vehicle Routing Solver

Fu Luo, Xi Lin, Mengyuan Zhong, Fei Liu, Zhenkun Wang, Jianyong Sun, Qingfu Zhang

Abstract

Neural combinatorial optimization (NCO) models for vehicle routing problems typically construct solutions by sequentially appending unvisited nodes to the end of a path. This rigid approach often leads to suboptimal local decisions that are difficult to correct. We present L2C-Insert, a novel framework that learns to flexibly insert nodes into any position within a partial route. By leveraging an encoder-decoder Transformer architecture trained on optimal solutions, L2C-Insert significantly improves solution quality and computational efficiency. Our results demonstrate that L2C-Insert outperforms state-of-the-art neural solvers on benchmarks up to 100,000 nodes, reducing optimality gaps while maintaining high inference speeds.

Introduction

The Vehicle Routing Problem (VRP) and its variant, the Traveling Salesman Problem (TSP), are fundamental NP-hard challenges in logistics and transportation. Traditional solvers like Concorde provide optimal solutions but scale poorly. Recently, Neural Combinatorial Optimization (NCO) has emerged as a promising alternative, using deep learning to learn heuristics. However, most constructive NCO methods are limited by an "append-only" paradigm, where nodes are added one-by-one to the end of a sequence. This lack of flexibility often results in self-intersecting paths and poor global structure.

The L2C-Insert Framework

L2C-Insert shifts the paradigm from appending to insertion. Instead of deciding which node comes next in a fixed sequence, the model evaluates the entire partial solution to determine the optimal insertion point for a given node.

Comparison of the traditional append-based paradigm (left) and the proposed insertion-based paradigm (right).

The framework consists of several key innovations:

  • Transformer Architecture: An encoder processes node features to generate embeddings. A specialized decoder then takes the embedding of the node to be inserted, the embeddings of unvisited nodes, and the embeddings of all possible insertion edges (represented by adjacent nodes in the current route).
  • Supervised Training: The model is trained using supervised learning on optimal routes generated by classical solvers. It learns to maximize the likelihood of selecting the correct insertion position for a node given a partial optimal route.
  • Iterative Refinement: During inference, the model employs a "distance-based destruction" strategy. It removes a subset of nodes that are geographically close and uses the trained insertion policy to re-integrate them into the route, effectively performing a local search to escape local optima.

Experimental Results

L2C-Insert was evaluated on synthetic benchmarks (TSP and CVRP) ranging from 100 to 100,000 nodes, as well as real-world instances from TSPLIB and CVRPLIB.

Performance comparison of L2C-Insert against state-of-the-art solvers on TSP and CVRP benchmarks.

Key findings include:

  • Superior Scaling: On TSP1K (1,000 nodes), L2C-Insert achieved a 34.2% reduction in the optimality gap compared to the LEHD model while being 6.7 times faster.
  • Large-Scale Robustness: For 10,000-node instances, the model outperformed strong baselines like DIFUSCO and GLOP in both accuracy and speed, reducing gaps by up to 54.3%.
  • Ablation Success: Direct comparisons showed that the insertion mechanism alone provides a massive reduction in optimality gaps (over 50%) compared to an equivalent append-based architecture while requiring fewer search iterations.

Conclusion

L2C-Insert demonstrates that incorporating classical operations research concepts like insertion into neural architectures can yield significant performance gains. By providing the model with the flexibility to modify routes at any point, L2C-Insert avoids the pitfalls of rigid sequential construction. Future work will focus on learning the node selection policy and extending the framework to more complex routing constraints.

Summary updated

BibTeX
@inproceedings{luo2025learning,
  author = {Fu Luo and Xi Lin and Mengyuan Zhong and Fei Liu and Zhenkun Wang and Jianyong Sun and Qingfu Zhang},
  title = {{Learning to Insert for Constructive Neural Vehicle Routing Solver}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=SXr3Dynctm},
}
Figure