Next Article in Journal
Time-Weighted Result-Based Strength Indicators from Head-to-Head Outcomes: An Application to Trotter (Harness) Racing
Previous Article in Journal
Hyperbolic ∗-Ricci Solitons and Gradient Hyperbolic ∗-Ricci Solitons on (ε)-Almost Contact Metric Manifolds of Type (α, β)
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Dynamic Topology-Aware Linear Attention Network for Efficient Traveling Salesman Problem Optimization

School of Electrical and Electronic Engineering, Shanghai University of Engineering Science, 333 Longteng Road, Shanghai 201620, China
*
Author to whom correspondence should be addressed.
Mathematics 2026, 14(1), 166; https://doi.org/10.3390/math14010166 (registering DOI)
Submission received: 5 November 2025 / Revised: 4 December 2025 / Accepted: 5 December 2025 / Published: 1 January 2026

Abstract

The Traveling Salesman Problem (TSP) is a classic combinatorial optimization problem with broad applications in logistics and smart agriculture. However, despite significant progress in Transformer-based deep reinforcement learning methods, two major challenges remain. First, standard linear embedding layers struggle to capture dynamic local geometric relationships between nodes. Second, the quadratic complexity of self-attention in the decoder hinders efficiency in large-scale TSP instances. To address these issues, this paper proposes a Dynamic Topology-Aware Linear Attention Network (DTALAN). The encoder employs a Channel-aware Topological Refinement Graph Convolution (CTRGC) module to model local geometric structures and a Global Attention Mechanism (GAM) for adaptive feature recalibration. The decoder introduces a temporal locality-aware attention mechanism that focuses only on recently visited nodes, reducing self-attention complexity from quadratic to linear while preserving solution quality. The policy network is trained using the REINFORCE algorithm with baseline and the Adam optimizer. Experiments on random instances and the TSPLIB benchmark show that DTALAN outperforms leading deep reinforcement learning methods in both optimality gap and inference efficiency. For TSP100, it achieves an optimality gap of 0.55%, producing near-optimal solutions. Ablation studies confirm that both the improved CTRGC and enhanced GAM modules are essential to these results.

1. Introduction

The Traveling Salesman Problem (TSP) is a classic challenge in combinatorial optimization [1]. It aims to find the shortest closed route that allows a salesman to visit each city in a given set exactly once, starting and ending at the same location. Many real-world problems can be modeled as variations of TSP. Beyond its theoretical significance in computer science, TSP has practical applications in logistics planning [2], drilling path optimization for circuit boards [3], and warehouse order picking [4]. However, as an NP-hard problem, TSP’s computational complexity grows exponentially with the number of cities [5]. This poses significant challenges for exact solution methods and real-world applications involving large-scale instances.
Traditional approaches to solving TSP can be categorized into two categories [6]: exact algorithms and heuristic algorithms. Exact algorithms (e.g., Concorde [7]) employ branch-and-bound or integer linear programming to obtain optimal solutions for small-scale problems. However, their computational and memory costs grow exponentially with problem size, making them difficult to scale. Metaheuristic algorithms (e.g., genetic algorithms, ant colony optimization, and the Lin-Kernighan-Helsgaun (LKH-3) [8]) generate approximate solutions through iterative optimization. While efficient, their performance relies on manually crafted rules, often leading to suboptimal local solutions and limited adaptability to dynamic environments.
Recent advances in artificial intelligence have enabled novel approaches to combinatorial optimization through the integration of deep learning (DL) and reinforcement learning (RL) [9]. DL models such as graph neural network and Transformer autonomously extract features to generate high-quality approximate solutions, eliminating reliance on manually designed heuristic rules. When combined with RL’s trial-and-error policy optimization framework, these methods form deep reinforcement learning (DRL), which demonstrates enhanced adaptability and generalization in solving TSP [10].
DRL-based TSP solvers are generally categorized into two categories [11]: search-based DRL algorithms and end-to-end DRL algorithms. End-to-end DRL constructs complete routes through iterative selection of unvisited nodes, while search-based DRL refines existing solutions through optimization. Although search-based methods yield higher-quality solutions, their computational demands grow substantially with iteration counts and search depth, limiting real-time applicability. Current end-to-end DRL approaches face challenges in large-scale TSP instances, where insufficient extraction of critical node features leads to decision biases, and underutilized model potential during inference constrains solution quality [12].
Recent studies highlight Transformer models’ strong performance in combinatorial optimization, but existing Transformer-based end-to-end approaches face two critical limitations: insufficient local topology modeling and excessive computational demands [13]. The linear embedding layers in standard Transformers struggle to dynamically capture local geometric dependencies between nodes, resulting in reduced sensitivity to neighboring nodes during path planning. Additionally, the fully connected self-attention mechanism creates computational bottlenecks for large-scale instances, where training time and memory requirements grow quadratically with the number of cities.
To address these challenges, the Dynamic Topology-Aware Linear Attention Network (DTALAN), an encoder–decoder architecture, is proposed [14]. The encoder employs a dynamically weighted aggregation layer to map city coordinates into a high-dimensional space, explicitly capturing local geometric dependencies between nodes. Adaptive relational matrices enhance spatial topology representations of neighboring nodes. A multi-level residual attention fusion module further integrates global path constraints with a multi-head self-attention mechanism and a combined channel-spatial weighting strategy, enabling efficient selection of critical local features and multi-scale information aggregation. The decoder features a temporal locality-aware attention mechanism that focuses only on recently visited nodes. This design reduces the complexity of self-attention from quadratic to linear in terms of the number of visited nodes, while maintaining the ability to capture essential path dependencies. A masking strategy prevents nodes from being revisited, further improving computational efficiency. This innovation significantly reduces memory and computational bottlenecks in large-scale TSP instances. A masking strategy eliminates redundant interactions, reducing the complexity of traditional self-attention from quadratic to linear. This innovation substantially alleviates memory and computational bottlenecks in large-scale instances. During training, this study adopts a baseline-optimized policy gradient algorithm with adaptive learning rates and gradient clipping to balance exploration and exploitation. The primary contributions of this work are as follows:
  • A dynamic topology-aware encoder for TSP is introduced, which uniquely integrates a Channel-aware Topological Refinement Graph Convolution (CTRGC) with a Global Attention Mechanism (GAM). The CTRGC module captures dynamic local geometric structures between nodes via k-NN-based graph attention, addressing the standard Transformer’s weakness in local structure modeling. Concurrently, the GAM module adaptively recalibrates feature dimensions through channel-wise weighting, enhancing the representation of multi-scale path dependencies.
  • To address TSP-specific challenges, a lightweight decoder featuring temporal locality-aware attention is proposed. By focusing attention only on the most recently visited nodes rather than the entire history, this design reduces the self-attention complexity from quadratic to linear levels. It effectively alleviates memory and computational bottlenecks for large-scale TSP instances while maintaining solution quality comparable to theoretical optima.
  • During experiments, the trained model was evaluated not only on random instances but also on public real-world datasets with different distributions and on larger problem sizes. The results demonstrate that the proposed model can effectively solve real-world instances without retraining, confirming its strong generalization capability.
The remainder of this paper is structured as follows. Section 2 reviews related work, covering both traditional exact/heuristic algorithms and modern end-to-end deep reinforcement learning methods for solving the TSP. Section 3 provides a detailed exposition of the proposed DTALAN framework. The problem is first formalized as a Markov Decision Process. This is followed by a comprehensive description of the network architecture, which includes the topology-aware encoder integrating the CTRGC and GAM modules and the decoder with linear complexity. The training strategy based on the REINFORCE algorithm is also explained. Section 4 presents the experimental setup and results. It introduces the datasets, implementation details, and evaluation metrics. A comparative analysis against state-of-the-art methods is then provided on both synthetic datasets and the TSPLIB benchmark, complemented by ablation studies that verify the contribution of key components. Finally, Section 5 concludes the paper by summarizing the principal findings and contributions and suggesting potential directions for future research.

2. Related Work

2.1. Traditional Algorithm

Exact algorithms like Concorde [7] formulate TSP as mixed-integer programming problems and employ branch-and-bound strategies for global optimal solutions. However, their computational complexity grows exponentially with problem size, limiting practical application to small and medium-scale instances. To balance efficiency and solution quality, researchers have developed various heuristic algorithms. The Lin-Kernighan-Helsgaun (LKH-3) algorithm [8], for instance, progressively approaches global optima through iterative local improvements like edge exchanges and path deformation, demonstrating strong performance on medium-scale problems. The classical 2-OPT algorithm [15] reduces total cost by swapping pairs of edges in the path. While its simplicity ensures efficiency for small instances, it becomes prone to local optima and escalating computational demands as problem size increases. Christofides algorithm [16], a polynomial-time approximation approach, constructs solutions through minimum spanning trees and minimum-weight perfect matching, guaranteeing paths within 1.5 times the optimal length [6]. Despite this theoretical bound, its practical performance on large-scale problems typically underperforms modern heuristic methods. Insertion heuristics like Farthest Insertion [17] (prioritizing distant nodes) and Cheapest Insertion [18] (selecting minimal incremental cost nodes) demonstrate competitive performance for TSP. However, both suffer from high computational complexity, particularly in large-scale instances where solution time increases substantially. The Nearest Neighbor algorithm [19] adopts a greedy strategy by sequentially visiting the closest unvisited node. Although computationally efficient, it frequently generates suboptimal paths, particularly in cases of non-uniform node distribution. Despite their prevalence in practical applications, these heuristic methods face significant challenges when handling large-scale or complex instances due to inherent time complexity and scalability limitations.

2.2. End-to-End DRL Algorithms

Beyond traditional approaches, deep learning and reinforcement learning have gained prominence in solving TSP, particularly for large-scale instances and efficiency improvements. End-to-end methods process inputs to outputs through a unified model without explicit decomposition into discrete steps. In deep learning, end-to-end DRL approaches for combinatorial optimization are categorized into three architectural categories [20]: pointer network-based methods, Transformer-based methods, and graph neural network-based methods.
Pointer Network-based methods: Pioneered by Vinyals et al. [21], pointer network introduced a sequence-to-sequence (Seq2Seq) architecture with attention mechanisms to address dynamic output size limitations in traditional models. These networks demonstrated effectiveness in geometric optimization tasks (e.g., convex hulls, Delaunay triangulation, and planar TSP). However, their reliance on supervised learning required extensive labeled data and exhibited limited generalization to large-scale problems. Bello et al. [22] enhanced this framework by integrating reinforcement learning (RL), using policy gradients to optimize parameters without fixed labels. This approach achieved superior approximate solutions for TSP and knapsack problems while improving model flexibility and performance. Nazari et al. [23] extended pointer networks to vehicle routing problems (VRP). By replacing RNN encoders with 1D convolutional layers, they reduced computational complexity and enabled real-time near-optimal solutions for dynamic demand scenarios, overcoming earlier limitations in dynamic systems.
Transformer-based methods: Transformer have been widely adopted for TSP due to their representational power and self-attention mechanisms. Deudon et al. [24] first applied Transformers to TSP using RL and 2-OPT local search, revealing their potential despite computational overhead in large-scale instances. Kool et al. [25] advanced this by combining self-attention with REINFORCE and greedy decoding, improving training efficiency for path planning. However, these models struggled with solution diversity and stability in symmetric problem configurations. Kwon et al. [26] addressed symmetry issues with Policy Optimization with Multiple Optima (POMO), leveraging solution symmetries to reduce gradient variance. POMO enhanced training stability and solution quality via multi-start greedy search, advancing Transformer performance in complex routing tasks.
As problem scales increased, computational bottlenecks emerged. Bresson et al. [14] (2021) refined decoder design by integrating partial path information with global graph representations and beam search, improving inference accuracy but retaining complexity challenges. Pan et al. [27] introduced H-TSP, a hierarchical RL framework that decomposes large-scale problems into subproblems, scaling to 10,000 node instances with reduced time complexity while preserving solution quality. Lischka et al. [28] optimized Transformer attention via graph sparsification, combining attention masks with adjacency matrices to reduce global graph dependency and enhance sparse graph performance. Luo et al. [29] (2024) proposed a Lightweight Encoder-Heavy Decoder (LEHD) structure, simplifying encoders while dynamically capturing node relationships during decoding. Their Random Re-Construct strategy reduced training data demands and improved solution quality.
Graph Neural Network-based methods: GNN have emerged as natural tools for combinatorial optimization due to their graph-structured data processing capabilities. Dai et al. [30] developed Structure2Vec, using Q-learning to greedily construct TSP solutions, but its weak generalization and reliance on local search constrained efficiency. Ma et al. [31] incorporated graph embeddings into a Graph Pointer Network with hierarchical RL for constrained TSP, enabling scalability from small to large instances, though model complexity and constraint stability remained challenges. Drori et al. [32] unified GAT-based GNNs with RL decoders, achieving linear time complexity across graph optimization tasks while maintaining solution quality. However, their performance on real-world complex graphs required further enhancement. Lei et al. [33] designed Residual E-GAT, integrating edge features and residual connections to mitigate gradient vanishing in deep GATs. Combined with PPO and modified REINFORCE, this framework improved generalization for TSP and CVRP. Ouyang et al. [34] enhanced generalization via equivariance and local search in their eMAGIC framework, which stabilized training and improved solution quality across small- to large-scale graphs.
While existing methods have achieved notable progress in specific scenarios, persistent limitations in local topology modeling and high computational complexity remain. To address these challenges, this study proposes DTALAN, which builds upon the encoder–decoder architecture from prior work [14]. Inspired by CTRGC and GAM, the encoder incorporates a local geometric enhancement module that dynamically captures spatial dependencies between neighboring nodes through k-NN graph attention and adaptively recalibrates feature channels. To overcome the quadratic computational complexity bottleneck of traditional Transformer self-attention in the decoder, we design a temporal locality-aware attention mechanism that focuses only on the most recently visited nodes. This design reduces the self-attention complexity from quadratic to linear in the number of visited nodes, significantly reducing memory consumption while preserving path generation quality.

3. Method

3.1. Problem Definition

The Traveling Salesman Problem (TSP) is a classic combinatorial optimization challenge. Given a set of cities and pairwise distances, the objective is to find the shortest closed route that visits each city exactly once and returns to the starting point, minimizing total travel distance.
This work focuses on the two-dimensional Euclidean TSP. Let G V , E denote an undirected complete graph where V = { v 1 , v 2 , , v N } represents N cities, and E = { e i , j 1 i , j N } comprises all edges. Each edge e i , j carries a non-negative weight d i , j , corresponding to the Euclidean distance between cities v i and v j . The goal is to find a Hamiltonian circuit—a closed path visiting each city once—with minimal total distance.
J π s = | | x π n x π 1 | | 2 + i = 1 n 1 | | x π i + 1 x π i | | 2
Here, π denotes a permutation of cities representing the salesman’s route. The position of city π i is given by x π i , and | | 2 refers to the Euclidean ( L 2 ) norm. The total path length J π s comprises two components: the return distance from the last city to the origin | x π n x π 1 | 2 , and the sum of distances between consecutive cities i = 1 n 1 | x π i + 1 x π i | 2 . We formulate the TSP solution process as a Markov Decision Process (MDP), defined by the following key components:
State: At decoding step   t , the state   s t   comprises the current partial tour π < t = π 1 , π 2 , . . . , π t 1 , the initial coordinates and embedding features of all cities, and the set of unvisited cities.
Action: The action   a t   is the selection of the next city to visit π t from the set of unvisited cities.
Reward: Upon completing an entire tour π , the agent receives a reward signal equal to the negative of the total tour length, R π = L π . Maximizing the expected cumulative reward is thus equivalent to minimizing the total path length.
A stochastic policy p θ π | s , parameterized by θ , is employed. This policy defines a probability distribution over all possible tours π for a given problem instance s . This distribution is factorized via the chain rule into a sequence of conditional probabilities:
p θ π s = i = 1 n p θ π i π < i , s
Here, p θ π t | π < t , s represents the probability of selecting city π < t at the t step, conditioned on the partial tour π t and the complete state s .

3.2. Network Architecture

This study proposes a deep learning model based on an encoder–decoder architecture for efficient TSP solving (as shown in Figure 1). By integrating local geometric relationships with global path dependencies through a hybrid attention mechanism, the model achieves high-precision route planning with reduced computational complexity.
The encoder employs a multi-stage attention mechanism where CTRGC [35] dynamically captures local spatial dependencies between neighboring cities through k-NN-based graph attention, enhancing initial embedding features. Subsequently, stacked global attention modules alternate between Multi-Head Attention (MHA), Feed-Forward Networks (FF), and GAM [36] to capture complex inter-node dependencies, with GAM adapted as a channel-wise feature recalibration module for node embeddings. Residual connections and layer normalization ensure training stability, while a graph aggregation layer generates compact global path representations. The decoder incorporates a local self-attention mechanism [37] that focuses only on the most recently visited nodes, reducing the self-attention complexity from quadratic to linear in the number of visited nodes, thereby enabling efficient large-scale problem solving. A context-aware node selection strategy combined with dynamic masking prevents node revisitation, progressively constructing optimal paths.
During training, this study optimizes the policy network using a baseline-augmented REINFORCE algorithm with gradient clipping to reduce variance and accelerate convergence. The model architecture is illustrated in Figure 2, with detailed component descriptions provided below.

3.2.1. Encoder

The encoder transforms input city data into high-dimensional embeddings to support optimal path generation by the decoder. Building on the TSP Transformer [14], the encoder comprises three components: an enhanced embedding layer, N identical global-attention-integrated attention layers, and a graph aggregation layer. The enhanced embedding layer projects 2D city coordinates into high-dimensional space via linear mapping. A CTRGC module then captures local geometric relationships between nodes using dynamic relational matrices, strengthening neighborhood dependencies for precise path planning. Each global-attention-integrated layer contains three sublayers: Multi-Head Attention (MHA), Feed-Forward Network (FF) [13], and GAM. Residual connections and layer normalization follow each sublayer to mitigate gradient vanishing and stabilize training. The MHA sublayer employs parallel attention heads to model global dependencies. The FF sublayer enhances nonlinear representations through two fully connected layers with ReLU activation. The GAM sublayer adaptively weights channel and spatial features to refine node embeddings, improving critical feature extraction for TSP. The graph aggregation layer generates global path representations via average pooling of all node embeddings, ensuring comprehensive consideration of city relationships during path generation.
Enhanced Embedding Layer: Nodes represent cities, with edges denoting inter-city paths. To embed coordinates into high-dimensional space, we first linearly project 2D coordinates x i , y i to d e m b e d features:
h i 0   =   W embed x i +   b embed
where x i = x i , y i denotes city i’s coordinates, with W e m b e d and b e m b e d as learnable parameters. However, such independent linear embeddings fail to capture the spatial dependencies between cities. To enhance local geometric awareness, this study introduces CTRGC module and adapt it for the TSP, focusing on capturing local spatial relationships between cities.
First, a k-nearest neighbor (k-NN) local neighborhood N k i is constructed for each city based on the Euclidean distance between coordinates. Then, local relational weights between nodes are computed via a dynamic attention mechanism:
e i j = L e a k y R e L U a T W q h i 0 W k h j 0 , j N k i
α i j = e x p e i j j N k i e x p e i j
Here, W q , W k R d e m b e d × d e m b e d are learnable weight matrices, a R 2 d e m b e d is a learnable vector, and denotes the concatenation operation. The attention weights for nodes outside the neighborhood are set to zero, i.e., α i j = 0 when j N k i .
Finally, an enhanced node embedding is obtained by aggregating the neighbor features with the computed weights:
h i C T R G C = σ j N k i α i j W v h j 0
where W v R d e m b e d × d e m b e d is a learnable weight matrix and σ is a nonlinear activation function.
Global-Attention-Integrated Layers: The CTRGC-processed features h i c t r g c pass through n stacked layers, each containing MHA, FF, and feature selection sublayers to capture global dependencies and nonlinear patterns. For the MHA sublayer, queries q i , keys k i , and values v i derive from:
q i = W Q h i l 1 , k i = W K h i l 1 , v i = W V h i l 1
where W Q ,   W K ,   W V     R d k   ×   d embed are learnable matrices, d k   = d embed M (M = 8). Scaled dot-product attention weights are computed as:
u ij = q i k j d k , a ij = exp u ij j = 1 N exp u ij
Node embeddings update via weighted aggregation:
h i l = j = 1 N a i j v j
Multi-head outputs concatenate results from M parallel heads:
h i M H A = m = 1 M W O m h i m
where h i m is the m-th head’s output, and W O m linearly combines head results. MHA thus enables nodes to encode both local geometric and global path dependencies. The FF sublayer refines nonlinear features via:
h i h i d d e n = R e L U W f f , 0 h i l + b f f , 0
h i l = W f f , 1 h i h i d d e n + b f f , 1
The FF sublayer captures complex path relationships through nonlinear transformations. Residual connections and layer normalization stabilize training:
h i l = N o r m h i l 1 + h i M H A
h i l = N o r m h i l + h i F F
To further enhance feature representation, we introduce GAM module. Unlike the original GAM, this study adapts it as a feature recalibration module suitable for node embeddings. This module employs a channel attention mechanism to adaptively adjust the importance of different feature dimensions. First, the global statistics of the node features are computed:
z = 1 N i = 1 N b h i F F , n o r m
A channel-weight vector is then generated via a two-layer fully connected network and a Sigmoid function:
w = σ W 2 δ W 1 z
Here, W 1 R d e m b e d / r × d e m b e d and W 2 R d e m b e d × d e m b e d / r are learnable weight matrices, δ denotes the ReLU activation function, r is the reduction ratio, and σ represents the Sigmoid function.
Finally, channel-wise reweighting is applied to the node features:
h i l = h i F F , n o r m w
where denotes element-wise multiplication. The GAM module enhances representational efficiency by emphasizing feature dimensions critical for path planning while suppressing less relevant ones.
Graph Aggregation Layer: After N attention layers, node embeddings h i n containing global-local features are aggregated via average pooling:
h g r a p h = 1 N i = 1 N h i n

3.2.2. Decoder

The decoder generates an optimal TSP tour sequence through an autoregressive process, utilizing features from the encoder. Inspired by predecessors, we observe a strong temporal locality in TSP path planning: the selection of the next node is predominantly influenced by the most recently visited nodes, rather than the entire history. Based on this insight, we designed an efficient decoder with a local attention mechanism.
At each timestep t , the decoder selects the next node π t based on partial path π 1 : t 1 = π 1 , π 2 , , π t 1 , where π 1 denotes the starting node and π t 1 the last selected node. The context vector x context combines graph embedding H g with node embeddings: for t = 1 , null placeholders e n u l l are used; for t > 1 , current and previous node embeddings are concatenated:
x c o n t e x t = C o n c a t h g r a p h , e s t a r t , e l a s t , t = 1 C o n c a t h g r a p h , h π 1 , h π t 1 , t > 1
A standard Transformer decoder calculates self-attention over all previously visited nodes, requiring full connectivity among t 1 nodes with O t 2 complexity. Noting that the current decision in TSP planning is primarily influenced by the last m visited nodes, we introduce a local self-attention mechanism. This mechanism operates on a local history window:
H t l o c a l = h π m a x 1 , t m , h π m a x 1 , t m + 1 , , h π t 1 R m × d e m b e d
where the window size m is a constant much smaller than n .
The current decoding state h t , derived from the query vector q t = W q x context , interacts with this local history via attention:
h t l o c a l = L a y e r N o r m h t + M H A q t , H t l o c a l , H t l o c a l
where m is a fixed constant independent of the step t .
The locally enhanced query vector h t l o c a l is then used in a cross-attention operation with all node embeddings from the encoder to assess the relevance of each unvisited node:
q t g l o b a l = W q h t l o c a l , k j = W k e j L , v j = W v e j L
Node relevance scores u cj are computed via scaled dot-product attention with masking:
u c j =   C t a n h q t g l o b a l k j d k , i f   j   n o t   i n   r o u t e , o t h e r w i s e
where C is a constant used to control the range of similarity output, based on the work of Bello et al. [22], the tanh activation function is used to truncate this coefficient within C , C (selected in this paper C   =   10 ). A Softmax layer then generates node selection probabilities:
p i   =   p θ π t =   j s , π 1 , π 2 , , π t 1   =   e u c j j e u c j
The decoder iteratively selects nodes using greedy or beam search strategies until all cities are visited.

3.3. Training Method

Training deep neural networks for TSP typically employs supervised or reinforcement learning paradigms. Supervised approaches require extensive labeled optimal paths, demanding significant time and computational resources while being inherently constrained by label quality. Therefore, this study adopts reinforcement learning to optimize model parameters, specifically implementing the REINFORCE algorithm with baseline [25]. This approach enables continuous improvement of route length minimization L π without dependency on precomputed labels.
The model treats path length as a negative reward signal, with the loss function defined as the expected tour length: J θ s = E P θ π s L π . Training minimizes this expectation for each input instance. Policy gradient updates refine model parameters iteratively. The Adam optimizer [38] implements gradient-based optimization with adaptive learning rates, following the gradient expression:
J θ s = E p θ π s L π b s log p θ π s
where b s denotes the baseline model’s predicted path length, p θ π s represents the policy’s path probability distribution, and θ contains trainable parameters. Gradient updates based on path length feedback progressively refine routing strategies to minimize total distance. The complete training procedure is detailed in Algorithm 1.
Algorithm 1 Reinforce Learning Algorithm for TSP
Input: Instance S , number of epochs E , batch size N
Output: Trained parameters θ
1: init  θ , θ v
2: for   epochs   = 1 , , E   do
3:   s i SampleInstance S , i { 1 , , N }
4:   L π i , π i p θ π | s i , i { 1 , , N }
5:   b s i baseline   prediction   for   s i , i { 1 , , N }
6:   θ J θ | s 1 N i = 1 N L π i b s i l o g p θ π i | s i
7:   θ Adam θ , θ J θ | s
8:   J v 1 N i = 1 N b s i L π i 2
9:   θ v Adam θ v , θ v J v
10: End for

4. Experimentation

4.1. Experimental Data

This study evaluates model performance using both synthetic and TSPLIB [39] benchmark datasets. The synthetic dataset contains 10,000 test instances with city coordinates uniformly sampled from the [0, 1]2 range, covering three problem scales: TSP20, TSP50, and TSP100. Algorithm performance is comprehensively assessed through optimality gap (vs. Concorde’s exact solutions) and computation time.
The TSPLIB dataset, established by Gerhard Reinelt in 1991, provides standardized benchmarks ranging from tens to tens of thousands of nodes across diverse spatial distributions. Nodes are defined by 2D coordinates with edge weights calculated through distance matrices. We normalize all TSPLIB instances to the [0, 1]2 range to ensure model input compatibility. This standardized version enables rigorous evaluation of real-world performance and facilitates cross-method comparisons of generalization capability and robustness. To ensure fair comparisons across datasets, a standardized preprocessing pipeline was applied to all input data. The procedure consists of the following steps:
Data Normalization: For TSPLIB instances, whose original coordinates fall outside the [0, 1]2 range, min-max normalization was applied to map all coordinates into the unit square:
X n o r m = X r a w m i n X r a w m a x X r a w m i n X r a w
where x r a w is the original coordinate matrix and x n o r m is the normalized coordinate matrix.
Model Inference: The normalized coordinates served as the direct input to the model for tour inference.
Tour Length Calculation: The predicted tour sequence was used to calculate the total path length by first denormalizing the coordinates back to their original spatial scale.
Performance Comparison: The final tour length, computed on the denormalized coordinates, was compared against the results from the Concorde solver and other baseline methods within the same original coordinate space, ensuring an equitable assessment. This standardized TSPLIB framework was thus used to validate real-world performance and to enable a comparative analysis of the generalization and robustness of different algorithms.
For randomly generated datasets, whose coordinates are natively within the [0, 1]2 range, no additional normalization was required.

4.2. Hyperparameter Settings

All experiments were conducted on an NVIDIA GeForce 3090 GPU (a product of NVIDIA Corporation, headquartered in Santa Clara, CA, USA). The model was implemented using Python 3.8 with the PyTorch 1.13.0 framework, leveraging CUDA for acceleration. Following the methodologies of Kool et al. [25] and Bresson et al. [14], the model was trained in an end-to-end manner. The Adam optimizer was employed with a learning rate of 0.0001, a batch size of 512, and the training process was run for 100 epochs. The model architecture comprises six encoder layers (N = 6), each integrating a multi-head attention mechanism and a feedforward neural network (FFN). A preliminary sensitivity analysis was performed on the TSP20 dataset to validate key parameter choices. The results indicated that model performance remained relatively stable when the embedding dimension varied within the range [64, 256]. Furthermore, varying the number of attention heads from 4 to 16 showed that 8 heads provided a favorable balance between performance and computational cost. The input embedding dimension ( d e m b ) and hidden layer dimension ( d h ) were both set to 128 to balance model expressiveness and computational efficiency. The embedding layer projects node coordinates into a high-dimensional space, while subsequent hidden layers refine feature extraction. The FFN’s hidden dimension was expanded to 512 ( d f f = 512) to enhance nonlinear feature representation. Eight parallel attention heads (M = 8) were implemented to capture multi-subspace relationships, enabling nuanced analysis of node interactions. Training employed an exponential moving average baseline with a decay rate (β) of 0.8 to reduce variance and accelerate convergence, coupled with gradient clipping (threshold = 1.0) to prevent gradient explosions. The Adam optimizer was configured with a learning rate of 0.0001 and a batch size of 512. The model underwent 100 training epochs, with extended training cycles showing potential for further performance gains.

4.3. Evaluation Indicators

Three metrics were used to evaluate model performance: average tour length (Len.), optimality gap (Gap), and inference time (Time). The average tour length reflects solution quality. It was computed as the mean length across a fixed test set of 10,000 instances (Equation (21), with S = 10,000), where a smaller value indicates a better solution. The optimality gap quantifies the proximity to theoretical optimality. It measures the average percentage deviation of the algorithm’s solution from the exact solution obtained by the Concorde solver [39], calculated over the same set of 10,000 instances (Equation (22)). Inference time (Time) reports the average computation time per TSP instance (in seconds), serving as an indicator of computational efficiency.
The inference time serves as an indicator of computational efficiency, reporting the average time in seconds required to solve a single TSP instance. This time was measured using Python’s time() function, capturing the complete inference process from the start of the model’s forward pass until a full tour was obtained. Data loading and preprocessing overhead were excluded from this measurement.
A P L = 1 S i = 1 S L i
G a p = 1 S i = 1 S   L e n . a l g o r i t h m L e n . o p t i m a l L e n . o p t i m a l × 100 %

4.4. Results and Analysis

4.4.1. Random Dataset Experiments

To validate the proposed model, we trained and tested it on three randomly generated TSP datasets of varying scales. Comparative methods were categorized into two groups: classical algorithms (including the Concorde exact solver [39], nearest insertion, and farthest insertion) and deep learning approaches (supervised and reinforcement learning models from Bello et al. [22], Dai et al. [30], Deudon et al. [24], Kool et al. [25], Xu et al. [40], Joshi et al. [41], Bresson et al. [14], Jung et al. [42] and Zhang et al. [43]). As shown in Table 1, results for classical algorithms and the method were newly computed, while others were reproduced from original studies. Metrics include average tour length (“Len”), optimality gap relative to Concorde (“Gap”), and total computation time (“Time”), with missing data denoted by “-”.
During inference, we employed two standard decoding strategies: greedy decoding and beam search [41]. Greedy decoding enables efficient inference through stepwise optimal choices (low complexity, minimal memory usage), though its myopic decisions may compromise global optimization. In contrast, beam search maintains a beam width of B candidate sequences during decoding, enabling multi-step dependency analysis to improve solution quality. The beam width critically impacts performance: small values risk overlooking high-quality candidates, while large values exponentially increase computational demands. For fair comparison, we standardized the beam width at B = 2500 across experiments, balancing solution quality and computational efficiency according to established practices.
As shown in Table 1, under greedy decoding, the method achieves optimality gaps of 0.36%, 0.96%, and 2.64% for TSP20, TSP50, and TSP100, respectively. These results significantly outperform traditional heuristics (e.g., 21.82% for Nearest Insertion) and most reinforcement learning models (e.g., 5.21% for Deudon et al.). The performance advantage becomes more pronounced with increasing problem scale, attributable to two key innovations: The performance advantage becomes more pronounced with increasing problem scale, attributable to two key innovations: (1) the improved Channel-aware Topological Refinement Graph Convolution (CTRGC), which dynamically captures local geometric relationships through k-NN graph attention, and (2) the enhanced Global Attention Mechanism (GAM), which adaptively recalibrates feature dimensions through channel-wise weighting. With beam search (B = 2500), the model further approaches theoretical optimality, reducing the TSP100 optimality gap to 0.55%—surpassing results from Bresson et al. (1.26%) and Jung et al. (1.22%).
As shown in Table 2, the proposed model achieved average tour lengths of 3.84, 5.74, and 7.96 on the three problem scales, respectively. The half-widths of the 95% confidence intervals were all below 0.01, indicating a high degree of statistical significance in the results. The inference time analysis revealed optimal time efficiency for the TSP50 scale, at 0.172 s per instance. Leveraging parallel processing, all tests were completed within seconds.

4.4.2. TSPLIB Dataset Experiments

To evaluate generalization capability, this study tested the method on 10 real-world TSPLIB instances against three state-of-the-art deep reinforcement learning approaches. As shown in Table 3, the method achieves the lowest optimality gaps across six instances (berlin52, eil76, kroC100, eil101, ch130, and ch150). Notably, it attains a 0.03% gap on berlin52, closely approaching the Concorde solver’s optimal solution and outperforming Kool et al. (6.30%), Bresson et al. (1.26%), and Jung et al. (0.90%). This demonstrates the effectiveness of the CTRGC module, which employs dynamic relational matrices to model local geometric dependencies. For large-scale instances like ch150, the method achieves a 2.36% gap, substantially surpassing Kool et al. (10.94%) and Bresson et al. (13.20%).
Figure 3 summarizes the comparative performance: our method secures optimal solutions for 6 out of 10 instances, while Kool’s and Bresson’s approaches yield no optimal solutions, and Jung’s method achieves 4. For small-scale instances, solution quality matches both Concorde’s exact solutions and Jung’s method, while large-scale instances exhibit significant improvements over all deep learning baselines, confirming robust generalization. Visualizations of representative tours are provided in Figure 4. Red markers denote starting cities, with blue markers indicating other cities. The algorithm iteratively constructs tours by sequentially visiting cities along arrow directions, ultimately returning to the origin. Visualization examples include varying problem scales and corresponding tour lengths.
To validate the statistical significance of the results, the Friedman test—a non-parametric statistical test suitable for comparing the performance rankings of multiple algorithms across multiple problem instances—was conducted on the four methods. The test revealed a statistically significant difference in performance among the methods across the 10 TSP instances (Friedman χ 2 = 14.04, * p* < 0.01). As shown in Table 4, the proposed method achieved the best average rank (1.6), outperforming the baseline methods.

4.5. Ablation Experiment

To assess the contributions of the CTRGC and GAM, this study conducts ablation experiments on TSP100 using three model variants: Variant 1 (without CTRGC), Variant 2 (without GAM), and Variant 3 (lacking both components). As shown in Table 5 and Figure 5, the full model achieves the smallest optimality gap, confirming that CTRGC’s dynamic relational matrices are critical for modeling local geometric dependencies, while GAM’s joint channel-spatial weighting effectively integrates global features. Both components independently improve performance compared to Variant 3, demonstrating their complementary roles in solution quality enhancement.
To further quantify the individual contributions of the CTRGC and GAM components to performance improvement, a contribution analysis was conducted based on ablation study results. The analysis revealed that CTRGC alone contributed a 0.02% performance gain, while GAM alone contributed 0.05%. Notably, their synergistic effect contributed 0.16%, indicating that the two components exhibit complementary functions, with synergy playing the dominant role in the overall improvement.

5. Discussion and Conclusions

This study has several limitations. First, the model’s performance on certain TSPLIB instances (e.g., rd100) still lags behind some baseline methods, indicating a need to enhance its adaptability to irregular node distributions. Second, although the linear attention mechanism reduces complexity, its scalability to very large-scale problems (e.g., TSP500+) has not been fully validated. Third, the current model is designed specifically for the Euclidean TSP; its generalization to variants with non-Euclidean or dynamically weighted distances requires further investigation.
The proposed Dynamic Topology-Aware Linear Attention Network (DTALAN) demonstrates superior performance in Traveling Salesman Problem (TSP) optimization through synergistic integration of local geometric modeling and global feature refinement. Experimental results reveal strong generalization across both synthetic and real-world benchmarks, with DTALAN achieving significantly smaller optimality gaps than traditional heuristics and state-of-the-art deep reinforcement learning methods. This validates two core innovations: (1) the Channel-aware Topology-Refined Graph Convolution (CTRGC), which dynamically captures local geometric dependencies, and (2) the Global Attention Mechanism (GAM), enabling effective cross-feature integration. Ablation studies confirm the indispensable role of CTRGC-GAM synergy—removing either component degrades solution quality. The decoder’s linear attention mechanism reduces computational complexity for large-scale problems, enabling efficient real-time path planning.
Our future work will extend the framework to broader combinatorial optimization domains, including vehicle routing (CVRP) and capacitated TSP variants. We will further validate robustness in non-Euclidean scenarios such as 3D logistics networks and multi-objective optimization systems.

Author Contributions

Conceptualization, S.Z. and Q.D.; Methodology, S.Z.; Software, S.Z.; Validation, S.Z.; Formal analysis, Q.D.; Writing – original draft, Q.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

No potential conflicts of interest are reported by the authors.

References

  1. Halim, A.H.; Ismail, I. Combinatorial Optimization: Comparison of Heuristic Algorithms in Travelling Salesman Problem. Arch. Comput. Methods Eng. 2017, 26, 367–380. [Google Scholar] [CrossRef]
  2. Qian, W.-W.; Zhao, X.; Ji, K. Region Division in Logistics Distribution with a Two-Stage Optimization Algorithm. IEEE Access 2020, 8, 212876–212887. [Google Scholar] [CrossRef]
  3. Onwubolu, G.C.; Clerc, M. Optimal path for automated drilling operations by a new heuristic approach using particle swarm optimization. Int. J. Prod. Res. 2004, 42, 473–491. [Google Scholar] [CrossRef]
  4. Madani, A.; Batta, R.; Karwan, M. The balancing traveling salesman problem: Application to warehouse order picking. Top 2021, 29, 442–469. [Google Scholar] [CrossRef]
  5. Sanyal, S.; Roy, K. Neuro-Ising: Accelerating Large-Scale Traveling Salesman Problems via Graph Neural Network Guided Localized Ising Solvers. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 2022, 41, 5408–5420. [Google Scholar] [CrossRef]
  6. Melab, N.; Mezmaz, M. Multi and many-core computing for parallel metaheuristics. Concurr. Comput. Pract. Exp. 2017, 29, e4116. [Google Scholar] [CrossRef]
  7. Applegate, D.L.; Bixby, R.E.; Chvátal, V.; Cook, W.J. The Traveling Salesman Problem: A Computational Study. In The Traveling Salesman Problem; Princeton University Press: Princeton, NJ, USA, 2011. [Google Scholar]
  8. Chen, P.; Wang, Q. Learning for multiple purposes: A Q-learning enhanced hybrid metaheuristic for parallel drone scheduling traveling salesman problem. Comput. Ind. Eng. 2024, 187, 109851. [Google Scholar] [CrossRef]
  9. Helsgaun, K. An Extension of the Lin-Kernighan-Helsgaun TSP Solver for Constrained Traveling Salesman and Vehicle Routing Problems. Rosk. Rosk. Univ. 2017, 12, 966–980. [Google Scholar]
  10. Wang, X.; Wang, S.; Liang, X.; Zhao, D.; Huang, J.; Xu, X.; Dai, B.; Miao, Q. Deep Reinforcement Learning: A Survey. IEEE Trans. Neural Netw. Learn. Syst. 2024, 35, 5064–5078. [Google Scholar] [CrossRef]
  11. Ma, X.; Liu, C. A Travel Salesman Problem Solving Algorithm Based on Feature Enhanced Attention Model. J. Comput. 2024, 35, 215–230. [Google Scholar]
  12. Liu, C.; Feng, X.-F.; Li, F.; Xian, Q.-L.; Jia, Z.-H.; Wang, Y.-H.; Du, Z.-D. Deep reinforcement learning combined with transformer to solve the traveling salesman problem. J. Supercomput. 2024, 81, 161. [Google Scholar] [CrossRef]
  13. Vaswani, A.; Shazeer, N.M.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention is All you Need. In Proceedings of the Neural Information Processing Systems, Long Beach, CA, USA, 12 June 2017. [Google Scholar]
  14. Bresson, X.; Laurent, T. The Transformer Network for the Traveling Salesman Problem. arXiv 2021. [Google Scholar] [CrossRef]
  15. Okada, M.; Taji, K.; Fukushima, M. Probabilistic analysis of 2-opt for travelling salesman problems. Int. J. Syst. Sci. 1998, 29, 297–310. [Google Scholar] [CrossRef]
  16. Christofides, N. Worst-Case Analysis of a New Heuristic for the Travelling Salesman Problem. Oper. Res. Forum 2022, 3, 20. [Google Scholar] [CrossRef]
  17. Clarke, G.; Wright, J.W. Scheduling of Vehicles from a Central Depot to a Number of Delivery Points. Oper. Res. 1964, 12, 568–581. [Google Scholar] [CrossRef]
  18. Bellmore, M.; Nemhauser, G.L. The Traveling Salesman Problem: A Survey. Oper. Res. 1968, 16, 538–558. [Google Scholar] [CrossRef]
  19. Rosenkrantz, D.J.; Stearns, R.E.; Lewis, P.M., II. An Analysis of Several Heuristics for the Traveling Salesman Problem. SIAM J. Comput. 1977, 6, 563–581. [Google Scholar] [CrossRef]
  20. Sui, J.; Ding, S.; Huang, X.; Yu, Y.; Liu, R.; Xia, B.; Ding, Z.; Xu, L.; Zhang, H.; Yu, C.; et al. A survey on deep learning-based algorithms for the traveling salesman problem. Front. Comput. Sci. 2024, 19, 196322. [Google Scholar] [CrossRef]
  21. Vinyals, O.; Fortunato, M.; Jaitly, N. Pointer Networks. arXiv 2015. [Google Scholar] [CrossRef]
  22. Bello, I.; Pham, H.; Le, Q.V.; Norouzi, M.; Bengio, S. Neural Combinatorial Optimization with Reinforcement Learning. arXiv 2017. [Google Scholar] [CrossRef]
  23. Nazari, M.; Oroojlooy, A.; Snyder, L.; Takác, M. Reinforcement Learning for Solving the Vehicle Routing Problem. In Proceedings of the Neural Information Processing Systems, Montréal, QC, Canada, 12 February 2018. [Google Scholar]
  24. Deudon, M.; Cournut, P.; Lacoste, A.; Adulyasak, Y.; Rousseau, L.-M. Learning Heuristics for the TSP by Policy Gradient. In Integration of Constraint Programming, Artificial Intelligence, and Operations Research; Van Hoeve, W.-J., Ed.; Springer International Publishing: Cham, Switzerland, 2018; pp. 170–181. [Google Scholar]
  25. Kool, W.; Hoof, H.V.; Welling, M. Attention, Learn to Solve Routing Problems! In Proceedings of the International Conference on Learning Representations, Vancouver, BC, Canada, 22 March 2018. [Google Scholar]
  26. Kwon, Y.-D.; Choo, J.; Kim, B.; Yoon, I.; Gwon, Y.; Min, S. POMO: Policy Optimization with Multiple Optima for Reinforcement Learning. In Proceedings of the Advances in Neural Information Processing Systems 33 (NeurIPS 2020), Virtual, 30 October 2020. [Google Scholar]
  27. Pan, X.; Jin, Y.; Ding, Y.; Feng, M.; Zhao, L.; Song, L.; Bian, J. H-TSP: Hierarchically Solving the Large-Scale Travelling Salesman Problem. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI 2023), Washington, DC, USA, 7–14 February 2023. [Google Scholar]
  28. Lischka, A.; Wu, J.; Basso, R.; Chehreghani, M.H.; Kulcsár, B. Less is More—On the Importance of Sparsification for Transformers and Graph Neural Networks for TSP. arXiv 2024, arXiv:2403.17159. [Google Scholar]
  29. Luo, F.; Lin, X.; Liu, F.; Zhang, Q.; Wang, Z. Neural Combinatorial Optimization with Heavy Decoder: Toward Large Scale Generalization. In Proceedings of the Neural Information Processing Systems (NeurIPS) 2023, Main Conference Track, New Orleans, LA, USA, 10 December 2023. [Google Scholar]
  30. Khalil, E.B.; Dai, H.; Zhang, Y.; Dilkina, B.; Song, L. Learning Combinatorial Optimization Algorithms over Graphs. arXiv 2017, arXiv:1704.01665. [Google Scholar]
  31. Ma, Q.; Ge, S.; He, D.; Thaker, D.; Drori, I. Combinatorial Optimization by Graph Pointer Networks and Hierarchical Reinforcement Learning. arXiv 2019, arXiv:1911.04936. [Google Scholar]
  32. Drori, I.; Kharkar, A.; Sickinger, W.R.; Kates, B.; Ma, Q.; Ge, S.; Dolev, E.; Dietrich, B.; Williamson, D.P.; Udell, M. Learning to Solve Combinatorial Optimization Problems on Real-World Graphs in Linear Time. In Proceedings of the 2020 19th IEEE International Conference on Machine Learning and Applications (ICMLA), Miami, FL, USA, 14–17 December 2020; pp. 19–24. [Google Scholar]
  33. Lei, K.; Guo, P.; Wang, Y.; Wu, X.; Zhao, W. Solve routing problems with a residual edge-graph attention neural network. Neurocomputing 2022, 508, 79–98. [Google Scholar] [CrossRef]
  34. Ouyang, W.; Wang, Y.; Weng, P.; Han, S. Generalization in Deep RL for TSP Problems via Equivariance and Local Search. arXiv 2021, arXiv:2110.03595. [Google Scholar]
  35. Chen, Y.; Zhang, Z.; Yuan, C.; Li, B.; Deng, Y.; Hu, W. Channel-wise Topology Refinement Graph Convolution for Skeleton-Based Action Recognition. arXiv 2021, arXiv:2110.03595. [Google Scholar]
  36. Liu, Y.; Shao, Z.; Hoffmann, N. Global Attention Mechanism: Retain Information to Enhance Channel-Spatial Interactions. arXiv 2021, arXiv:2112.05561. [Google Scholar]
  37. Beltagy, I.; Peters, M.E.; Cohan, A. Longformer: The Long-Document Transformer. arXiv 2020. [Google Scholar] [CrossRef]
  38. Kingma, D.P.; Ba, J. Adam: A Method for Stochastic Optimization. arXiv 2017. [Google Scholar] [CrossRef]
  39. Reinelt, G. TSPLIB—A Traveling Salesman Problem Library. ORSA J. Comput. 1991, 3, 376–384. [Google Scholar] [CrossRef]
  40. Xu, Y.; Fang, M.; Chen, L.; Xu, G.; Du, Y.; Zhang, C. Reinforcement Learning with Multiple Relational Attention for Solving Vehicle Routing Problems. IEEE Trans. Cybern. 2022, 52, 11107–11120. [Google Scholar] [CrossRef]
  41. Joshi, C.K.; Cappart, Q.; Rousseau, L.-M.; Laurent, T. Learning TSP Requires Rethinking Generalization. In Proceedings of the 27th International Conference on Principles and Practice of Constraint Programming (CP 2021), Montpellier, France, 25–29 October 2021; Volume 2021, pp. 33:1–33:21. [Google Scholar]
  42. Jung, M.; Lee, J.; Kim, J. A lightweight CNN-transformer model for learning traveling salesman problems. Appl. Intell. 2024, 54, 7982–7993. [Google Scholar] [CrossRef]
  43. Zhang, R.; Prokhorchuk, A.; Dauwels, J. Deep Reinforcement Learning for Traveling Salesman Problem with Time Windows and Rejections. In Proceedings of the 2020 International Joint Conference on Neural Networks (IJCNN), Glasgow, UK, 19–24 July 2020; pp. 1–8. [Google Scholar]
Figure 1. Structure of the model.
Figure 1. Structure of the model.
Mathematics 14 00166 g001
Figure 2. Structure of encoder and decoder.
Figure 2. Structure of encoder and decoder.
Mathematics 14 00166 g002
Figure 3. The number of optimal solutions obtained by each algorithm [14,25,42].
Figure 3. The number of optimal solutions obtained by each algorithm [14,25,42].
Mathematics 14 00166 g003
Figure 4. Path length visualization. (The red dots represent the starting city, while the blue dots represent the other cities).
Figure 4. Path length visualization. (The red dots represent the starting city, while the blue dots represent the other cities).
Mathematics 14 00166 g004aMathematics 14 00166 g004b
Figure 5. Model training convergence plot.
Figure 5. Model training convergence plot.
Mathematics 14 00166 g005
Table 1. Comparison of results of different methods on randomized TSP dataset.
Table 1. Comparison of results of different methods on randomized TSP dataset.
MethodTypeTSP20TSP50TSP100
LenGapTimeLenGapTimeLenGapTime
ConcordeSolver3.830.00%18 s5.690.00%2 min7.760.00%3 min
NIH,G4.3312.91%1 s6.7819.03%2 s9.4621.82%6 s
RIH,G4.004.36%0 s6.137.65%1 s8.529.69%3 s
FIH,G3.932.36%1 s6.015.53%2 s8.357.59%7 s
NNH,G4.5017.23%0 s7.0022.94%0 s9.6824.73%0 s
Vinyals [21]SL,G3.881.15%-7.6634.48%----
Bello [22]RL,G3.891.42%-5.954.46%-8.306.90%-
Dai [30]RL,G3.891.42%-5.995.16%-8.317.03%-
Deudon [24]RL,G3.860.66%2 min5.923.98%5 min8.428.41%8 min
Deudon [24]RL,2-OPT3.850.42%4 min5.852.77%26 min8.175.21%3 h
Kool [25]RL,G3.850.34%0 s5.801.76%2 s8.124.53%6 s
Xu [40]RL,G3.840.26%0.37 s5.761.23%0.91 s8.053.74%2 s
Joshi [41]SL,G3.860.60%6 s5.873.10%55 s8.418.38%6 min
Bresson [14]RL,G3.891.57%0 s5.751.05%14 s8.013.22%19 s
Jung [42]RL,G3.840.25%0 s5.750.98%6 s8.003.00%12 s
OursRL,G3.840.36%2 s5.740.96%1 s7.962.64%4 s
Bello [22]RL,S---5.750.95%-8.003.03%-
Zhang [43]RL,S3.840.11%5 min5.771.28%17 min8.7512.70%56 min
Kool [25]RL,B3.840.08%5 min5.730.52%24 min7.942.26%1 h
Bresson [14]RL,B3.850.34%14 min5.750.97%44.8 min7.861.26%1.5 h
Jung [42]RL,B3.830.00%1.4 min5.720.46%26.2 min7.861.22%1.83 h
OursRL,B3.830.00%2 min5.720.67%11 min7.800.55%50 min
H: heuristic method; SL: supervised learning; RL: reinforcement learning; S: sample search; G: greedy search; B beam search; 2-OPT: 2-OPT local search.
Table 2. Average Cost and Time for the TSP (Mean and 95% Confidence Interval).
Table 2. Average Cost and Time for the TSP (Mean and 95% Confidence Interval).
ProblemAvg CostAvg Serial DurationAvg Parallel DurationTime
TSP203.84 ± 0.0060.214 ± 0.0090.00022 s
TSP505.74 ± 0.0050.172 ± 0.0030.00011 s
TSP1007.96 ± 0.0050.360 ± 0.0030.00044 s
Table 3. Comparative results on the real-world dataset TSPLIB.
Table 3. Comparative results on the real-world dataset TSPLIB.
ProblemConcordeKool et al. [25]Bresson et al. [14]Jung et al. [42]Ours
LenGapLenGapLenGapLenGap
eil514264393.05%4382.82%4290.70%4331.64%
berlin52754280176.30%76371.26%76100.90%75440.03%
st706756983.41%7105.19%6760.15%6892.07%
eil765385604.09%5655.02%5644.83%5502.23%
kroA10021,28223,0788.44%21,7472.18%21,6201.59%21,8242.55%
kroC10020,74921,5653.93%21,7885.01%21,5233.73%21,4493.37%
rd100791084416.71%80782.12%80441.69%83485.54%
eil1016296655.72%6818.27%6686.20%6625.25%
ch130611065497.18%65697.51%65527.23%62081.60%
ch1506528724210.94%739013.20%70508.00%66822.36%
Table 4. Ranking Results by Different Methods.
Table 4. Ranking Results by Different Methods.
ProblemKool [25]Bresson [14]Jung [42]Ours
eil514312
berlin524321
st703412
eil762431
kroA1004213
kroC1003421
rd1004213
eil1012431
ch1302431
ch1503421
Table 5. Ablation experiments on key parts of the model.
Table 5. Ablation experiments on key parts of the model.
ModelLenGap
Variant 17.8170.73%
Variant 27.8190.76%
Variant 37.8210.78%
Ours7.8030.55%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhao, S.; Duan, Q. Dynamic Topology-Aware Linear Attention Network for Efficient Traveling Salesman Problem Optimization. Mathematics 2026, 14, 166. https://doi.org/10.3390/math14010166

AMA Style

Zhao S, Duan Q. Dynamic Topology-Aware Linear Attention Network for Efficient Traveling Salesman Problem Optimization. Mathematics. 2026; 14(1):166. https://doi.org/10.3390/math14010166

Chicago/Turabian Style

Zhao, Shilong, and Qianqian Duan. 2026. "Dynamic Topology-Aware Linear Attention Network for Efficient Traveling Salesman Problem Optimization" Mathematics 14, no. 1: 166. https://doi.org/10.3390/math14010166

APA Style

Zhao, S., & Duan, Q. (2026). Dynamic Topology-Aware Linear Attention Network for Efficient Traveling Salesman Problem Optimization. Mathematics, 14(1), 166. https://doi.org/10.3390/math14010166

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Article metric data becomes available approximately 24 hours after publication online.
Back to TopTop