Solve routing problems with a residual edge-graph attention neural network

Kun Lei, Peng Guo, Yi Wang, Xiao Wu, Wenchao Zhao

Combinatorial optimization problems like the Traveling Salesman Problem (TSP) are the "final bosses" of logistics and computer science. While we’ve had exact solvers for decades, they scale poorly as problems grow. Recently, Deep Reinforcement Learning (DRL) has emerged as a way to "learn" heuristics that are nearly as good as exact solutions but run in a fraction of the time.

In this paper, researchers from Southwest Jiaotong University and Auburn University at Montgomery introduce a new architecture—the residual edge-graph attention neural network (residual E-GAT)—to push the boundaries of what these neural solvers can achieve.

TL;DR

The authors propose an end-to-end deep reinforcement learning framework that uses a novel "residual edge-graph attention" encoder to solve TSP and Vehicle Routing Problems (CVRP). By explicitly incorporating edge information and residual connections, their model achieves state-of-the-art results for neural solvers, reducing the optimality gap for 100-node TSPs from 4.53% to 3.67% while maintaining linear time complexity.

What Problem Does This Paper Address?

The paper tackles NP-hard combinatorial optimization problems, specifically the Traveling Salesman Problem (TSP) and the Capacity-constrained Vehicle Routing Problem (CVRP).

The challenge with existing neural solvers is two-fold:

  1. Ignoring the Edges: Many Graph Neural Networks (GNNs) focus heavily on node features (like coordinates) but treat the relationships between nodes (edges/distances) as secondary or static. In routing, the "cost" is on the edges, so ignoring them is a major oversight.
  2. Model Degradation: As GNNs get deeper to capture more complex structures, they often suffer from vanishing gradients, making them difficult to train effectively.

Methods

The authors developed an encoder-decoder architecture trained via Deep Reinforcement Learning.

1. The Residual E-GAT Encoder

This is the core innovation. Unlike standard Graph Attention Networks (GAT) that only update node information, the residual E-GAT integrates edge information (Euclidean distances) directly into the attention mechanism. It updates node and edge features simultaneously. Furthermore, they added residual connections between layers, a technique borrowed from computer vision (ResNets) that allows the model to become deeper without losing the ability to learn.

2. Transformer-based Decoder

The decoder uses a "pointer" mechanism. Instead of generating a fixed-length output, it sequentially "points" to the next node to visit based on the probabilities calculated by the attention layers. This allows the model to handle different problem sizes and constraints (like vehicle capacity) flexibly.

3. Training with PPO and REINFORCE

The model is trained using two popular DRL algorithms: Proximal Policy Optimization (PPO) and an improved REINFORCE with a rollout baseline. They also employed "code-level optimizations" like reward normalization and learning rate annealing to stabilize the notoriously finicky DRL training process.

Datasets

  • Randomly Generated Instances: Training and initial testing were done on nodes randomly distributed in a 2D unit square ($n = 20, 50, 100$).
  • TSPLIB & CVRPLIB: To test real-world generalization, the authors evaluated their model on these classic benchmark libraries, which contain non-random, structured instances.

Key Insights and Ideas

  • Edges are First-Class Citizens: By treating edge distances as dynamic features within the attention layers, the model captures the "topology" of the route much more effectively than models that only look at node coordinates.
  • Depth Matters: The residual connections proved essential. Without them, the model couldn't converge when the number of GAT layers exceeded two. With them, they could use four layers, leading to significantly better feature extraction.
  • Efficiency in Training: Their framework achieved better results using only 1/3 to 3/4 of the training samples required by previous state-of-the-art models (like the Attention Model by Kool et al.).

Key Results

The model was compared against exact solvers (Gurobi), traditional heuristics (Nearest Neighbor, Farthest Insertion), and other deep learning methods.

  • TSP100: Using a greedy decoding strategy, they reduced the optimality gap to 3.67% (down from the previous best of 4.53%).
  • CVRP100: The gap was reduced to 6.68% (down from 7.34%).
  • Speed: During the testing phase, the model exhibits linear time complexity $O(n)$. For a 100-node TSP, it finds a solution in just 11 milliseconds, whereas an exact solver like Gurobi can take hours for larger, more complex variants.
  • Generalization: The model trained on random data performed remarkably well on the structured instances of TSPLIB, proving it learned general routing principles rather than just memorizing random patterns.

Limitations and Future Work

  • Problem Size: While 100 nodes is a standard benchmark, real-world logistics often involve thousands of nodes. The authors note that while their time complexity is linear, memory constraints on GPUs might become a bottleneck for massive graphs.
  • Complex Constraints: The current model handles capacity (CVRP), but real-world routing often includes time windows, heterogeneous fleets, or dynamic traffic. The authors suggest that the framework is flexible enough to be adapted for these "extra constraints" in future research.
  • Algorithm Fusion: They suggest that combining PPO and REINFORCE might lead to even more robust training in the future.

Summary updated

BibTeX
@article{lei2022solve,
  author = {Kun Lei and Peng Guo and Yi Wang and Xiao Wu and Wenchao Zhao},
  title = {{Solve routing problems with a residual edge-graph attention neural network}},
  journal = {Neurocomputing},
  year = {2022},
  doi = {10.1016/j.neucom.2022.08.005},
}
Figure