Inspiration
Planning errands looks easy until the parcel counter closes at 4:30 and you're stuck in traffic. The usual advice is "go to the nearest stop first," but that ignores two things: travel time is uncertain, and some stops have deadlines. I wanted to know whether planning for bad days, not just the average day, actually gets more errands finished before you have to be home. That fits this year's theme, a more efficient way to live.
What it does
ErrandLab takes a list of stops (opening windows, visit lengths, priorities, a deadline to be home) and compares four ways of ordering them:
- the order you entered
- nearest stop first
- a fixed-time optimizer that assumes average traffic
- delay-aware routing, which tests every order against many simulated traffic days
For each strategy it shows the chance of finishing every stop and getting home on time, plus the median and 90th-percentile outing length. Capi, a capybara guide, answers questions about the app and your results.
Try it: https://errand-lab.streamlit.app
How I built it
The whole engine is Python. Traffic is modelled as mean-one lognormal multipliers with a shared daily effect and independent effects on each leg. For every possible stop order $\pi$, delay-aware routing scores 48 training days:
$$ \text{score}(\pi) = \bar{U}\pi + \lambda \, \bar{U}^{\,\text{worst 20\%}}\pi, \qquad \lambda = 0.35 $$
where $U = \text{points} - 2\cdot[\text{late}]$. So it rewards a good average and a good worst-case fifth of days. The chosen orders are then compared on 600 separate held-out days, with common random numbers so every strategy faces identical traffic, and paired resampling gives 95% simulation intervals. The interface is Streamlit, Capi chat uses Groq, and results export as JSON.
What the evidence says (honestly)
| Test | Result |
|---|---|
| Closing-time scenario | 50.8% full success vs 2.3% for nearest stop |
| 300 random outings vs nearest stop | +13.3 percentage points on average |
| vs fixed-time optimizer | −0.25 points on average |
| vs best of all baselines in each case | −1.5 points on average |
Delay-aware routing helps most when closing times are tight, and often just ties otherwise. A sweep over traffic spread and the downside weight $\lambda$ showed $\lambda = 0$ scored best, so the default isn't tuned, and I say so in the repo.
Challenges
- A hand-picked demo isn't evidence. I replaced it with 300 random cases and a sensitivity sweep, and reported the results that went against the idea.
- Checking against reality. I compared the model's timing assumptions with 20 real errand outings from the 2022 National Household Travel Survey. Total outing time was close on average (+0.7 min), but driving time was overpredicted by about 49 minutes. The six-minutes-per-kilometre assumption is too slow.
- Staying honest. Everything beyond the 20 outings is simulation, not a real-world savings estimate.
What I learned
Optimizing for the worst days is a trade-off, not a free win. Good evidence often means finding where your idea doesn't help. And a deployed, tested app matters as much as the algorithm.
What's next
Calibrate the travel-time model on real outings, collect my own predicted-versus-actual data, and test the optimizer on real road networks.
AI use
I used AI coding assistants to help write code. I defined the problem, the traffic model, the objective and the evaluation, and I disclose this in the README.
Code: GitHub repo