# wouterkool/attention-learn-to-route

Attention based model for learning to solve different routing problems

Repository: https://github.com/wouterkool/attention-learn-to-route
Canonical: https://ross.abutalabs.com/products/attention-learn-to-route
Language: Jupyter Notebook
License: MIT
License Family: permissive
Last push: 2024-08-04T11:28:45+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3086, "days_push": 759, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1383, forks 389 (observed 2026-08-28T04:04:34.506619+00:00)

## What it is
A PyTorch implementation of the attention-based neural model from the ICLR 2019 paper 'Attention, Learn to Solve Routing Problems!', trained with REINFORCE and a greedy rollout baseline. It learns to solve combinatorial routing problems including TSP, VRP, Orienteering Problem, and (Stochastic) Prize Collecting TSP.

## Use cases
- train a neural network to solve TSP instances
- learn to solve vehicle routing problems with deep learning
- reproduce results from the Attention Learn to Solve Routing Problems paper
- benchmark neural combinatorial optimization models
- experiment with REINFORCE and rollout baselines for routing problems
- generate and validate routing problem datasets

## When to choose
- you want to reproduce or build on the ICLR 2019 attention model for routing problems
- you need pretrained models for TSP, VRP, OP, or PCTSP research
- you are studying neural combinatorial optimization with REINFORCE

## When to avoid
- you need an actively maintained library - the author recommends rl4co or RLOR instead
- you need production routing solvers rather than research code
- you want exact or heuristic solvers like OR-Tools or LKH

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, deep-learning, reinforcement-learning, llm-training
- domain: machine-learning, deep-learning
- platform: python, cross-platform
- tags: combinatorial-optimization, travelling-salesman-problem, vehicle-routing-problem, reinforcement-learning, transformer, attention-model, iclr-2019, pytorch, research-code, algorithms, research, gpu

## Member repositories
- wouterkool/attention-learn-to-route (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:34.506619+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:40:05.026657+00:00, confidence not recorded.
  - readme: https://github.com/wouterkool/attention-learn-to-route (fetched 2026-08-28T04:04:34.506619+00:00, sha 03ecd7ad37ef)
- Data as of 2026-08-30T08:39:29.467469+00:00.
