Attention Model for Routing (AM)
An attention based model that learns to solve routing problems such as the Travelling Salesman Problem.
Reinforcement learning and control · 5,449 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
- Parameters
- 708.6K
- Operations
- 5,449
- Framework
- PyTorch
- Recurrent
- No
- Published
- ICLR 2019
- Cited by
- 832 (as of 27 October 2026)
- Authors
- Wouter Kool, Herke van Hoof, Max Welling
- License
- MIT
- 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
- m14740
- Graph hash
- 5411f42bc62e0eba2c7cf64412fe25b41c6279eb06fe59558a05830dd38704f3
- Skeleton hash
- b4271df6ec648509ec660f2958404089a9208b975ce7cc986c658b47f76ba3f5
- Architecture hash
- 944f2111854b5500d3672a1f3a5a1cb5262f63faa316d4e75738ccbca05607e2
- Diagram SHA-256
- f1cd2a8b586ad6487e3210d3ee4da5e3c9bb027f4a74f2515a32c05349a32efb
- 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
This is the attention based model from the paper "Attention, Learn to Solve Routing Problems!", which learns to solve the Travelling Salesman Problem (TSP), the Vehicle Routing Problem (VRP), the Orienteering Problem (OP) and the (Stochastic) Prize Collecting TSP (PCTSP). The paper pursues the idea of learning heuristics for combinatorial optimization problems, which the authors call promising because it can save costly development.
The authors propose a model based on attention layers, which they describe as having benefits over the Pointer Network. They train it using REINFORCE with a simple baseline based on a deterministic greedy rollout, which they found more efficient than using a value function.
For the TSP, the paper reports a significant improvement over recent learned heuristics and results close to optimal for problems up to 100 nodes. With the same hyperparameters, it learns heuristics for two variants of the VRP, the OP and a stochastic variant of the PCTSP. The paper was accepted at ICLR 2019. The author of the original code notes that the repository is no longer actively maintained and points to more recent implementations.
Key idea. The paper proposes an attention based model for routing problems and trains it using REINFORCE with a deterministic greedy rollout baseline, improving over recent learned heuristics for the TSP.
- Attention Model
- AM
- Kool Attention Model
- Attention, Learn to Solve Routing Problems!
- neural combinatorial optimization
- routing problems
- travelling salesman problem
- TSP
- vehicle routing problem
- learned heuristics
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{kool2019attentionlearnsolverouting,
title={Attention, Learn to Solve Routing Problems!},
author={Wouter Kool and Herke van Hoof and Max Welling},
year={2019},
eprint={1803.08475},
archivePrefix={arXiv},
primaryClass={stat.ML},
url={https://arxiv.org/abs/1803.08475},
}