live · 2-opt running

Solve the Traveling Salesman Problem, in your browser.

20 algorithms from Held-Karp to Ant Colony, compiled to WebAssembly. Nothing leaves your machine — drag the cities and watch the tour recompute.

Largest instance
pr1002 · 1002 cities
Algorithms
20
Runtime
WASM · no server

berlin52

2-opt · nearest-neighbour seed

solving

drag any city to edit

tour length

iterations

best

algorithms

Twenty algorithms, grouped by intent.

Not a flat sidebar. Each family has a different reason to exist — pick the right tool for the instance.

family · 01

Exact

Guaranteed optimum, exponential cost. Use on small instances (≤ 18 cities) or when you need a ground-truth bound.

benchmarks

Twenty algorithms, one chart.

Runtime vs optimality gap on berlin52. Every dot is a solve. Lower-left is better: fast and optimal.

1ms10ms100ms1s10s0%5%10%15%20%25%145%runtime →gap vs optimal →betterhknnchristofides2optlkcs
ExactConstructiveLocal searchMetaheuristicberlin52 · 52 cities · release build

access

Four ways to call the same solver.

One WASM core, four surfaces. The browser tool above is the same binary your CLI calls.

HTTP API

cloud
# 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

CLI

local
$ teeline solve berlin52.tsp --algo lk --time 5s
tour: 7542  gap: 0.0%  time: 1.2s  iter: 8,412

$ teeline batch ./instances/ --algo 2-opt

Pipes in and out. Drop it in a Makefile or a CI step.

cli docs

WebAssembly

embed
import { 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

WebMCP

agent
{ "tool": "teeline.solve",
  "params": {
    "instance": "berlin52",
    "algo": "auto"
  }
} → returns tour + metrics

Register the solver as an MCP tool. Your agent picks the algorithm.

webmcp docs