IDEAS home Printed from https://ideas.repec.org/a/plo/pone00/0319711.html
   My bibliography  Save this article

A transformer-based structure-aware model for tackling the traveling salesman problem

Author

Listed:
  • Chun-Sheng Zhao
  • Li-Pei Wong

Abstract

Leveraging the Transformer architecture to develop end-to-end models for addressing combinatorial optimization problems (COPs) has shown significant potential due to its exceptional performance. Nevertheless, a multitude of COPs, including the Traveling Salesman Problem (TSP), displays typical graph structure characteristics that existing Transformer-based models have not effectively utilized. Hence, this study focuses on TSP and introduces two enhancements, namely closeness centrality encoding and spatial encoding, to strengthen the Transformer encoder’s capacity to capture the structural features of TSP graphs. Furthermore, by integrating a decoding mechanism that not only emphasizes the starting and most recently visited nodes, but also leverages all previously visited nodes to capture the dynamic evolution of tour generation, a Transformer-based structure-aware model is developed for solving TSP. Employing deep reinforcement learning for training, the proposed model achieves deviation rates of 0.03%, 0.16%, and 1.13% for 20-node, 50-node, and 100-node TSPs, respectively, in comparison with the Concorde solver. It consistently surpasses classic heuristics, OR Tools, and various comparative learning-based approaches in multiple scenarios while showcasing a remarkable balance between time efficiency and solution quality. Extensive tests validate the effectiveness of the improvement mechanisms, underscore the significant impact of graph structure information on solving TSP using deep neural networks, and also reveal the scalability and limitations.

Suggested Citation

  • Chun-Sheng Zhao & Li-Pei Wong, 2025. "A transformer-based structure-aware model for tackling the traveling salesman problem," PLOS ONE, Public Library of Science, vol. 20(4), pages 1-24, April.
  • Handle: RePEc:plo:pone00:0319711
    DOI: 10.1371/journal.pone.0319711
    as

    Download full text from publisher

    File URL: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0319711
    Download Restriction: no

    File URL: https://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0319711&type=printable
    Download Restriction: no

    File URL: https://libkey.io/10.1371/journal.pone.0319711?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    References listed on IDEAS

    as
    1. Michael Held & Richard M. Karp, 1970. "The Traveling-Salesman Problem and Minimum Spanning Trees," Operations Research, INFORMS, vol. 18(6), pages 1138-1162, December.
    2. G. Clarke & J. W. Wright, 1964. "Scheduling of Vehicles from a Central Depot to a Number of Delivery Points," Operations Research, INFORMS, vol. 12(4), pages 568-581, August.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Martinhon, Carlos & Lucena, Abilio & Maculan, Nelson, 2004. "Stronger K-tree relaxations for the vehicle routing problem," European Journal of Operational Research, Elsevier, vol. 158(1), pages 56-71, October.
    2. Yao, Yu & Zhu, Xiaoning & Dong, Hongyu & Wu, Shengnan & Wu, Hailong & Carol Tong, Lu & Zhou, Xuesong, 2019. "ADMM-based problem decomposition scheme for vehicle routing problem with time windows," Transportation Research Part B: Methodological, Elsevier, vol. 129(C), pages 156-174.
    3. Shengbin Wang & Weizhen Rao & Yuan Hong, 2020. "A distance matrix based algorithm for solving the traveling salesman problem," Operational Research, Springer, vol. 20(3), pages 1505-1542, September.
    4. Yannis Marinakis & Athanasios Migdalas & Panos M. Pardalos, 2005. "A Hybrid Genetic—GRASP Algorithm Using Lagrangean Relaxation for the Traveling Salesman Problem," Journal of Combinatorial Optimization, Springer, vol. 10(4), pages 311-326, December.
    5. Helsgaun, Keld, 2000. "An effective implementation of the Lin-Kernighan traveling salesman heuristic," European Journal of Operational Research, Elsevier, vol. 126(1), pages 106-130, October.
    6. Gong, Manlin & Hu, Yucong & Chen, Zhiwei & Li, Xiaopeng, 2021. "Transfer-based customized modular bus system design with passenger-route assignment optimization," Transportation Research Part E: Logistics and Transportation Review, Elsevier, vol. 153(C).
    7. Smith, John Paul, 1974. "A Lockset analysis of farm to plant milk assembly," ISU General Staff Papers 1974010108000018144, Iowa State University, Department of Economics.
    8. Jumbo, Olga & Moghaddass, Ramin, 2022. "Resource optimization and image processing for vegetation management programs in power distribution networks," Applied Energy, Elsevier, vol. 319(C).
    9. Leloup, Emeline & Paquay, Célia & Pironet, Thierry & Oliveira, José Fernando, 2025. "A three-phase algorithm for the three-dimensional loading vehicle routing problem with split pickups and time windows," European Journal of Operational Research, Elsevier, vol. 323(1), pages 45-61.
    10. Martins, Sara & Ostermeier, Manuel & Amorim, Pedro & Hübner, Alexander & Almada-Lobo, Bernardo, 2019. "Product-oriented time window assignment for a multi-compartment vehicle routing problem," European Journal of Operational Research, Elsevier, vol. 276(3), pages 893-909.
    11. Zi-bin Jiang & Qiong Yang, 2016. "A Discrete Fruit Fly Optimization Algorithm for the Traveling Salesman Problem," PLOS ONE, Public Library of Science, vol. 11(11), pages 1-15, November.
    12. A. Scholz & G. Wäscher, 2017. "Order Batching and Picker Routing in manual order picking systems: the benefits of integrated routing," Central European Journal of Operations Research, Springer;Slovak Society for Operations Research;Hungarian Operational Research Society;Czech Society for Operations Research;Österr. Gesellschaft für Operations Research (ÖGOR);Slovenian Society Informatika - Section for Operational Research;Croatian Operational Research Society, vol. 25(2), pages 491-520, June.
    13. Ibrahim Muter & Tevfik Aytekin, 2017. "Incorporating Aggregate Diversity in Recommender Systems Using Scalable Optimization Approaches," INFORMS Journal on Computing, INFORMS, vol. 29(3), pages 405-421, August.
    14. Cécile Bastidon & Michael Bordo & Antoine Parent & Marc Daniel Weidenmier, 2023. "Another history of global financial markets: Local stock market integration since 1913 from a network perspective," The World Economy, Wiley Blackwell, vol. 46(8), pages 2456-2477, August.
    15. Rostami, Borzou & Malucelli, Federico & Belotti, Pietro & Gualandi, Stefano, 2016. "Lower bounding procedure for the asymmetric quadratic traveling salesman problem," European Journal of Operational Research, Elsevier, vol. 253(3), pages 584-592.
    16. Qi, Mingyao & Lin, Wei-Hua & Li, Nan & Miao, Lixin, 2012. "A spatiotemporal partitioning approach for large-scale vehicle routing problems with time windows," Transportation Research Part E: Logistics and Transportation Review, Elsevier, vol. 48(1), pages 248-257.
    17. Srinivas, Sharan & Ramachandiran, Surya & Rajendran, Suchithra, 2022. "Autonomous robot-driven deliveries: A review of recent developments and future directions," Transportation Research Part E: Logistics and Transportation Review, Elsevier, vol. 165(C).
    18. Derigs, U. & Kaiser, R., 2007. "Applying the attribute based hill climber heuristic to the vehicle routing problem," European Journal of Operational Research, Elsevier, vol. 177(2), pages 719-732, March.
    19. Almoustafa, Samira & Hanafi, Said & Mladenović, Nenad, 2013. "New exact method for large asymmetric distance-constrained vehicle routing problem," European Journal of Operational Research, Elsevier, vol. 226(3), pages 386-394.
    20. César Rego, 1998. "A Subpath Ejection Method for the Vehicle Routing Problem," Management Science, INFORMS, vol. 44(10), pages 1447-1459, October.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:plo:pone00:0319711. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: plosone (email available below). General contact details of provider: https://journals.plos.org/plosone/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.