Graph Pointer Network (GPN)
A pointer network with a graph encoder that learns TSP tours by reinforcement and scales to bigger maps.
Graphs and geometry · 3,670 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Graphs and geometry
- Parameters
- 447K
- Operations
- 3,670
- Framework
- PyTorch
- Recurrent
- Yes
- Published
- AAAI 2020 Workshop on Deep Learning on Graphs
- Cited by
- 139 (as of 5 October 2026)
- Authors
- Qiang Ma, Suwen Ge, Danyang He and others
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m14387
- Graph hash
- dc01c33313db380fb96a0f9edd3c56f364329243f20d217ac83de99f3f7f9608
- Skeleton hash
- aa2fab0f166110613c31ef9f6677a31df2efa7d278a09fae6d8da36218a39dc7
- Architecture hash
- b65426f491f987641a6984be7b06ef31056f0ea628f91482b4b64b69930a195a
- Diagram SHA-256
- 177be11591c6a5a1a437870c1faaa4eaf42404c7e9f87602d0efda9e94c60129
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
The Graph Pointer Network is a reinforcement-learned solver for the traveling salesman problem. It builds on Pointer Networks by adding a graph embedding layer on the input to capture the relationships between nodes. The paper's headline result is transfer: GPNs trained on TSP50 and TSP100 generalize to TSP500 and TSP1000 with shorter tours and faster compute.
The network has an encoder and a decoder. A point encoder embeds each city coordinate into a higher dimensional vector and runs it through an LSTM. A graph encoder embeds all city coordinates at once through a graph neural network. A quirk that matters for transfer is the vector context: the graph layers see vectors pointing from the current city to every other city rather than raw coordinates. The authors report that this vector context gives more transferable representations and lets the model perform well on larger TSP instances. The decoder is an attention mechanism that outputs a pointer vector, which a softmax turns into a distribution over the next candidate cities.
For constrained problems such as TSP with time windows, the paper stacks GPNs into a hierarchical policy, with a separate reward function at each layer for stable training. The captured member is the small-scale TSP model from the released code, traced on 50-city instances; the hierarchical version was not traced. The repository records the work as appearing in the AAAI Workshop on Deep Learning on Graphs in 2020.
Key idea. GPN adds a graph embedding layer with a vector context to the pointer network, so a TSP policy trained with RL on 50 to 100 cities transfers to 500 to 1,000 cities with shorter tours.
- Graph Pointer Network
- GPN
- HGPN
- hierarchical graph pointer network
- pointer network
- traveling salesman problem
- TSP
- TSPTW
- combinatorial optimization
- reinforcement learning
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{ma2019combinatorialoptimizationgraphpointer,
title={Combinatorial Optimization by Graph Pointer Networks and Hierarchical Reinforcement Learning},
author={Qiang Ma and Suwen Ge and Danyang He and Darshan Thaker and Iddo Drori},
year={2019},
eprint={1911.04936},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1911.04936},
}