Open-Source Transit Solver

Visit every station,
as fast as possible.

Near-optimal route computation on time-expanded GTFS graphs with LP relaxation bounds.

3 cities Solved
160K+ TEG nodes
LP bound Optimality proof

London Underground

272 stations 16h45m →

NYC Subway

475 stations 21h35m →

Berlin U-Bahn

170 stations 7h53m →
Background

London Tube Challenge

Visit all 272 Underground stations as fast as possible. The Guinness World Record is 17h45m. The automated solver achieves 16h45m, one hour faster than any human attempt.

Automated Solver 16h45m
Guinness World Record 17h45m
60 minutes faster
Read the writeup: 60 minutes faster than the world record →
Planning

Best Day to Attempt

Scored across service schedules, weather forecasts, planned disruptions, and historical delay patterns.

Service
--
Weather
--
Disruptions
--

--

Updated --. Service data from GTFS timetables. Weather from Open-Meteo. Disruptions from TfL API / GTFS exceptions.

How It Works

Algorithm Pipeline

01

Time-Expanded Graph

Build a directed graph from GTFS timetable data. Each node is a (station, time) pair. Edges are train legs, waiting arcs, and walking transfers.

160K nodes / 1.26M edges
02

Hard Stations + Randomized Search

Auto-detect hard stations, pair with junctions. k=5 NN with urgency scoring + epsilon-greedy randomized search over thousands of trials.

272/272 stations covered
03

LP Relaxation Bound

Flow-based LP gives a provable lower bound. The optimality gap quantifies how close the heuristic solution is to optimal.

7h43m lower bound
Details

Technical Details

Time-Expanded Graph

Unlike classical TSP, transit networks are time-dependent. Each node is a (station, departure_time) pair. Edges represent train legs, waiting arcs, and walking transfers.

Covering TSP

Visit a required set of nodes without returning to start. NP-hard in general. We use heuristics and compute LP relaxation bounds to prove solution quality.

GTFS Pipeline

Parses any city's General Transit Feed Specification data. Handles calendar filtering, service patterns, and computes walking transfers via KDTree spatial index.

LP Relaxation

Relaxing integer constraints gives a valid lower bound on the optimal solution. The integrality gap proves solution quality without exhaustive search.