Proceedings

EFormer: An Effective Edge-based Transformer for Vehicle Routing Problems

Download BibTeX Cite

Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 8582-8590.

https://doi.org/10.24963/ijcai.2025/954

Abstract

Recent neural heuristics for the Vehicle Routing Problem (VRP) primarily rely on node coordinates as input, which may be less effective in practical scenarios where real cost metrics—such as edge-based distances—are more relevant. To address this limitation, we introduce EFormer, an Edge-based Transformer model that uses edge as the sole input for VRPs. Our approach employs a precoder module with a mixed-score attention mechanism to convert edge information into temporary node embeddings. We also present a parallel encoding strategy characterized by a graph encoder and a node encoder, each responsible for processing graph and node embeddings in distinct feature spaces, respectively. This design yields a more comprehensive representation of the global relationships among edges. In the decoding phase, parallel context embedding and multi-query integration are used to compute separate attention mechanisms over the two encoded embeddings, facilitating efficient path construction. We train EFormer using reinforcement learning in an autoregressive manner. Extensive experiments on the Traveling Salesman Problem (TSP) and Capacitated Vehicle Routing Problem (CVRP) reveal that EFormer outperforms established baselines on synthetic datasets, including large-scale and diverse distributions. Moreover, EFormer demonstrates strong generalization on real-world instances from TSPLib and CVRPLib. These findings confirm the effectiveness of EFormer’s core design in solving VRPs.

  1. Method
  2. Len. Gap(%)
  3. Len. Gap(%) Len. Gap(%) Len. Gap(%) Len. Gap(%) Len. Gap(%) OPT 19499.583 0.000 40129.375 0.000 43694.666 0.000 925.800 0.000 33184.483 0.000 82903.857 0.000 GCN-Greedy 25371.528 30.242 63125.529 55.716 81143.342 83.080 1233.255 34.732 44684.202 45.069 138044.859 63.597 GCN-BS 23906.973 22.631 58213.359 46.951 76546.164 72.946 1167.058 27.909 42773.044 38.466 120532.679 49.664 GCN-BS* 21195.267 10.824 55853.973 39.104 72865.950 64.648 1087.529 18.369 41403.524 34.012 114962.535 42.366 MatNet(×1) 20076.205 3.880 46876.768 17.868 63544.470 46.192 1098.828 21.017 38946.522 20.351 103278.318 24.309 MatNet(×8) 19761.313 1.786 45638.627 14.479 62427.744 42.206 1072.623 14.901 38218.037 17.657 98912.043 19.460 EFormer(×1) 19741.575 1.698 45396.807 13.599 61415.142 36.562 1107.504 18.766 38477.709 12.485 98010.813 21.023 EFormer(×8) 19662.845 0.837 43360.592 8.805 56111.793 26.924 1019.698 9.885 36968.746 9.784 94612.575 15.325
  4. [Ausiello et al., 2012] Giorgio Ausiello, Pierluigi Crescenzi, Giorgio Gambosi, Viggo Kann, Alberto Marchetti- Spaccamela, and Marco Protasi. Complexity and approx- imation: Combinatorial optimization problems and their approximability properties. Springer Science & Business Media, 2012.
  5. [Barrett et al., 2020] Thomas Barrett, William Clements, Jakob Foerster, and Alex Lvovsky. Exploratory combi- natorial optimization with reinforcement learning. In Pro- ceedings of the AAAI conference on AI, volume 34, pages 3243-3250, 2020.
  6. [Bresson and Laurent, 2017] Xavier Bresson and Thomas Laurent. Residual gated graph convnets. arXiv preprint arXiv:1711.07553, 2017.
  7. [Brophy and Voigt, 2014] Jennifer AN Brophy and Christo- pher A Voigt. Principles of genetic circuit design. Nature methods, 11(5):508-520, 2014.
  8. [Chen and Chen, 2021] Jun Chen and Haopeng Chen. Edge- featured graph attention network. arXiv preprint arXiv:2101.07671, 2021.
  9. [Cheng et al., 2023] Hanni Cheng, Haosi Zheng, Ya Cong, Weihao Jiang, and Shiliang Pu. Select and optimize: Learn- ing to solve large-scale tsp instances. In International Conference on Artificial Intelligence and Statistics, pages 1219-1231. PMLR, 2023.
  10. [Cook et al., 2011] William J Cook, David L Applegate, Robert E Bixby, and Vasek Chvatal. The traveling sales- man problem: a computational study. Princeton university press, 2011.
  11. [Drakulic et al., 2023] Darko Drakulic, Sofia Michel, Florian Mai, Arnaud Sors, and Jean-Marc Andreoli. Bq-nco: Bisim- ulation quotienting for generalizable neural combinatorial optimization. arXiv preprint arXiv:2301.03313, 2023.
  12. [Elgarej et al., 2021] Mouhcine Elgarej, Mansouri Khalifa, and Mohamed Youssfi. Optimized path planning for elec- tric vehicle routing and charging station navigation systems. In Research Anthology on Architectures, Frameworks, and Integration Strategies for Distributed and Cloud Comput- ing, pages 1945-1967. IGI Global, 2021.
  13. [Fu et al., 2021] Zhang-Hua Fu, Kai-Bin Qiu, and Hongyuan Zha. Generalize a small pre-trained model to arbitrarily large tsp instances. In Proceedings of the AAAI conference on AI, volume 35, pages 7474-7482, 2021.
  14. [He et al., 2016] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recog- nition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770-778, 2016.
  15. [Helsgaun, 2017] Keld Helsgaun. An extension of the lin- kernighan-helsgaun tsp solver for constrained traveling salesman and vehicle routing problems. Roskilde: Roskilde University, 12:966-980, 2017.
  16. [Huang et al., 2025] Ziwei Huang, Jianan Zhou, Zhiguang Cao, and Yixin Xu. Rethinking light decoder-based solvers for vehicle routing problems. In International Conference on Learning Representations, 2025.
  17. [Hudson et al., 2021] Benjamin Hudson, Qingbiao Li, Matthew Malencia, and Amanda Prorok. Graph neural network guided local search for the traveling salesperson problem. arXiv preprint arXiv:2110.05291, 2021.
  18. [Ioffe, 2015] Sergey Ioffe. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
  19. [Jin et al., 2023a] Bowen Jin, Yu Zhang, Yu Meng, and Ji- awei Han. Edgeformers: Graph-empowered transformers for representation learning on textual-edge networks. arXiv preprint arXiv:2302.11050, 2023.
  20. [Jin et al., 2023b] Yan Jin, Yuandong Ding, Xuanhao Pan, Kun He, Li Zhao, Tao Qin, Lei Song, and Jiang Bian. Pointerformer: Deep reinforced multi-pointer transformer for the traveling salesman problem. In Proceedings of the AAAI Conference on AI, volume 37, pages 8132-8140, 2023.
  21. [Joshi et al., 2019] Chaitanya K Joshi, Thomas Laurent, and Xavier Bresson. An efficient graph convolutional net- work technique for the travelling salesman problem. arXiv preprint arXiv:1906.01227, 2019.
  22. [Khalil et al., 2017] Elias Khalil, Hanjun Dai, Yuyu Zhang, Bistra Dilkina, and Le Song. Learning combinatorial opti- mization algorithms over graphs. In NeurIPS, 30, 2017.
  23. [Kim et al., 2021] Minsu Kim, Jinkyoo Park, et al. Learning collaborative policies to solve np-hard routing problems. In NeurIPS, 34:10418-10430, 2021.
  24. [Kim et al., 2023] Minjun Kim, Junyoung Park, and Jinkyoo Park. Learning to cross exchange to solve min-max vehicle routing problems. In The Eleventh International Confer- ence on Learning Representations, 2023.
  25. [Kipf and Welling, 2016] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
  26. [Konstantakopoulos et al., 2022] Grigorios D Konstanta- kopoulos, Sotiris P Gayialis, and Evripidis P Kechagias. Vehicle routing problem and related algorithms for logistics distribution: A literature review and classification. Operational research, 22(3):2033-2062, 2022.
  27. [Kool et al., 2019] Wouter Kool, Herke Van Hoof, and Max Welling. Attention, learn to solve routing problems! In ICLR, 2019.
  28. [Kool et al., 2022] Wouter Kool, Herke van Hoof, Joaquim Gromicho, and Max Welling. Deep policy dynamic pro- gramming for vehicle routing problems. In International conference on integration of constraint programming, arti- ficial intelligence, and operations research, pages 190-213. Springer, 2022.
  29. [Kwon et al., 2020] Yeong-Dae Kwon, Jinho Choo, By- oungjip Kim, Iljoo Yoon, Youngjune Gwon, and Seung- jai Min. Pomo: Policy optimization with multiple optima for reinforcement learning. In NeurIPS, 33:21188-21198, 2020.
  30. [Kwon et al., 2021] Yeong-Dae Kwon, Jinho Choo, Iljoo Yoon, Minah Park, Duwon Park, and Youngjune Gwon. Matrix encoding networks for neural combinatorial opti- mization. In NeurIPS, 34:5138-5149, 2021.
  31. [Li et al., 2018] Zhuwen Li, Qifeng Chen, and Vladlen Koltun. Combinatorial optimization with graph convo- lutional networks and guided tree search. In NeurIPS, 31, 2018.
  32. [Li et al., 2021] Sirui Li, Zhongxia Yan, and Cathy Wu. Learning to delegate for large-scale vehicle routing. In NeurIPS, 34:26198-26211, 2021.
  33. [Lin et al., 2024] Zhuoyi Lin, Yaoxin Wu, Bangjian Zhou, Zhiguang Cao, Wen Song, Yingqian Zhang, and Senthilnath Jayavelu. Cross-problem learning for solving vehicle rout- ing problems. In Proceedings of the Thirty-Third Inter- national Joint Conference on Artificial Intelligence, pages 6958-6966, 2024. IJCAI
  34. [Lischka et al., 2024] Attila Lischka, Jiaming Wu, Morteza Haghir Chehreghani, and Balázs Kulcsár. A great architecture for edge-based graph problems like tsp. arXiv preprint arXiv:2408.16717, 2024.
  35. [Lu et al., 2019] Hao Lu, Xingwen Zhang, and Shuang Yang. A learning-based iterative method for solving vehicle rout- ing problems. In International conference on learning representations, 2019.
  36. [Luo et al., 2023] Fu Luo, Xi Lin, Fei Liu, Qingfu Zhang, and Zhenkun Wang. Neural combinatorial optimization with heavy decoder: Toward large scale generalization. In NeurIPS, 36:8845-8864, 2023.
  37. [Ma et al., 2021] Yining Ma, Jingwen Li, Zhiguang Cao, Wen Song, Le Zhang, Zhenghua Chen, and Jing Tang. Learn- ing to iteratively solve routing problems with dual-aspect collaborative transformer. In NeurIPS, 34:11096-11107, 2021.
  38. [Min et al., 2024] Yimeng Min, Yiwei Bai, and Carla P Gomes. Unsupervised learning for solving the travelling salesman problem. In NeurIPS, 36, 2024.
  39. [Nazari et al., 2018] Mohammadreza Nazari, Afshin Oroo- jlooy, Lawrence Snyder, and Martin Takác. Reinforce- ment learning for solving the vehicle routing problem. In NeurIPS, 31, 2018.
  40. [Nowak et al., 2017] Alex Nowak, Soledad Villar, Afonso S Bandeira, and Joan Bruna. A note on learning algorithms for quadratic assignment with graph neural networks. stat, 1050:22, 2017.
  41. [Perron and Furnon, 2023] Laurent Perron and Vincent Furnon. Or-tools. https://developers.google.com/ optimization/routing, 2023. Accessed: 2024-08. Link
  42. [Reinelt, 1991] Gerhard Reinelt. Tsplib-a traveling sales- man problem library. ORSA journal on computing, 3(4):376-384, 1991.
  43. [Scarselli et al., 2008] Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE transactions on neural networks, 20(1):61-80, 2008.
  44. [Shi et al., 2020] Yunsheng Shi, Zhengjie Huang, Shikun Feng, Hui Zhong, Wenjin Wang, and Yu Sun. Masked label prediction: Unified message passing model for semi- supervised classification. arXiv preprint arXiv:2009.03509, 2020.
  45. [Uchoa et al., 2017] Eduardo Uchoa, Diego Pecin, Artur Pes- soa, Marcus Poggi, Thibaut Vidal, and Anand Subramanian. New benchmark instances for the capacitated vehicle rout- ing problem. European Journal of Operational Research, 257(3):845-858, 2017.
  46. [Vaswani, 2017] A Vaswani. Attention is all you need. In NeurIPS, 2017.
  47. [Veličković et al., 2017] Petar Veličković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
  48. [Vidal, 2022] Thibaut Vidal. Hybrid genetic search for the cvrp: Open-source implementation and swap* neighbor- hood. Computers & Operations Research, 140:105643, 2022.
  49. [Wang et al., 2021] Runzhong Wang, Zhigang Hua, Gan Liu, Jiayi Zhang, Junchi Yan, Feng Qi, Shuang Yang, Jun Zhou, and Xiaokang Yang. A bi-level framework for learning to solve combinatorial optimization on graphs. In NeurIPS, 34:21453-21466, 2021.
  50. [Williams, 1992] Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforce- ment learning. Machine learning, 8:229-256, 1992.
  51. [Wu et al., 2021] Yaoxin Wu, Wen Song, Zhiguang Cao, Jie Zhang, and Andrew Lim. Learning improvement heuristics for solving routing problems. IEEE transactions on neural networks and learning systems, 33(9):5057-5069, 2021.
  52. [Xin et al., 2021] Liang Xin, Wen Song, Zhiguang Cao, and Jie Zhang. Neurolkh: Combining deep learning model with lin-kernighan-helsgaun heuristic for solving the traveling salesman problem. In NeurIPS, 34:7472-7483, 2021.
  53. [Zhang et al., 2025] Ni Zhang, Jingfeng Yang, Zhiguang Cao, and Xu Chi. Adversarial generative flow network for solv- ing vehicle routing problems. In International Conference on Learning Representations, 2025.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards