Plan a bakery’s deliveries
VROOM, an open-source route optimizer compiled to WebAssembly, plans a Seattle bakery’s deliveries in your browser. On a busy Saturday, it cuts 5 h 34 min of driving to 3 h 12 min.
Plan the day
VROOM saves 2 h 22 min of driving and 74.0 mi, 43% less.
Each van takes at most 19 of the 42 boxes: 1.3 times its share.
Tap a place on a map, or tick it in the list below, to add or remove its order. VROOM plans again each time.
Both plans for a busy Saturday, worked out in advance by the same solver. With JavaScript on, you can change the orders and the vans.
Driving time from the bakery, without traffic
- 5
- 10
- 15
- 20
- 25
- 30 min
- Van A
- Van B
- Van C
- Van D
- The bakery
- A place with no order
- 10 and 20 min from the bakery
Map data © OpenStreetMap contributors
The same day, in time
Up is time. A van’s line leans while it drives and climbs straight up while it hands an order over, so the plan that keeps its vans out longer stands taller.
Drag a cube sideways to turn both, or focus one and use the arrow keys.
All 63 places
Stop by stop, both plans
| Stop | Place and order | Boxes | Arrives after |
|---|---|---|---|
| Van A: 7 stops, 14 boxes, 1 h 39 min of driving, 41.9 mi | |||
| A1 | Hing Hay Park Pineapple buns, 2 dozen, 6 min from the bakery | 2 | 6 min |
| A2 | Judkins Park Brownies for a soccer team, 10 min from the bakery | 2 | 14 min |
| A3 | Ballard library Quiet cookies, 2 dozen, 13 min from the bakery | 2 | 40 min |
| A4 | Jefferson Park Hot cross buns, 18, 9 min from the bakery | 2 | 1 h 5 min |
| A5 | Kinnear Park Scones and jam, 18, 5 min from the bakery | 2 | 1 h 21 min |
| A6 | U District market Marionberry hand pies, 2 dozen, 8 min from the bakery | 3 | 1 h 37 min |
| A7 | Kerry Park 12 croissants with a view, 5 min from the bakery | 1 | 1 h 52 min |
| Van B: 7 stops, 15 boxes, 2 h 32 min of driving, 78.3 mi | |||
| B1 | Kubota Garden Mochi doughnuts, 2 dozen, 18 min from the bakery | 2 | 18 min |
| B2 | Gas Works Park 2 dozen maple bars for kite flyers, 8 min from the bakery | 2 | 45 min |
| B3 | Mercer Island library Palmiers, 3 dozen, 16 min from the bakery | 1 | 1 h 10 min |
| B4 | Alki Beach Beach-day snickerdoodles, 3 dozen, 18 min from the bakery | 2 | 1 h 39 min |
| B5 | Volunteer Park A tiered cake for a picnic, 7 min from the bakery | 3 | 2 h 5 min |
| B6 | South Park library Empanadas, 30, 15 min from the bakery | 3 | 2 h 26 min |
| B7 | Cal Anderson Park Rainbow sprinkle doughnuts, 2 dozen, 5 min from the bakery | 2 | 2 h 46 min |
| Van C: 6 stops, 13 boxes, 1 h 23 min of driving, 28.6 mi | |||
| C1 | International Fountain Mini cupcakes, 48, 3 min from the bakery | 2 | 3 min |
| C2 | Pioneer Square Coffee cake, 4 loaves, 6 min from the bakery | 2 | 14 min |
| C3 | Leschi Park Focaccia slabs, 3, 13 min from the bakery | 2 | 27 min |
| C4 | Fremont market Bagels by the baker’s dozen, 3 bags, 8 min from the bakery | 3 | 49 min |
| C5 | Golden Gardens S’mores bars for a beach fire, 19 min from the bakery | 2 | 1 h 6 min |
| C6 | Ravenna Park Rye loaves, 6, 10 min from the bakery | 2 | 1 h 27 min |
| Stop | Place and order | Boxes | Arrives after |
|---|---|---|---|
| Van A: 9 stops, 19 boxes, 1 h 3 min of driving, 21.1 mi | |||
| A1 | Ravenna Park Rye loaves, 6, 10 min from the bakery | 2 | 10 min |
| A2 | U District market Marionberry hand pies, 2 dozen, 8 min from the bakery | 3 | 16 min |
| A3 | Gas Works Park 2 dozen maple bars for kite flyers, 8 min from the bakery | 2 | 26 min |
| A4 | Fremont market Bagels by the baker’s dozen, 3 bags, 8 min from the bakery | 3 | 32 min |
| A5 | Ballard library Quiet cookies, 2 dozen, 13 min from the bakery | 2 | 43 min |
| A6 | Golden Gardens S’mores bars for a beach fire, 19 min from the bakery | 2 | 53 min |
| A7 | Kinnear Park Scones and jam, 18, 5 min from the bakery | 2 | 1 h 13 min |
| A8 | Kerry Park 12 croissants with a view, 5 min from the bakery | 1 | 1 h 18 min |
| A9 | International Fountain Mini cupcakes, 48, 3 min from the bakery | 2 | 1 h 23 min |
| Van B: 9 stops, 18 boxes, 1 h 53 min of driving, 49.4 mi | |||
| B1 | Pioneer Square Coffee cake, 4 loaves, 6 min from the bakery | 2 | 6 min |
| B2 | Hing Hay Park Pineapple buns, 2 dozen, 6 min from the bakery | 2 | 11 min |
| B3 | Leschi Park Focaccia slabs, 3, 13 min from the bakery | 2 | 23 min |
| B4 | Judkins Park Brownies for a soccer team, 10 min from the bakery | 2 | 32 min |
| B5 | Mercer Island library Palmiers, 3 dozen, 16 min from the bakery | 1 | 47 min |
| B6 | Jefferson Park Hot cross buns, 18, 9 min from the bakery | 2 | 1 h 5 min |
| B7 | Kubota Garden Mochi doughnuts, 2 dozen, 18 min from the bakery | 2 | 1 h 22 min |
| B8 | South Park library Empanadas, 30, 15 min from the bakery | 3 | 1 h 36 min |
| B9 | Alki Beach Beach-day snickerdoodles, 3 dozen, 18 min from the bakery | 2 | 1 h 58 min |
| Van C: 2 stops, 5 boxes, 16 min of driving, 4.3 mi | |||
| C1 | Volunteer Park A tiered cake for a picnic, 7 min from the bakery | 3 | 7 min |
| C2 | Cal Anderson Park Rainbow sprinkle doughnuts, 2 dozen, 5 min from the bakery | 2 | 15 min |
How it works
The solver is VROOM 1.15.0, compiled from its C++ source to WebAssembly. It runs in a Web Worker in your browser, so planning sends nothing anywhere. The drive times come from OSRM’s car profile over OpenStreetMap roads, worked out once for every pair of the 64 places: 4,032 legs. They assume no traffic.
What VROOM is
VROOM is an open-source solver for vehicle routing problems. Give it places to visit, vans that hold so many boxes, and the time to drive between every pair of places, and it looks for the routes with the least total driving. The exact best plan takes far too long to find once there are more than a few stops, so VROOM builds a good plan quickly, then moves and swaps stops between routes until no change makes the day shorter.
What the colour bands are
Each band is an isochrone: the area a van reaches from the bakery within a set time. The band around the bakery is 5 minutes away, and each band after it adds 5 minutes, up to 30. A line marks where 10 and 20 minutes end on land. A band that reaches far along a road marks a fast road. A gap marks water, a park or a port with no street to drive. The list of places, the tables and the tip over each place give its drive time from the bakery as text.
The two plans
As the orders came in: the orders are dealt to the vans in turn, like cards, and each van drives its orders in the order they arrived, from the bakery and back. Planned by VROOM: the same orders and the same vans, with the total driving as short as VROOM can make it. Up to 30 orders, each stop on the map carries its number in its van’s run. Every van holds the boxes for 1.3 times its share of the day, so both plans fit, and VROOM still has to balance the loads. So a van’s room changes with the number of vans: the share does not.
In VROOM’s plans, one van drives the least, but it is back last. More vans finish the day sooner, which is what the line under each map shows: when the last van is back, handing over every order included. VROOM looks for the least total driving, not the earliest finish, so with more vans than the day needs it may leave one at the bakery, or give one a short run.
What it costs
Nothing to run. Every file is static, and your browser does the planning.
How it is built
VROOM is C++. Emscripten 6.0.13 compiles it to one WebAssembly file of 344 KB, gzip, which the page fetches only once there is something to plan. It runs in a Web Worker, so the page never waits on a solve. Only the solver’s own folder may compile WebAssembly: its files carry a Content Security Policy of their own, and no page’s policy allows it.
The drive times and the roads for all 4,032 legs between the 64 places were worked out once, from OpenStreetMap with OSRM, and ship as one file of 57 KB, gzip. Without JavaScript, the page shows the plans the build made by running the same WebAssembly in Node.
Credits
Map data © OpenStreetMap contributors, under the Open Database License. The places are public parks, gardens, beaches, viewpoints, libraries, markets and landmarks; the bakery and every order are made up.
VROOM is © Julien Coupey and contributors, under the BSD 2-Clause License. The licences of everything compiled into the solver are in LICENSES.txt.