Preparing your design workspace

Loading the problem and your latest saved attempt…

Transformer Route Optimization System

Design a training and inference system that uses a transformer to produce valid, high-quality routes for traveling-salesperson instances.

Problem statement

For this exercise, assume customers submit weighted complete graphs and request a near-optimal traveling-salesperson tour. The product team trains transformer models from generated and solved graph instances, evaluates route quality against a trusted baseline, and serves one versioned model online.

Every response must be a valid tour, model promotion must be reproducible, and a slower deterministic solver may repair or replace invalid model output. Design the data, training, evaluation, model-release, and inference paths.

Exclude research into proving optimality for large instances and hardware-level accelerator design.

What to build

  1. Generate, solve, validate, and version graph instances and reference tours for training and evaluation.
  2. Train transformer candidates, compare route validity and reference-relative route-cost gap on immutable evaluation sets, and safely promote or roll back a model version.
  3. Accept a weighted graph and return a valid tour, total cost, model version, and whether deterministic repair or fallback was used.

At scale

  • Assume graphs contain 20 to 200 cities and the corpus grows to 50 million versioned instances.
  • Serve 50 route requests per second at peak with a p95 response target of 2 seconds for graphs up to 100 cities.
  • Reject or repair every invalid permutation before returning it, and measure quality by route-cost gap against versioned trusted reference tours on a fixed holdout set.
  • Model promotion must be reproducible from immutable data, code, configuration, and checkpoint identities.