Introduction
The Traveling Salesman Problem (TSP) is a fundamental challenge in combinatorial optimization, requiring the identification of the shortest possible route that visits a set of cities exactly once and returns to the origin. While exact solvers like Concorde provide optimal solutions, their computational complexity becomes prohibitive as the number of nodes increases. Deep Reinforcement Learning (DRL) has emerged as a promising alternative, offering the potential to learn heuristics that generate near-optimal solutions in near-instantaneous time.
However, existing end-to-end DRL models—which produce a solution in a single forward pass—have historically struggled with scalability, often hitting a "wall" at approximately 100 nodes due to exponential increases in memory and computational requirements. Conversely, search-based DRL models can handle larger instances but sacrifice the speed advantage of neural approaches. This paper introduces Pointerformer, a novel DRL framework designed to bridge this gap by achieving high scalability without compromising the speed of end-to-end inference.
Methodology
Pointerformer enhances the standard Transformer-based encoder-decoder architecture through several key innovations focused on memory efficiency and contextual representation.
Reversible Residual Network (RevNet) Encoder
A primary bottleneck in scaling Transformers for TSP is the memory required to store intermediate activations for gradient calculation during backpropagation. Pointerformer addresses this by implementing a Reversible Residual Network (RevNet) encoder. RevNets allow the model to reconstruct activations on the fly during the backward pass, significantly reducing the memory footprint. This architectural choice enables the model to process instances with 500 or more nodes on standard hardware, where previous state-of-the-art (SOTA) models like POMO and Attention Model (AM) would encounter Out-of-Memory (OOM) errors.
Multi-Pointer Decoder and Contextual Embedding
The decoding process in Pointerformer is refined through a multi-head "multi-pointer" network. Unlike single-head attention mechanisms, this approach allows the model to capture diverse relationships between the current state and the remaining unvisited cities. The decoder's query is further enriched with a comprehensive context embedding that includes:
- The initial city (depot).
- The most recently visited city.
- A global graph embedding.
- A representation of the partial route ($h_\tau$), which provides the model with historical awareness necessary for complex decision-making.
Feature Augmentation and Training
To leverage the geometric symmetries inherent in Euclidean TSP, the authors represent each node using 24 features derived from coordinate transformations (rotations and flips) and polar coordinates. The model is trained using a modified REINFORCE algorithm that incorporates variance-consistent normalization to stabilize learning across varying problem scales.
Experimental Results
The performance of Pointerformer was evaluated on synthetic datasets (TSP_random) and the TSPLIB benchmark.
Scalability and Efficiency
Pointerformer demonstrates superior scalability compared to existing end-to-end models. On TSP500 instances, Pointerformer achieved an optimality gap of 3.56% in just 59 seconds. In contrast, search-based methods like Att-GCN+MCTS achieved a slightly lower gap (2.54%) but required 5.9 minutes—making Pointerformer approximately six times faster. While models like POMO fail to run on 500-node instances due to memory constraints, Pointerformer’s memory consumption grows linearly and manageably.
Zero-Shot Generalization
A significant finding is the model's ability to generalize to unseen distributions. A Pointerformer model trained on 200-node instances (Model200) performed remarkably well on real-world TSPLIB instances ranging from 14 to over 1,000 nodes. On practical instances between 101 and 500 nodes, Pointerformer consistently outperformed other DRL-based methods.
Conclusion and Future Work
Pointerformer represents a significant advancement in the application of DRL to combinatorial optimization. By integrating RevNets and a multi-pointer decoding strategy, it effectively breaks the 100-node scalability barrier for end-to-end models. While an optimality gap remains compared to exact solvers, the trade-off between speed and accuracy makes Pointerformer a highly viable candidate for real-time logistics and manufacturing applications. Future research will focus on extending this architecture to more complex Vehicle Routing Problems (VRP) that involve additional constraints such as capacity and time windows.
Summary updated