NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Combinatorial Optimization by Graph Pointer Networks and Hierarchical Reinforcement Learning

Qiang Ma, Suwen Ge, Danyang He, Darshan Thaker, Iddo DroriarXiv 2019

Abstract

In this work, we introduce Graph Pointer Networks (GPNs) trained using reinforcement learning (RL) for tackling the traveling salesman problem (TSP). GPNs build upon Pointer Networks by introducing a graph embedding layer on the input, which captures relationships between nodes. Furthermore, to approximate solutions to constrained combinatorial optimization problems such as the TSP with time windows, we train hierarchical GPNs (HGPNs) using RL, which learns a hierarchical policy to find an optimal city permutation under constraints. Each layer of the hierarchy is designed with a separate reward function, resulting in stable training. Our results demonstrate that GPNs trained on small-scale TSP50/100 problems generalize well to larger-scale TSP500/1000 problems, with shorter tour lengths and faster computational times. We verify that for constrained TSP problems such as the TSP with time windows, the feasible solutions found via hierarchical RL training outperform previous baselines.

Introduction

The Traveling Salesman Problem (TSP) is a foundational NP-complete challenge in combinatorial optimization. While traditional heuristics like the Lin-Kernighan algorithm are highly effective for standard instances, real-world applications often introduce complex constraints, such as time windows (TSPTW), where cities must be visited within specific intervals. Traditional Reinforcement Learning (RL) approaches often struggle with these constraints, typically relying on penalty functions that can lead to unstable training and poor generalization from small to large-scale instances.

Methodology

Graph Pointer Networks and Vector Context

To overcome the limitations of standard Pointer Networks, which process cities as a sequence via LSTMs, the authors propose Graph Pointer Networks (GPNs). The GPN incorporates a Graph Neural Network (GNN) embedding layer to capture the spatial and relational structure of the cities simultaneously.

A critical innovation in GPN is the use of Vector Context. Instead of using absolute coordinates, the model utilizes relative distances and directions from the current node to all others. This spatial invariance allows the network to learn geometric patterns that are independent of the specific map scale, enabling a model trained on 50 cities to generalize effectively to 1,000 cities.

Architecture of the Graph Pointer Network (GPN) featuring the Vector Context and Graph Neural Network (GNN) embedding layer.

Hierarchical Reinforcement Learning (HGPN)

For constrained problems like the TSPTW, the authors introduce a Hierarchical Graph Pointer Network (HGPN). Standard RL methods often fail to find feasible solutions when optimizing for both path length and constraint satisfaction simultaneously. The HGPN addresses this by decomposing the task into a hierarchy:

  1. Lower Layers: Focus on finding feasible solutions that satisfy all time-window constraints.
  2. Higher Layers: Optimize the tour length within the feasible space identified by the lower layers.

This hierarchical structure, combined with layer-specific reward functions and a central self-critic baseline for the REINFORCE algorithm, significantly stabilizes training and improves the success rate in finding valid paths.

The Hierarchical Graph Pointer Network (HGPN) architecture designed for handling constrained optimization problems through layer-wise policy learning.

Experimental Results

The GPN and HGPN models were evaluated against synthetic TSP benchmarks, the TSPLIB library, and constrained TSPTW datasets. Key findings include:

  • Generalization: A GPN trained only on TSP50 outperformed state-of-the-art Attention Models when tested on TSP1000, demonstrating the power of the vector context and graph embeddings.
  • Efficiency: When paired with a simple 2-opt local search, GPN achieved tour lengths comparable to the LKH solver but with significantly reduced computational overhead.
  • Constraint Satisfaction: In TSPTW20 tests, the HGPN achieved a 100% feasibility rate, whereas traditional solvers like OR-Tools and Ant Colony Optimization reached only 72% and 62%, respectively.
  • Real-World Performance: On TSPLIB instances, the model maintained a competitive optimality gap (approximately 9.35%) while executing much faster than exact solvers like Concorde.

Conclusion

Graph Pointer Networks represent a significant step forward in applying deep reinforcement learning to combinatorial optimization. By leveraging graph-based embeddings and relative spatial context, GPNs achieve unprecedented generalization across problem scales. Furthermore, the hierarchical training framework provides a robust solution for constrained optimization problems that have historically been difficult for neural networks to solve reliably. Future research may extend this framework to more complex multi-agent or capacity-constrained routing problems.

Summary updated

BibTeX
@misc{ma2019combinatorial,
  author = {Qiang Ma and Suwen Ge and Danyang He and Darshan Thaker and Iddo Drori},
  title = {{Combinatorial Optimization by Graph Pointer Networks and Hierarchical Reinforcement Learning}},
  year = {2019},
  eprint = {1911.04936},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.04936},
}
Figure