CARSS: Cooperative Attention-guided Reinforcement Subpath Synthesis for Solving Traveling Salesman Problem

Yuchen Shi, Congying Han, Tiande GuoarXiv 2023 · DOI

Abstract

The Traveling Salesman Problem (TSP) remains a fundamental challenge in combinatorial optimization due to its NP-hard nature and poor scalability with traditional deep reinforcement learning (DRL) methods. We present CARSS (Cooperative Attention-guided Reinforcement Subpath Synthesis), a multi-agent framework that decomposes TSP into parallel subpath generation and subsequent subpath merging phases. By utilizing multiple agents, CARSS reduces computational complexity from $O(N^2)$ to $O((N/K)^2)$, enabling training on instances up to 2.5x larger than single-agent models. Experimental results demonstrate that CARSS significantly reduces optimization gaps and testing time, achieving superior performance on large-scale TSP instances (up to 1000 nodes) compared to state-of-the-art constructive models.

Introduction

The Traveling Salesman Problem (TSP) is a cornerstone of combinatorial optimization, requiring the identification of the shortest Hamiltonian cycle in a graph. While Deep Reinforcement Learning (DRL) has shown promise in solving TSP, existing "constructive" models—where a single agent builds a path node-by-node—face significant scalability hurdles. As the number of vertices ($N$) increases, these models suffer from $O(N^2)$ complexity in attention mechanisms and high memory consumption, often limiting training to small instances (e.g., TSP200). CARSS addresses these limitations by introducing a cooperative multi-agent approach that parallelizes the construction process through a "divide and conquer" strategy.

Methodology

CARSS employs a two-phase framework to solve TSP efficiently:

  1. Subpath Generation (The "Divide"): Multiple agents ($K$) are initialized at distinct vertices. Each agent iteratively extends its subpath using a cooperative Multi-Agent Reinforcement Learning (MARL) framework. To manage complexity, a Vertex-Agent Assignment Heuristic restricts each agent's focus to a subset of unvisited vertices, reducing the attention matrix complexity to $O((N/K)^2)$.
  2. Subpath Merging (The "Conquer"): Once subpaths reach a sufficient length, the problem transitions to a single-agent phase. This agent treats existing subpaths and isolated nodes as components, fusing them into a final complete cycle.
The CARSS framework illustrating the transition from subpath generation (top) to subpath merging (bottom) to reach a final TSP solution.

The architecture utilizes Transformer-style multi-head attention for feature embedding and communication between agents. Training is conducted using the independent REINFORCE algorithm with a POMO (Policy Optimization with Multiple Optima) baseline to encourage exploration of multiple high-quality solutions.

Experimental Evaluation

The researchers evaluated CARSS on randomly generated TSP instances with sizes $N \in \{100, 200, 500, 1000\}$ vertices drawn from a uniform distribution. Performance was compared against classical heuristics (Nearest/Farthest Insertion, 2-opt) and the state-of-the-art single-agent Attention Model (AM).

Key Results and Insights

  • Memory Efficiency and Scalability: CARSS can train on TSP500 instances using the same GPU memory required by single-agent models for TSP200. This parallelism reduces the number of policy network invocations from $N$ to $N/K$, fundamentally changing the memory footprint.
  • Superior Accuracy: On TSP1000, CARSS (specifically the 500-vertex model with 20 agents) achieved an optimization gap of 34.41%, vastly outperforming the standard AM's 85.96% (sample decoding).
  • Generalization: The model demonstrated strong zero-shot generalization; a model trained on 500 nodes performed remarkably well when tested on 1000 nodes.
  • Agent Trade-offs: There is a trade-off between the number of agents and solution quality. While more agents speed up the process, the mapping of actions can become overly simplistic, leading to slight performance declines if the team size is not optimized for the specific problem scale.

Conclusion

CARSS demonstrates that a cooperative multi-agent strategy can overcome the scalability bottlenecks of single-agent DRL for TSP. By reducing computational complexity and enabling parallel subpath construction, the framework achieves significant improvements in both speed and accuracy for large-scale instances. Future work includes refining agent coordination to avoid local optima and extending the framework to more complex routing problems like the Vehicle Routing Problem (VRP).

Summary updated

Abstract

This paper introduces CARSS (Cooperative Attention-guided Reinforcement Subpath Synthesis), a novel approach to address the Traveling Salesman Problem (TSP) by leveraging cooperative Multi-Agent Reinforcement Learning (MARL). CARSS decomposes the TSP solving process into two distinct yet synergistic steps: "subpath generation" and "subpath merging." In the former, a cooperative MARL framework is employed to iteratively generate subpaths using multiple agents. In the latter, these subpaths are progressively merged to form a complete cycle. The algorithm's primary objective is to enhance efficiency in terms of training memory consumption, testing time, and scalability, through the adoption of a multi-agent divide and conquer paradigm. Notably, attention mechanisms play a pivotal role in feature embedding and parameterization strategies within CARSS. The training of the model is facilitated by the independent REINFORCE algorithm. Empirical experiments reveal CARSS's superiority compared to single-agent alternatives: it demonstrates reduced GPU memory utilization, accommodates training graphs nearly 2.5 times larger, and exhibits the potential for scaling to even more extensive problem sizes. Furthermore, CARSS substantially reduces testing time and optimization gaps by approximately 50% for TSP instances of up to 1000 vertices, when compared to standard decoding methods.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Random TSP instances, 500 verticesCARSS (500, 20)Obj.20.58Traveling Salesperson · split: test · agents=20 · decoding=greedy · vertices=500 · training-vertices=500
Source quote
L420: CARSS (500, 20) │ 8.13 │ 5.08% │ 33.401s │ 12.17 │ 13.61% │ 36.003s │ 20.58 │ 24.35% │ 46.409s │ 31.03 │ 34.41% │ 1.098m
Random TSP instances, 500 verticesCARSS (500, 20)Gap24.35%Traveling Salesperson · split: test · agents=20 · decoding=greedy · vertices=500 · training-vertices=500
Source quote
L420: CARSS (500, 20) │ 8.13 │ 5.08% │ 33.401s │ 12.17 │ 13.61% │ 36.003s │ 20.58 │ 24.35% │ 46.409s │ 31.03 │ 34.41% │ 1.098m
Random TSP instances, 500 verticesCARSS (500, 20)Time46.409sTraveling Salesperson · split: test · agents=20 · decoding=greedy · vertices=500 · training-vertices=500
Source quote
L420: CARSS (500, 20) │ 8.13 │ 5.08% │ 33.401s │ 12.17 │ 13.61% │ 36.003s │ 20.58 │ 24.35% │ 46.409s │ 31.03 │ 34.41% │ 1.098m
Random TSP instances, 1000 verticesCARSS (500, 20)Obj.31.03Traveling Salesperson · split: test · agents=20 · decoding=greedy · vertices=1000 · training-vertices=500
Source quote
L420: CARSS (500, 20) │ 8.13 │ 5.08% │ 33.401s │ 12.17 │ 13.61% │ 36.003s │ 20.58 │ 24.35% │ 46.409s │ 31.03 │ 34.41% │ 1.098m
Random TSP instances, 1000 verticesCARSS (500, 20)Gap34.41%Traveling Salesperson · split: test · agents=20 · decoding=greedy · vertices=1000 · training-vertices=500
Source quote
L420: CARSS (500, 20) │ 8.13 │ 5.08% │ 33.401s │ 12.17 │ 13.61% │ 36.003s │ 20.58 │ 24.35% │ 46.409s │ 31.03 │ 34.41% │ 1.098m
Random TSP instances, 1000 verticesCARSS (500, 20)Time1.098mTraveling Salesperson · split: test · agents=20 · decoding=greedy · vertices=1000 · training-vertices=500
Source quote
L420: CARSS (500, 20) │ 8.13 │ 5.08% │ 33.401s │ 12.17 │ 13.61% │ 36.003s │ 20.58 │ 24.35% │ 46.409s │ 31.03 │ 34.41% │ 1.098m
BibTeX
@misc{shi2023carss,
  author = {Yuchen Shi and Congying Han and Tiande Guo},
  title = {{CARSS: Cooperative Attention-guided Reinforcement Subpath Synthesis for Solving Traveling Salesman Problem}},
  year = {2023},
  eprint = {2312.15412},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.15412},
}
Figure