Paper · 2020-12-19 · cs.LG, cs.AI
Multi-Decoder Attention Model with Embedding Glimpse for Solving Vehicle Routing Problems
Trains several Transformer-based attention decoders with REINFORCE and a KL diversity term to build routing tours, adds an Embedding Glimpse layer that re-embeds unvisited nodes every few steps, and uses a beam search with one beam per decoder. Author-reported: 0.38% gap on TSP100 and 2.23% on CVRP100 with 50-wide beams.
Policy gradientSelf-attentionDecoding strategiesAttention mechanismroutingcombinatorial-optimizationconstruction-heuristicreinforcement-learning
arXivPDFCodeMarkdown15 min read
AI-compiled by claude-haiku-5-5 on 2026-10-19, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Routing problems ask for the shortest or cheapest way to visit a set of places, such as a delivery round or a fleet of vehicles serving customers. They are hard to solve exactly, so this paper trains a neural network to build a route one stop at a time. Earlier learned builders used a single policy, so their candidate routes tended to look alike. Here several decoders are trained together and pushed to disagree with each other, so the pool of candidate routes is more varied and more likely to contain a good one.
A search keeps a separate set of partial routes for each decoder. The paper also adds a shortcut to the encoder: after some steps, the stops that have already been visited are hidden from the attention layer at the top, so later decisions are based only on the stops that still matter. The authors report better routes than earlier learned methods, with more run time spent when the search is wider.
TL;DR
- Learns construction heuristics for routing problems (TSP, CVRP and four variants) with reinforcement learning, using a Transformer encoder and M = 5 attention decoders §3.1.1 §4.
- Each decoder is trained with its own REINFORCE term; a KL term between the first-step decoder distributions encourages diverse tours §3.3 eq. 11.
- The Embedding Glimpse (EG) layer approximates re-embedding of unvisited nodes by masking visited nodes in the top attention layer every p steps §3.2.
- Author-reported: MDAM with 50-wide beams reaches 0.38% (TSP100) and 2.23% (CVRP100) optimality gap. On CVRP100 it beats AM sampling (1,280 samples) with less time: 31 min (bs30) and 53 min (bs50) against 2 h tab. 1.
Problem
Exact solvers for routing are exponential in the worst case, and heuristics have to be designed by hand §1. Learned construction policies (pointer networks, the Attention Model of Kool et al.) produce solutions one node at a time, but the authors identify two weaknesses §1:
- Low diversity. Sampling or beam search from one policy yields partly or completely repeated solutions, so few distinct candidates are explored §1 §3.1.2.
- Stale embeddings. Node embeddings are computed once for the full instance, although visited nodes no longer matter for future choices. Full re-encoding after every step is too expensive §1 §3.2.
The paper assumes Euclidean instances with node coordinates (and demands or prizes for variants), trained on random uniform instances §4.
Method
Overview. One shared Transformer-style encoder embeds the nodes. M decoders with identical structure but separate parameters each generate a complete tour from the same embeddings §3.1.1 fig. 1. Training uses REINFORCE with a rollout baseline and a KL diversity term §3.3. At test time, each decoder keeps its own beam and the shortest finished tour is returned §3.1.2. The encoder's top attention layer is replaced by the EG layer, which is recomputed with visited nodes masked every p steps §3.2.
Encoder §3.1.1. Node inputs are projected to d = 128 §4. Each encoder block is multi-head self-attention (H = 8 heads, key size d/H) followed by a skip connection, batch normalisation, and a two-layer feed-forward network with ReLU and hidden size 512 §4 eq. 1-5. The depot (for VRP variants) has its own linear embedding attention_model.py. The encoder has three blocks in total §4; the first l-1 are computed once, and the last one is the EG layer graph_encoder.py.
Decoder §3.1.1 eq. 6-10. Each decoder m builds a context vector from the mean node embedding, the start node embedding, and the current node embedding, with trainable placeholders at the first step eq. 6. A glimpse attention over valid nodes updates the context eq. 7. Compatibilities between the query and node keys are clipped with tanh, using D = 10 eq. 9, and a softmax over valid nodes gives the step distribution eq. 10. The decoders have identical structure but unshared parameters §3.1.1.
Diversity term §3.1.1 eq. 11. The KL divergence between the output distributions of every ordered pair of decoders enters the objective with a negative sign, so training maximises the divergence. The formula sums over states, but training applies it only at the first step, where all decoders share the same empty partial solution; the authors argue that the first choice has a strong effect on the tour pattern §3.3.
Training loss §3.3 eq. 16-19. Each decoder samples one tour pi_m. The REINFORCE gradient is summed over decoders eq. 16, with a shared baseline b(x) equal to the smallest greedy-rollout tour length among decoders of the previous best model eq. 17-18. The KL term is subtracted with coefficient k_KL eq. 19.
# Training step [§3.3] [eq. 16-19]
# Input: batch of instances; baseline model (greedy, frozen)
# Output: one gradient update of the MDAM parameters
def train_step(instances, baseline_model):
# Shared baseline: best greedy tour of the frozen model per instance
# [§3.3] [eq. 17]
baseline = best_greedy_tour_cost(baseline_model, instances)
# Encode the nodes once; decoders share this embedding [§3.1.1]
embeddings = encoder(instances) # (B, N, d)
# Each decoder samples its own tour and log-likelihood [§3.3]
for each decoder m in 1..M:
tour, log_likelihood = sample_tour(decoder_m, embeddings)
cost = tour_length(instances, tour)
# REINFORCE term for decoder m [§3.3] [eq. 16]
reinforce_m = mean((cost - baseline) * log_likelihood)
# Diversity term: KL between first-step distributions of all
# ordered pairs of decoders, maximised [§3.3] [eq. 11]
diversity = sum_over_pairs(kl(first_step_m, first_step_n))
# Total objective: summed REINFORCE minus weighted KL [eq. 19]
loss = sum_m(reinforce_m) - k_kl * diversity
gradient_step(loss) # Adam, lr 1e-4 [§4]Embedding Glimpse layer §3.2 eq. 12-15 fig. 1. The lowest l-1 attention blocks are reused unchanged. The top attention layer recomputes attention with the attention weights to visited nodes set to minus infinity, followed by the same projection, skip, normalisation and feed-forward steps eq. 14-15. This is applied every p steps, not every step, because one node is removed per step and the embeddings change slowly §3.2. The paper gives p = 2, 4, 8 for TSP20, 50, 100 and p = 2, 6, 8 for CVRP20, 50, 100 §4.
# Embedding Glimpse re-embedding [§3.2] [eq. 13-15]
# Input: frozen lower-layer outputs, top-layer attention, visited mask
# Output: refreshed node embeddings for the next decision
def embedding_glimpse(frozen_lower, top_attention, visited):
# Keep the first l-1 blocks fixed; only the top layer changes [§3.2]
scores = top_attention_scores(frozen_lower) # (H, N, N)
# Visited nodes get minus infinity, i.e. they are never attended [§3.2]
scores = where(visited, -inf, scores)
# Re-run the attention output and feed-forward block [eq. 14-15]
refreshed = feed_forward_block(frozen_lower + attend(scores))
return refreshedCustomised beam search §3.1.2 fig. 2. Given a total beam size, each decoder gets its own beam of size B = ceil(total / M), so beams never mix decoders. Partial tours inside one beam are merged when they are inferior to another: they share the start node, visited set and current node (the same remaining subproblem), and the other tour is not longer and has at least as much vehicle capacity left §3.1.2 fig. 2. When two partials are merged, the surviving one takes the larger probability of the two §3.1.2. The paper reports bs30 and bs50 as B = 30 and B = 50 per decoder, i.e. total beams of 150 and 250 with five decoders §4.1.
# Customised beam search, one beam per decoder [§3.1.2]
# Input: M decoders; per-decoder beam size B
# Output: the shortest complete tour found by any beam
def beam_search(decoders, beam_size):
# Beams are kept separate per decoder, so their tours stay diverse
# [§3.1.2]
for each decoder m in decoders:
beam = [empty partial tour]
while some partial tour is unfinished:
# Extend every partial tour with its valid next nodes
candidates = expand(beam, decoder_m)
# Merge candidates with the same remaining subproblem when
# they are inferior [§3.1.2] [fig. 2]
candidates = merge_inferior(candidates)
# Keep the B best by accumulated log-probability [§3.1.2]
beam = top_k(candidates, beam_size)
return shortest(all finished tours)Problem variants §4 [suppl.]. Capacities are fixed at 30, 40 and 50 for 20, 50 and 100 nodes, with integer demands from 1 to 9 §4. SDVRP, OP, PCTSP and SPCTSP follow the Attention Model setup and are described in the supplementary material; invalid nodes are masked at each step §4 [suppl.: "More details on the Comparative Study"].
Hyperparameters
| Name | Value | Where | Notes |
|---|---|---|---|
| Node embedding dimension d | 128 | §4 | element-wise projection of node features |
| Attention heads H | 8 | §4 | key size d/H; default in attention_model.py |
| Encoder blocks | 3 | §4 | the top block is the EG layer; default in options.py |
| Feed-forward hidden size | 512 | §4 | graph_encoder.py |
| Number of decoders M | 5 | §4 | default in options.py |
| Decoder width | 128, 8 heads | §4 | |
| Tanh clipping D | 10 | §3.1.1 eq. 9 | attention_model.py |
| KL coefficient k_KL | 0.01 | §4 | chosen on TSP20 only; README also uses 0.01; code default is 0.0 options.py |
| EG interval p, TSP | 2 (n=20), 4 (n=50), 8 (n=100) | §4 | code default is 200 options.py; README uses 2 for TSP20 |
| EG interval p, CVRP | 2 (n=20), 6 (n=50), 8 (n=100) | §4 | |
| Optimiser | Adam, lr 1e-4 | §4 | run.py |
| Epochs | 100 | §4 | |
| Iterations per epoch | 2,500 | §4 | |
| Batch size | 512 (256 for CVRP100) | §4 | per-problem batch size not in README |
| Instances per epoch | 1,280,000 | §4 | 2,500 x 512; options.py |
| Training instances | uniform in [0,1]^2 | §4 | depot location not stated in paper |
| CVRP capacity | 30 / 40 / 50 for n = 20 / 50 / 100 | §4 | problem_vrp.py |
| CVRP demand | integers 1..9, scaled by capacity | §4 | problem_vrp.py |
| Beam size B per decoder | 30 and 50 | §4.1 | total beam 150 and 250 |
| Test set | 10,000 instances | §4.1 | sampled from the training distribution |
| Gradient clipping | not stated in paper | code default max norm 1.0 options.py | |
| Rollout baseline update | not stated in paper | code uses a paired t-test gate reinforce_baselines.py |
Results
Author-reported. Setup: random uniform instances with 20, 50 and 100 nodes (TSP, CVRP, SDVRP, OP, PCTSP, SPCTSP) §4 §4.1. MDAM runs on one RTX 2080 Ti GPU; Concorde and LKH3 provide reference values for TSP and CVRP, run in parallel on 32 virtual CPUs; baseline numbers come from their original papers; Gurobi and OR Tools are run with time limits tab. 1 note. Times are for 10,000 test instances, following the Attention Model protocol tab. 1 note. "Bold" is best among learned methods; "*" is best overall (source convention, shown here as *). AM sampling uses 1,280 samples tab. 1 note.
tab. 1 Main comparison (Obj = mean tour cost; Gap vs reference; Time).
| Problem | Method | n=20 Obj | Gap | Time | n=50 Obj | Gap | Time | n=100 Obj | Gap | Time |
|---|---|---|---|---|---|---|---|---|---|---|
| TSP | Concorde | 3.84* | 0.00% | 1m | 5.70* | 0.00% | 2m | 7.76* | 0.00% | 3m |
| TSP | AM greedy | 3.85 | 0.34% | 0s | 5.80 | 1.76% | 2s | 8.12 | 4.53% | 6s |
| TSP | AM sampling | 3.84 | 0.08% | 5m | 5.73 | 0.52% | 24m | 7.94 | 2.26% | 1h |
| TSP | MDAM greedy | 3.84 | 0.05% | 5s | 5.73 | 0.62% | 15s | 7.93 | 2.19% | 36s |
| TSP | MDAM bs30 | 3.84 | 0.00% | 2m | 5.70 | 0.04% | 7m | 7.80 | 0.48% | 20m |
| TSP | MDAM bs50 | 3.84 | 0.00% | 3m | 5.70 | 0.03% | 14m | 7.79 | 0.38% | 44m |
| CVRP | LKH | 6.14* | 0.00% | 2h | 10.38* | 0.00% | 7h | 15.65* | 0.00% | 13h |
| CVRP | RL (beam 10) | 6.40 | 4.39% | 27m | 11.15 | 7.46% | 39m | 16.96 | 8.39% | 74m |
| CVRP | AM greedy | 6.40 | 4.43% | 1s | 10.98 | 5.86% | 3s | 16.80 | 7.34% | 8s |
| CVRP | AM sampling | 6.25 | 1.91% | 6m | 10.62 | 2.40% | 28m | 16.23 | 3.72% | 2h |
| CVRP | NeuRewriter | 6.16 | 0.48% | 22m | 10.51 | 1.25% | 35m | 16.10 | 2.88% | 66m |
| CVRP | MDAM greedy | 6.24 | 1.79% | 7s | 10.74 | 3.47% | 16s | 16.40 | 4.86% | 45s |
| CVRP | MDAM bs30 | 6.14 | 0.26% | 3m | 10.50 | 1.18% | 9m | 16.03 | 2.49% | 31m |
| CVRP | MDAM bs50 | 6.14 | 0.18% | 5m | 10.48 | 0.98% | 15m | 15.99 | 2.23% | 53m |
| SDVRP | RL (greedy) | 6.51 | 5.77% | - | 11.32 | 8.07% | - | 17.12 | 7.17% | - |
| SDVRP | RL (beam 10) | 6.34 | 3.01% | - | 11.08 | 5.78% | - | 16.86 | 5.54% | - |
| SDVRP | AM greedy | 6.39 | 3.82% | 1s | 10.92 | 4.25% | 4s | 16.83 | 5.36% | 11s |
| SDVRP | AM sampling | 6.25 | 1.55% | 9m | 10.59 | 1.10% | 42m | 16.27 | 1.85% | 3h |
| SDVRP | MDAM greedy | 6.25 | 1.49% | 13s | 10.72 | 2.31% | 28s | 16.39 | 2.62% | 1m |
| SDVRP | MDAM bs30 | 6.16 | 0.08% | 4m | 10.49 | 0.18% | 11m | 16.01 | 0.24% | 28m |
| SDVRP | MDAM bs50 | 6.15* | 0.00% | 6m | 10.47* | 0.00% | 19m | 15.97* | 0.00% | 1h |
| OP | Gurobi | 5.39* | 0.00% | 16m | - | - | - | - | - | - |
| OP | Gurobi (30s) | 5.38 | 0.05% | 14m | 13.57 | 16.29% | 2h | 3.23 | 90.28% | 3h |
| OP | Compass | 5.37 | 0.36% | 2m | 16.17 | 0.25% | 5m | 33.19* | 0.00% | 15m |
| OP | AM greedy | 5.19 | 3.64% | 0s | 15.64 | 3.52% | 1s | 31.62 | 4.75% | 5s |
| OP | AM sampling | 5.30 | 1.56% | 4m | 16.07 | 0.87% | 16m | 32.68 | 1.55% | 53m |
| OP | MDAM greedy | 5.32 | 1.32% | 7s | 15.92 | 1.80% | 14s | 32.32 | 2.61% | 32s |
| OP | MDAM bs30 | 5.38 | 0.15% | 1m | 16.19 | 0.10% | 6m | 32.91 | 0.84% | 14m |
| OP | MDAM bs50 | 5.38 | 0.13% | 3m | 16.21* | 0.00% | 15m | 32.96 | 0.69% | 32m |
| PCTSP | Gurobi | 3.13* | 0.00% | 2m | - | - | - | - | - | - |
| PCTSP | Gurobi (30s) | 3.13* | 0.00% | 2m | 4.48 | 0.03% | 54m | - | - | - |
| PCTSP | OR Tools (60s) | 3.13 | 0.01% | 5h | 4.48* | 0.00% | 5h | 6.07 | 1.56% | 5h |
| PCTSP | ILS C++ | 3.16 | 0.77% | 16m | 4.50 | 0.36% | 2h | 5.98* | 0.00% | 12h |
| PCTSP | AM greedy | 3.18 | 1.62% | 0s | 4.60 | 2.66% | 2s | 6.25 | 4.46% | 5s |
| PCTSP | AM sampling | 3.15 | 0.45% | 5m | 4.52 | 0.74% | 19m | 6.08 | 1.67% | 1h |
| PCTSP | MDAM greedy | 3.16 | 0.82% | 7s | 4.56 | 1.73% | 18s | 6.17 | 3.13% | 34s |
| PCTSP | MDAM bs30 | 3.14 | 0.21% | 2m | 4.50 | 0.55% | 9m | 6.07 | 1.46% | 16m |
| PCTSP | MDAM bs50 | 3.14 | 0.19% | 4m | 4.50 | 0.47% | 23m | 6.06 | 1.31% | 35m |
| SPCTSP | REOPT all | 3.34 | 6.05% | 17m | 4.68 | 3.69% | 2h | 6.22 | 2.52% | 12h |
| SPCTSP | REOPT half | 3.31 | 5.10% | 25m | 4.64 | 2.80% | 3h | 6.16 | 1.53% | 16h |
| SPCTSP | AM greedy | 3.26 | 3.51% | 0s | 4.65 | 3.03% | 2s | 6.32 | 4.17% | 5s |
| SPCTSP | AM sampling | 3.19 | 1.30% | 2m | 4.54 | 0.60% | 17m | 6.11 | 0.69% | 40m |
| SPCTSP | MDAM greedy | 3.19 | 1.34% | 9s | 4.59 | 1.61% | 18s | 6.18 | 1.84% | 1m |
| SPCTSP | MDAM bs30 | 3.15 | 0.05% | 2m | 4.52 | 0.12% | 14m | 6.08 | 0.16% | 26m |
| SPCTSP | MDAM bs50 | 3.15* | 0.00% | 4m | 4.51* | 0.00% | 15m | 6.07* | 0.00% | 38m |
tab. 2 Architecture ablation, greedy decoding (TSP and CVRP).
| Problem | Variant | n=20 Obj | Gap | Time | n=50 Obj | Gap | Time | n=100 Obj | Gap | Time |
|---|---|---|---|---|---|---|---|---|---|---|
| TSP | MDAM without multi-decoder | 3.85 | 0.27% | 1s | 5.78 | 1.52% | 3s | 8.06 | 3.76% | 7s |
| TSP | MDAM without EG | 3.84 | 0.06% | 3s | 5.74 | 0.71% | 8s | 7.98 | 2.78% | 23s |
| TSP | MDAM (full) | 3.84 | 0.05% | 5s | 5.73 | 0.62% | 15s | 7.93 | 2.19% | 36s |
| CVRP | MDAM without multi-decoder | 6.39 | 4.27% | 1s | 10.93 | 5.32% | 3s | 16.57 | 5.96% | 9s |
| CVRP | MDAM without EG | 6.25 | 1.95% | 4s | 10.79 | 3.95% | 11s | 16.46 | 5.26% | 26s |
| CVRP | MDAM (full) | 6.24 | 1.79% | 7s | 10.74 | 3.47% | 16s | 16.40 | 4.86% | 45s |
[suppl. Table S.1] Temperature-tuned AM sampling (1,280 samples) vs MDAM beam search (CVRP; obj only).
| Problem | Softmax temperature | AM sampling obj | MDAM bs30 | MDAM bs50 |
|---|---|---|---|---|
| CVRP20 | 1 / 2 / 3 / 4 / 5 | 6.25 / 6.19 / 6.18 / 6.19 / 6.26 | 6.14 | 6.14 |
| CVRP50 | 1 / 1.25 / 1.5 / 1.75 / 2 | 10.62 / 10.61 / 10.60 / 10.59 / 10.60 | 10.50 | 10.48 |
| CVRP100 | 1 / 1.01 / 1.02 / 1.03 / 1.04 | 16.23 / 16.1912 / 16.1909 / 16.1919 / 16.1925 | 16.03 | 15.99 |
[suppl. Table S.2] Generalisation to larger CVRP, trained on n = 100.
| Method | n=150 Obj | Time | n=200 Obj | Time |
|---|---|---|---|---|
| AM greedy | 23.52 | 1s | 30.23 | 2s |
| AM sampling (5) | 23.39 | 5s | 30.17 | 9s |
| AM sampling (1,280) | 22.87 | 30m | 29.54 | 49m |
| MDAM greedy | 23.18 | 24s | 29.98 | 52s |
| MDAM bs30 | 22.66 | 13m | 29.37 | 30m |
| MDAM bs50 | 22.61 | 32m | 29.28 | 74m |
Other reported findings, all author-reported: the multi-decoder variant with greedy decoding improves on a single decoder tab. 2; each decoder wins the best-tour count in roughly similar amounts on CVRP20 fig. 3; merging in the beam search improves all instance sets, and more decoders help at fixed beam size [suppl.: "More Analysis of MDAM"] fig. S.1 fig. S.2. The figure values are not in the source text and are not reproduced here.
Paper vs code
Compared at code_commit 19b0bf8 (repository liangxinedu/MDAM, linked
from the paper §4). The owner name matches the first author, and the README
names the paper README.md. The comparison below
covers the TSP and CVRP paths. The SDVRP, OP, PCTSP and SPCTSP code was not
read in depth.
- Gradient scale across decoders. Paper sums the REINFORCE term over decoders §3.3 eq. 16. Code adds each decoder's loss divided by the number of decoders attention_model.py. The effective learning rate of the REINFORCE part is therefore 1/M of the paper's sum, and the KL term is not divided attention_model.py.
- KL aggregation. Paper sums the KL over states, decoder pairs and nodes §3.3 eq. 11. Code takes the mean over decoder pairs and the batch attention_model.py and applies the first step only. With k_KL = 0.01 this changes the effective diversity weight; the paper does not say which convention k_KL refers to.
- Beam expansion width. The paper does not state how many successors a beam entry expands. The search code overwrites the expansion width with the constant 3, after computing it from the beam size [code: nets/model_search.py#L165-L166]. Each beam therefore considers 3 successors per entry, not beam-width many.
- Baseline replacement. Paper says the baseline is the best model among previous epochs §3.3. Code replaces the rollout baseline only if a paired, one-sided t-test on the validation set gives p < 0.05 [code: reinforce_baselines.py#L205-L214] options.py.
- Rollout baseline value. Matches the paper: the rollout takes the minimum cost over decoders train.py and the decoders are set to greedy train.py.
- EG defaults. Paper gives per-size interval values §4. The command-line default is 200, which effectively disables EG; the README's TSP20 example passes 2 options.py README.md.
- Gradient clipping. Code clips the global norm to 1.0 by default [code: options.py#L41-L42]. The paper does not mention clipping.
- Re-embedding. Paper masks visited nodes with minus infinity §3.2 eq. 13. Code multiplies the stored attention by the unvisited mask and renormalises graph_encoder.py; this is equivalent for softmax weights. Code adds 1e-9 to the denominator for VRP variants only graph_encoder.py.
- Merging criteria. Paper's inferiority rule §3.1.2 matches the code's checks for shared visited set, first and current node, and the distance and used-capacity comparisons model_search.py.
- Matches. Tanh clipping D = 10 attention_model.py; FF size 512 graph_encoder.py; Adam, lr 1e-4 [code: run.py#L96]; CVRP capacities and demands [code: problems/vrp/problem_vrp.py#L181-L193].
- Not verifiable from code. The CVRP100 batch size of 256 §4 is not set per problem in the code, and the README gives only the TSP20 command.
Pitfalls
- Equation and table numbers were counted from the LaTeX source
(
aaai.tex), not from the compiled PDF. Equations were numbered in order of appearance (eq. 1-19), tables as Table 1 and 2, supplementary as S.1 and S.2, figures as 1-3 and S.1-S.2. Check against the PDF before relying on them. - Expansion width is missing from the paper. The code expands only 3 successors per beam entry, so a 30-wide beam sees at most 90 candidates per step model_search.py. Copy this constant if you want to reproduce the reported beam results.
- Learning-rate scale depends on M. Dividing the REINFORCE loss by M changes the step size relative to the summed form in the paper eq. 16. Pick one convention and keep the KL weight consistent with it.
- KL weight is not portable. k_KL = 0.01 was tuned on TSP20 only §4. Re-tune if you change M, the batch size, or the KL normalisation.
- The KL term can be infinite. First-step log-probabilities are floored at minus 1e9 before the KL is computed attention_model.py. Without this floor, masked actions give -inf and the KL is undefined.
- Batch normalisation at evaluation. The search script calls
model.train()before evaluating search.py, so BatchNorm uses batch statistics. Results can depend on the evaluation batch size (default 1024 options.py). The paper does not discuss this. - Depot location. The paper says cities are sampled uniformly but does not state where the depot is. The code samples it uniformly in the unit square as well problem_vrp.py. Treat this as the authors' choice, not as a paper requirement.
- Time columns mix scopes. Table 1 times are for 10,000 instances [tab. 1 note]; §4.1 gives 6.7 s per CVRP100 instance for bs50 without instance parallelism. The two numbers are not directly comparable §4.1.
- Figure 2 caption is copied from Figure 1. The source gives the same caption text to the search figure fig. 2, so the figure's own description is not in the source. Use the body text §3.1.2 instead.
- Supplementary sections are unnumbered. They are cited by title, e.g. [suppl.: "More Analysis of MDAM"].
- Repository license. The
LICENSEfile is MIT but its copyright line names Wouter Kool (2018), who is the upstream author; the README says MDAM is developed from the Attention Model code README.md. Recordcode_license: MITas the license, and keep this note in mind when reusing code.
Lineage
- Builds on: the Attention Model of Kool et al. (Transformer encoder, pointer attention decoder, sampling baseline and 1,280-sample evaluation) §2 tab. 1. Not linked to a card in this wiki.
- Builds on: pointer networks and REINFORCE training of routing policies §2.
- Builds on: a prior routing paper's step-wise re-embedding idea, which EG generalises with better efficiency §3.2. The source cites it as 9226142; its title is not given in the source.
- Compared against: NeuRewriter (improvement heuristic) §4.1 tab. 1, REOPT, OR Tools, Gurobi, LKH3, Concorde and Compass tab. 1.
Source and license
Adapted from “Multi-Decoder Attention Model with Embedding Glimpse for Solving Vehicle Routing Problems” by Liang Xin, Wen Song, Zhiguang Cao, Jie Zhang (arXiv:2012.10638), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/liangxinedu/MDAM at commit 19b0bf813fb2 (MIT). Any quoted code is shown under that license.