Loading DuckDB & station data…
Bike-share operators constantly move bikes between stations, by truck and trailer, often overnight. They take them from stations that fill up and deliver them to stations that run empty, so riders find a bike (and an open dock) when they need one. This is an interactive look at that problem, using a day of real Citi Bike trip data for Manhattan.
Each dot is a station. Blue means a surplus: more bikes arrive than leave, so they pile up and need picking up. Red means a deficit: more bikes leave than arrive, so the station runs short and needs bikes dropped off. The lines are vehicle routes carrying bikes from the blue stations to the red ones.
Click a vehicle, a station, or a station in the ranking to focus it. Adjust the fleet (bike trailers carry 3 bikes, cargo vans 12, box trucks 30) and watch the routes re-solve.
The routing is solved from scratch. No mapping API does the optimization. Built by Keith Troutt with Claude Code.
The problem. This is a capacitated pickup-and-delivery routing problem, a cousin of the traveling salesman problem. Trucks start at a depot, pick up bikes from surplus stations, drop them at deficit ones, and return, without ever carrying more than their capacity. The goal is to satisfy every station's need with the least total driving. It's the same problem Citi Bike's operations team actually solves. The research-grade version uses integer programming for exact answers, while this tool uses a faster heuristic so it can re-solve interactively as you change the inputs.
The data. Station locations and demand come from a representative weekday of real Citi Bike trips. A station's demand is its net flow, meaning bikes arriving minus bikes leaving over the day. Stations that stay one-directional (always emptying or always filling) are the ones that need a visit. Balanced stations barely register. Real Citi Bike rebalancing uses everything from 3-bike trailers to box trucks carrying a few dozen bikes, and this models that mix: trailers carrying 3, cargo vans carrying 12, box trucks carrying 30. The fleet finder prices each option with rough cost estimates, including time-and-a-half overtime for routes that run past an 8-hour overnight shift, so the dollar figures are illustrative, not quotes.
Reading a focused vehicle. Click a vehicle to follow it. The load profile chart shows its inventory at every stop, from depot to depot, against its capacity. When a bar hits the ceiling, the vehicle is full, which is often why its route loops back: it can't pick up more until it drops some off. Drag across the chart to scrub the vehicle along its route and read its exact load at each stop.
Net flow by hour. Click a station to see its imbalance across the day. Many stations swing, with a surplus in the morning and a deficit in the evening. That commuter pattern is what creates the whole problem.
A finding. Bigger fleets don't always help: more routes can add total distance, and small vehicles can never serve the biggest stations. The cheapest plans often accept a little overtime rather than dispatch another truck, and sometimes park a spare vehicle outright. Most decisive is the depot itself: move it and the best fleet changes.
Every mix of bike trailers, cargo vans, and box trucks up to 8 vehicles, each solved for real. Costs are rough estimates: a fixed dispatch cost per vehicle that rolls, a per-mile rate, and time-and-a-half overtime past the 8-hour overnight shift. One heroic box truck is cheap on paper; 15 hours of overtime prices it out.