Graph Neural Network Guided Local Search for the Traveling Salesperson Problem

Benjamin Hudson, Qingbiao Li, Matthew Malencia, Amanda Prorok · DOI

Abstract

Solutions to the Traveling Salesperson Problem (TSP) have practical applications to processes in transportation, logistics, and automation, yet must be computed with minimal delay to satisfy the real-time nature of the underlying tasks. However, solving large TSP instances quickly without sacrificing solution quality remains challenging for current approximate algorithms. To close this gap, we present a hybrid data-driven approach for solving the TSP based on Graph Neural Networks (GNNs) and Guided Local Search (GLS). Our model predicts the regret of including each edge of the problem graph in the solution; GLS uses these predictions in conjunction with the original problem graph to find solutions. Our experiments demonstrate that this approach converges to optimal solutions at a faster rate than three recent learning based approaches for the TSP. Notably, we reduce the mean optimality gap on the 100-node problem set from 1.534% to 0.705%, a 2x improvement. When generalizing from 20-node instances to the 100-node problem set, we reduce the optimality gap from 18.845% to 2.622%, a 7x improvement.

Introduction

The Traveling Salesperson Problem (TSP) is a foundational challenge in combinatorial optimization. While exact solvers like Concorde can find optimal solutions, their computational cost often precludes their use in real-time applications such as dynamic delivery routing or warehouse automation. Recent machine learning efforts have attempted to bridge this gap, but they frequently struggle with generalization—where models trained on small graphs (e.g., 20 nodes) fail on larger ones (e.g., 100 nodes)—and the inherent trade-off between solution quality and search speed.

The Hybrid GNN-GLS Framework

To address these limitations, this research proposes a hybrid system that integrates the predictive power of Graph Neural Networks (GNNs) with the search capabilities of Guided Local Search (GLS). The pipeline involves transforming the TSP graph, predicting edge-level metrics, and using those metrics to guide a metaheuristic search.

The GNN-GLS pipeline: transforming the TSP graph into a line graph, predicting regret, and using Guided Local Search to find the final solution.

Predicting Global Regret

A key innovation of this approach is the prediction of global regret rather than simple edge inclusion probability. Regret represents the additional cost incurred by forcing a specific edge into the solution compared to the global optimum. By predicting regret, the GNN provides a nuanced signal that helps the search algorithm distinguish between "near-optimal" edges and those that are significantly detrimental to the total path length.

Line Graph Transformation

Standard GNNs typically operate on node coordinates, which can make them sensitive to the rotation or translation of the input data. This model instead utilizes a line graph transformation, where the edges of the original TSP graph become the nodes of a new graph. This shift allows the model to focus on the structural relationships and distances (edge weights) between cities, significantly improving the model's ability to generalize across different problem sizes and topologies.

Guided Local Search (GLS)

The predicted regrets are integrated into a GLS algorithm. When the local search becomes trapped in a local minimum, the GLS uses the GNN’s regret predictions to penalize unfavorable edges. This mechanism effectively "nudges" the search toward more promising regions of the solution space that it might otherwise overlook.

Experimental Results

The researchers evaluated the GNN-GLS approach against several benchmarks, including traditional heuristics (Nearest Neighbor, Farthest Insertion) and recent deep learning models (Kool et al., Joshi et al.).

Comparative performance of the proposed method against traditional and learning-based benchmarks on TSP20, TSP50, and TSP100.

Key Findings

  • Superior Accuracy: On 100-node problems, the hybrid approach reduced the mean optimality gap from 1.534% to 0.705%, representing a 2x improvement over previous state-of-the-art learning methods.
  • Robust Generalization: In zero-shot generalization tests—where a model trained on 20-node instances was applied to 100-node instances—the optimality gap was reduced from 18.845% to 2.622%, a 7x improvement.
  • Efficiency: The model demonstrated faster convergence to near-optimal solutions compared to other "anytime" learning algorithms, making it suitable for time-sensitive tasks.

Conclusion

By combining the structural intuition of GNNs with the rigorous optimization of GLS, this hybrid approach sets a new standard for learning-based TSP solvers. While the current reliance on supervised learning from exact solvers and the memory overhead of line graph transformations present areas for future improvement, the significant gains in generalization and accuracy mark a major step forward in applying AI to complex combinatorial problems.

Summary updated

BibTeX
@inproceedings{hudson2022graph,
  author = {Benjamin Hudson and Qingbiao Li and Matthew Malencia and Amanda Prorok},
  title = {{Graph Neural Network Guided Local Search for the Traveling Salesperson Problem}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=ar92oEosBIg},
}
Figure