API LIVE · api.bitsabhi.com

Your drivers are taking
the wrong routes.
Lambda-G fixes that.

Find the shortest path through any number of stops — one API call, results in milliseconds. Delivery, field sales, logistics, warehousing — any domain, any scale.

Within 0.13% of LKH-3 · Beats Google OR-Tools on all benchmarks · Built in Rust

GET API KEY → VIEW DOCS
TRY IT LIVE
Click anywhere to place cities, then hit Optimize to see the route.
📍

Click to drop cities or press R for random

Cities
0
Tour
THE PROOF — WITHIN 0.13% OF LKH-3 · IN RUST · 1,000 CITIES
0.13%
gap to LKH-3 on 1000-city benchmark
EXACT
match with LKH-3 on kroA100 (21,907)
LKH-3 (state-of-the-art) 23,342
★ Lambda-G v15 23,373
Google OR-Tools 23,917
Nearest-Neighbour 28,452
Lower is better. Tour length on shared_benchmark.tsp (1000 cities). Time limit: 60s. Same hardware.
Algorithm: Iterated local search with 2-opt, Or-opt, and double-bridge perturbation.
TSPLIB BENCHMARK RESULTS
INSTANCECITIESLKH-3LAMBDA-GGAP
kroA10010021,90721,9080.005%
pr10021002259,045261,9211.11%
shared_benchmark100023,34223,3730.13%
All tests run with 60s time limit. kroA100 matches LKH-3 exactly.
RESPONSE TIME (API LATENCY)
~0.5s
100 cities
~3s
1,000 cities
~25s
10,000 cities
Includes cold-start. Warm instances are 2-3x faster.
# Real-world delivery: use distance matrix (actual road distances)
# Get driving distances from Google Maps Distance Matrix API first
import httpx

result = httpx.post("https://api.bitsabhi.com/optimize",
    headers={"Authorization": "Bearer YOUR_KEY"},
    json={
        "matrix": [
            [0,  5, 12,  8],   # Home → Home, A, B, C
            [5,  0,  9,  6],   # A    → Home, A, B, C
            [12, 9,  0,  4],   # B    → Home, A, B, C
            [8,  6,  4,  0]    # C    → Home, A, B, C
        ],
        "time_limit": 10
    }
).json()

print(result["tour"])    # e.g. [0, 1, 3, 2] = Home → A → C → B
print(result["length"])  # total distance in your units
# PCB drilling, CNC, telescopes, warehouses:
# straight-line distance is accurate here
import httpx

result = httpx.post("https://api.bitsabhi.com/optimize",
    headers={"Authorization": "Bearer YOUR_KEY"},
    json={
        "points": [[0,0], [100,0], [100,100], [0,100]],
        "time_limit": 10
    }
).json()

print(result["tour"])    # [0, 1, 2, 3]
print(result["length"])  # 400.0
COORDINATES OR DISTANCE MATRIX?

Pick the right input for your domain.

Same API, same endpoint. The only difference is what you send.

Use coordinates when...Use distance matrix when...
Movement is physically straight-lineRoads, traffic, or one-ways matter
PCB drilling, CNC, laser cuttingDelivery, field service, sales routes
Telescope or drone schedulingAny non-Euclidean distance
Warehouse picking (flat floor)Custom similarity scores (DNA, etc.)

Example: Optimize a 4-stop delivery route

Step 1 — Get driving distances between all stops (Google Maps Distance Matrix API, OSRM, or any routing engine).
Step 2 — Build the matrix:
           Depot    Stop A   Stop B   Stop C
Depot  [   0,      8km,    14km,    18km  ]
Stop A [   8,      0,      11km,    16km  ]
Stop B [  14,     11,       0,       7km  ]
Stop C [  18,     16,       7,       0    ]
Step 3 — Send to Lambda-G, get optimal visit order back.
Step 4 — Follow that order. Save fuel, time, and money.
USE CASES

One solver. Every domain.

If you need optimal ordering of points, Lambda-G solves it.

🚚
Logistics & Delivery
Last-mile delivery, field service routing, fleet optimization. Roads aren't straight — send a distance matrix with actual driving distances.
DISTANCE MATRIX
📦
Warehouse Picking
Order fulfillment paths, picker routes. Flat floor, straight-line movement — send coordinates.
COORDINATES
Chip Design / VLSI
PCB drilling sequences, wire routing between components. Physical straight-line — send coordinates.
COORDINATES
🔬
DNA Sequencing
Fragment ordering in genome assembly. Non-Euclidean similarity scores — send a distance matrix.
DISTANCE MATRIX
🏭
CNC / Laser / 3D Printing
Toolpath optimization for cutting heads, laser paths, print sequences. Physical movement — send coordinates.
COORDINATES
🔭
Telescope Scheduling
Satellite pointing sequences, observatory scheduling. Angular distance — send coordinates.
COORDINATES
GET API KEY → READ THE DOCS
INPUT MODES

Send data any way you have it.

Coordinates, CSV, or distance matrix. We handle the rest.

📄
CSV Upload
Upload your .csv file directly. Two columns: x,y or lat,lng. Header optional. No preprocessing needed.
MULTIPART FORM
{ }
JSON Coordinates
Send a list of [x,y] pairs. Works with any coordinates — Euclidean, lat/lng, or warehouse positions.
APPLICATION/JSON
Distance Matrix
Send an n×n matrix when distance isn't Euclidean. Works for road networks, genomics, finance.
APPLICATION/JSON
📐
TSPLIB Format
Upload .tsp files directly. Same format used by academic benchmarks.
COMING SOON
CSV format: Two columns, comma separated. First row can be a header (auto-detected). Supports x,y · lat,lng · longitude,latitude · id,x,y (id column ignored). Max file size 10MB.
API DOCUMENTATION

Complete API Reference

Base URL: https://api.bitsabhi.com

POST /optimize

Optimize a TSP tour. Send coordinates, a distance matrix, or upload a CSV file.

HEADERS

NAMETYPEDESCRIPTION
AuthorizationrequiredBearer YOUR_API_KEY
Content-Typestringapplication/json or multipart/form-data

JSON BODY

PARAMTYPEDESCRIPTION
pointsarrayArray of [x, y] coordinates. Example: [[0,0], [100,0], [100,100]]. Use for straight-line domains.
matrixarrayn×n distance matrix. Use for road networks, custom distances, or any non-Euclidean domain. Provide either points or matrix, not both.
time_limitfloatMax optimization time in seconds. Default: 25.0
seedintRandom seed for reproducibility. Default: 137
return_tourboolInclude tour array in response. Default: true

CSV UPLOAD (multipart/form-data)

FIELDTYPEDESCRIPTION
csvrequiredCSV file with x,y columns
time_limitfloatMax optimization time in seconds
No data? Try our sample files:
sample_20cities.csv sample_50cities.csv

RESPONSE

{ "tour": [0, 3, 1, 2], // Optimal visit order (indices) "length": 341.42, // Total tour distance "improvement": 17.6, // % improvement vs nearest-neighbor "nn_baseline": 414.21, // Nearest-neighbor baseline length "elapsed": 2.34, // Actual compute time (seconds) "cities": 4, // Number of cities "algorithm": "v15-quantum-rust" }
GET /health

Check API status. No authentication required.

{ "status": "ok", "service": "lambda-g-api", "version": "2.1.0", "algorithm": "v15-quantum" }
GET /usage

Get your API key usage statistics.

HEADERTYPEDESCRIPTION
AuthorizationrequiredBearer YOUR_API_KEY
{ "email": "you@example.com", "plan": "builder", "max_cities": 1000, "lifetime": true, "history": [ {"date": "2026-03-10", "calls": 42, "cities_sum": 12500} ] }
ERRORS HTTP Status Codes
CODEMEANINGDESCRIPTION
200SuccessRequest completed successfully
400Bad RequestInvalid JSON, missing points, or less than 3 cities
401UnauthorizedMissing or invalid API key
403ForbiddenPlan limit exceeded (too many cities)
500Server ErrorInternal error — contact support
503UnavailableCompute backend temporarily down
Plan Limits:
Free: 100 cities, 5s  ·  Research: 500 cities, 25s  ·  Builder: 1,000 cities, 25s  ·  Pro: 10,000 cities, 60s  ·  Enterprise: Unlimited
PRICING

Simple. No subscriptions.

Pay once, use forever. No renewals, no surprises. Your API key works for life.

FREE
$0
forever
  • Up to 100 cities
  • JSON + CSV input
  • 5s time limit
  • Email support
RESEARCH
$0
forever · .edu email required
  • Up to 500 cities
  • Unlimited API calls
  • 25s time limit
  • Cite us in your papers
  • Email support
BUSINESS
$999
lifetime · one-time
  • Up to 5,000 cities per call
  • JSON + CSV + TSPLIB input
  • 60s time limit
  • Priority support
  • Commercial use
  • All future updates
ENTERPRISE
$4,999
lifetime · one-time
  • Unlimited API calls
  • Unlimited cities
  • On-premise deploy option
  • Custom time limits
  • White-label option
  • Dedicated support + SLA
📧 bits.abhi@gmail.com · Pay once, use forever · Lifetime = no renewals, ever