Fuel Route Optimizer
Give it any two places in the U.S. and it plans where a truck with a 500-mile range should refuel, how many gallons to buy at each stop, and what the trip will cost.
Stops come from a dynamic program over station and fuel level, so the plan is cost-optimal rather than "fill up at the cheapest pump nearby".
- One routing-provider call per new route and zero on a cache hit. Start and finish are geocoded locally from Census data.
- Stations are matched to the route with a KD-tree over 3D unit vectors, so distances stay correct coast to coast.
- 6,620 of 6,626 stations in the price feed geocoded; the loader reports the other 6.
- Plans cached 24 hours in Redis, keyed by data version, so a new price file never serves a stale plan.
- Tests replay saved provider responses and never hit the live API.
# real response, trimmed { "start": "Dallas, TX", "finish": "Houston, TX" } { "route_miles": 238.7, "fuel_stops": [{ "name": "One9 #1248", "city": "Wilmer", "state": "TX", "route_point": { "mile_marker": 16.0 }, "price": 2.756, "gallons": 23.89, "cost": 65.84 }], "total_fuel_cost": 65.84, "meta": { "external_api_calls": 1, "elapsed_ms": 186.6 } }