Reinforcement Learning-Based Nonautoregressive Solver for Traveling Salesman Problems

Yubin Xiao, Di Wang, Boyang Li, Huanhuan Chen, Wei Pang, Xuan Wu, Hao Li, Dong Xu, Yanchun Liang, You Zhou

TL;DR

This paper introduces NAR4TSP, the first non-autoregressive (NAR) neural network model trained with reinforcement learning (RL) to solve the Traveling Salesman Problem (TSP). It achieves a compelling balance of high solution quality, fast inference speed, and excellent generalization, outperforming existing state-of-the-art methods.

What Problem Does This Paper Address?

The Traveling Salesman Problem (TSP) is a classic optimization challenge with numerous real-world applications. While neural networks have shown promise in finding near-optimal solutions, existing approaches often fall into two camps: autoregressive (AR) models that are slow due to sequential processing, and non-autoregressive (NAR) models that are fast but typically sacrifice solution quality. Furthermore, many NAR models rely on supervised learning (SL), requiring expensive pre-computed optimal solutions and exhibiting poor generalization. This paper aims to bridge this gap by developing a fast, high-quality, and generalizable TSP solver using a novel NAR architecture trained with RL.

Methods

The core innovation of NAR4TSP lies in its unique combination of a specialized Graph Neural Network (GNN) architecture and an enhanced Reinforcement Learning (RL) strategy.

  • GNN Architecture: The GNN is designed to output two key components: a "starting-node pointer" and a matrix of "edge scores." The pointer learns to identify the most promising starting node for the TSP tour, a departure from traditional NAR models that arbitrarily start at node 1. This, along with the edge scores, guides the decoding process.
  • Enhanced RL Strategy: Instead of relying on expensive ground-truth optimal solutions (as in SL), NAR4TSP uses RL. Crucially, it integrates the NAR model's output decoding directly into the RL training loop. This means the model learns by generating TSP solutions and receiving rewards based on their tour lengths, ensuring training consistency with the inference process. The RL strategy is also enhanced to be more efficient by using a single training module instead of the typical two.

Datasets

  • Synthetic Datasets: The paper uses synthetic TSP instances of sizes TSP50 (50 nodes) and TSP100 (100 nodes), generated by sampling node locations from a unit uniform distribution. Larger instances (TSP200, TSP500, TSP1000) are also used for generalization tests.
  • Real-World Datasets: The authors also evaluate NAR4TSP on 25 real-world Euclidean TSP instances and 10 non-Euclidean TSP instances from the TSPLIB dataset.

Key Insights and Ideas

  • The Power of a Learned Starting Node: The introduction of a learned "starting-node pointer" in the GNN is a significant contribution. It moves away from arbitrary starting points and allows the model to dynamically identify the most promising initial node, improving both training and inference.
  • Bridging NAR and RL: The paper successfully tackles the inherent challenge of combining the parallel output nature of NAR networks with the step-by-step decision-making of RL. By incorporating the decoding process into the reward mechanism, they create a cohesive and effective training loop.
  • RL for Generalization: Training with RL, rather than SL, avoids the need for pre-computed optimal solutions and appears to lead to better generalization capabilities, especially when dealing with TSP instances of varying sizes and distributions.
  • Efficiency Through Simplicity: The enhanced RL strategy, using a single training module, reduces computational overhead and improves efficiency without sacrificing performance.

Key Results

  • Solution Quality: NAR4TSP consistently achieves competitive solution quality, often on par with or slightly worse than the best AR models, but with significantly faster inference. It outperforms other NAR models in solution quality.
  • Inference Speed: NAR4TSP demonstrates a substantial advantage in inference speed, particularly as the number of nodes and beam width increase. For example, it shows a ~94x improvement in inference time compared to a SOTA AR model on TSP50 instances.
  • Generalization: The model exhibits superior generalization ability, performing well on TSP instances of different sizes and even on real-world TSPLIB instances without specific training on them (zero-shot generalization).
  • Extensibility: NAR4TSP can be effectively extended to solve other combinatorial optimization problems like Manhattan TSP and CVRP, showcasing its versatility.

Limitations and Future Work

  • Slightly Lower Solution Quality than Top AR Models: While NAR4TSP achieves excellent results, it may not always match the absolute best solution quality of some top-performing AR models, particularly those that use extensive beam search.
  • Future Work: The authors suggest developing a "semi-autoregressive" variant of NAR4TSP that generates multiple nodes at each step to potentially further improve the trade-off between inference latency and solution quality. They also highlight the potential for NAR4TSP to solve other complex combinatorial optimization problems.

Summary updated

BibTeX
@article{xiao2025reinforcement,
  author = {Yubin Xiao and Di Wang and Boyang Li and Huanhuan Chen and Wei Pang and Xuan Wu and Hao Li and Dong Xu and Yanchun Liang and You Zhou},
  title = {{Reinforcement Learning-Based Nonautoregressive Solver for Traveling Salesman Problems}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2025},
  url = {https://openreview.net/forum?id=k9uZbuwFwD},
}
Figure