Combining Reinforcement Learning with Lin-Kernighan-Helsgaun Algorithm for the Traveling Salesman Problem

Jiongzhi Zheng, Kun He, Jianrong Zhou, Yan Jin, Chu-Min Li

Abstract

The Traveling Salesman Problem (TSP) is a cornerstone of combinatorial optimization. While the Lin-Kernighan-Helsgaun (LKH) heuristic is a leading solver, its reliance on fixed edge-selection rules can be suboptimal. This paper introduces Variable Strategy Reinforced LKH (VSR-LKH), which integrates Reinforcement Learning (RL) to dynamically adapt edge-selection strategies. By alternating between Q-learning, Sarsa, and Monte Carlo methods, VSR-LKH overcomes the limitations of individual RL algorithms and scales to instances with over 80,000 cities. Our evaluation on 111 TSPLIB instances shows that VSR-LKH outperforms standard LKH in both solution quality and success rate, particularly on large-scale and difficult problems.

Introduction

The Traveling Salesman Problem (TSP) involves finding the shortest possible route that visits a set of cities exactly once and returns to the origin. As an NP-hard problem, it serves as a benchmark for optimization algorithms. The Lin-Kernighan-Helsgaun (LKH) algorithm has long been the gold standard, utilizing $k$-opt moves to iteratively improve tours. However, LKH's edge-selection process is guided by a static metric known as the $\alpha$-value, which may not always lead to the global optimum.

Recent advances in Deep Reinforcement Learning (DRL) have introduced learned heuristics for the TSP. While promising, these models often fail to scale beyond a few thousand cities due to memory constraints. VSR-LKH bridges this gap by using RL as an adaptive "brain" within the robust LKH framework, enabling high-performance optimization at scale.

Methodology: Variable Strategy Reinforced LKH

VSR-LKH redefines the edge-selection process as a Markov Decision Process (MDP). In this framework, the current city represents the state, and choosing the next edge to include in the tour is the action. The reward is defined by the reduction in total tour length.

Geometric representation of edge selection and k-opt moves.

Variable Strategy (VSR)

A key innovation of VSR-LKH is its use of multiple RL strategies. The researchers found that Q-learning, Sarsa, and Monte Carlo methods exhibit complementary strengths across different TSP instances. VSR-LKH cycles through these strategies; if a strategy fails to improve the tour after a predefined number of trials (MaxNum), the algorithm switches to the next strategy. This prevents the search from stagnating in local optima.

Q-Value Initialization

To accelerate learning, the Q-table is not initialized randomly. Instead, it uses a combination of local city distances and global $\alpha$-values derived from a minimum spanning tree. This hybrid initialization provides the RL agent with a sophisticated starting point, integrating both local and global topological information.

Experimental Results

The performance of VSR-LKH was benchmarked against 111 symmetric TSP instances from the TSPLIB library, ranging from 14 to 85,900 cities.

Cumulative gap and runtime comparison across TSP instances.

Success Rate and Solution Quality

VSR-LKH achieved a remarkable success rate, finding the optimal solution for 107 out of 111 instances. On "hard" instances where standard LKH often fails, VSR-LKH showed significant improvements. For example, on the rl11849 instance, VSR-LKH found the optimum in 100% of trials, compared to only 20% for standard LKH, while also reducing the average computation time by nearly 75%.

Scalability

Unlike pure DRL approaches, VSR-LKH maintains the scalability of the LKH heuristic. It successfully tackled the pla85900 instance, delivering superior solution quality within the same time constraints as the baseline. As shown in the performance charts, VSR-LKH (purple line) consistently maintains the lowest cumulative gap across a wide range of problem sizes.

Conclusion

VSR-LKH demonstrates that combining classical heuristics with adaptive reinforcement learning creates a powerful synergy. By treating edge selection as a learning problem and employing a variable strategy approach, the algorithm achieves state-of-the-art results on massive TSP instances. Future research will explore extending this framework to asymmetric TSPs and more complex routing problems with additional constraints.

Summary updated

BibTeX
@inproceedings{zheng2021combining,
  author = {Jiongzhi Zheng and Kun He and Jianrong Zhou and Yan Jin and Chu-Min Li},
  title = {{Combining Reinforcement Learning with Lin-Kernighan-Helsgaun Algorithm for the Traveling Salesman Problem}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i14.17476},
}
Figure