The question
When a corridor slows down or closes, which available route has the lowest cost? The answer changes when a rider prefers fewer transfers.
FROM LEETCODE TO THE NEXT STOP
Compare routes. Change the conditions. See the algorithm think.
A model you can explore. 17 selected stations, compressed corridors, and invented travel times. The route lab is not live MTA information or a real journey planner. Step-free labels are teaching fixtures.
NETWORK EXPLORER
OFFICIAL FEED OBSERVATIONS
Fetch an official MTA subway feed and inspect upcoming stop-time predictions. This view does not alter the simulated route lab.
Raw GTFS stop IDs are shown for transparency. Predictions are not guaranteed arrivals. Manual refresh; 30-second request cooldown.
No live data loaded yet.
| Route | Stop ID | Predicted time ET | Minutes from fetch |
|---|
Up to 40 predictions in the next hour, sorted by timestamp. Missing predictions do not prove that a line has no service. A feed older than 90 seconds is labeled stale; this threshold is a project policy.
THE PROJECT IN SIX PARTS
When a corridor slows down or closes, which available route has the lowest cost? The answer changes when a rider prefers fewer transfers.
Stations become vertices. Bidirectional corridor segments become weighted edges. A search state contains both the station and the incoming line so that transfers are counted correctly.
Score = ride minutes + simulated delays + 4 minutes per transfer + preference penalty per transfer. The preference penalty affects ranking, not displayed journey minutes.
Dijkstra uses a binary min-heap to expand the cheapest state. Parent links reconstruct the winning path. It is optimal for this model because all transition costs are nonnegative.
The route lab excludes timetables, train waiting time, direction-specific service, real elevator status, and live arrivals. Step-free filtering applies to every modeled station, even through stations. This is deliberately conservative and simplified.
Import official GTFS topology and schedules, add GTFS-RT updates through a backend, model platform access and transfers, then validate against real trips before offering travel advice.
MTA developer resources ↗ · GTFS Schedule specification ↗ · GTFS Realtime specification ↗
The included network is authored for teaching and is not imported from these feeds. Independent student project; no MTA affiliation.