family · 01
Exact
Guaranteed optimum, exponential cost. Use on small instances (≤ 18 cities) or when you need a ground-truth bound.
live · 2-opt running
20 algorithms from Held-Karp to Ant Colony, compiled to WebAssembly. Nothing leaves your machine — drag the cities and watch the tour recompute.
berlin52
2-opt · nearest-neighbour seed
drag any city to edit
tour length
—
iterations
—
best
—
algorithms
Not a flat sidebar. Each family has a different reason to exist — pick the right tool for the instance.
family · 01
Guaranteed optimum, exponential cost. Use on small instances (≤ 18 cities) or when you need a ground-truth bound.
family · 02
Build a tour from nothing, one decision at a time. Fast, deterministic, usually 10–25% off optimal — perfect seeds for local search.
family · 03
Start with a tour, improve it by small structural moves. The workhorse — 2-opt alone gets within 5% of optimal in milliseconds.
family · 04
Trade wall-clock for quality. Escape local optima with memory, randomness, or population-based search. Use when local search plateaus.
benchmarks
Runtime vs optimality gap on berlin52. Every dot is a solve. Lower-left is better: fast and optimal.
access
One WASM core, four surfaces. The browser tool above is the same binary your CLI calls.
# POST a .tsp instance, get a tour back
curl -X POST https://api.tspsolver.com/solve \
-H "Content-Type: application/json" \
-d '{"instance":"berlin52","algo":"lin-kernighan"}'Stateless, idempotent, rate-limited per key. The same WASM binary runs server-side.
http api docs$ teeline solve berlin52.tsp --algo lk --time 5s
tour: 7542 gap: 0.0% time: 1.2s iter: 8,412
$ teeline batch ./instances/ --algo 2-optPipes in and out. Drop it in a Makefile or a CI step.
cli docsimport { solve } from 'teeline-wasm'
const tour = solve(cities, {
algo: '2-opt',
epochs: 2000,
})
// → [0, 3, 7, 12, ...]Runs in any browser, Node, Deno, or Bun. No server, nothing leaves your machine.
webassembly docs{ "tool": "teeline.solve",
"params": {
"instance": "berlin52",
"algo": "auto"
}
} → returns tour + metricsRegister the solver as an MCP tool. Your agent picks the algorithm.
webmcp docs