Work / 2025
Voyager
Finds the stores near you and the shortest route that visits every one of them.
Problem
Running errands across several stores turns into guessing which order to drive them in. Voyager takes a search (“pharmacy”, “hardware store”), finds the nearby locations, and returns the order that keeps total travel shortest.
Key decisions
A heuristic instead of an exact solver. Visiting every stop in the shortest order is the travelling salesman problem, and the exact answer gets exponentially slower as stops are added. Voyager uses 2-opt on the server: start from a reasonable tour and keep reversing any segment that makes it shorter, until no swap helps. It’s fast enough to feel instant for errand-sized routes and gets close to optimal. The tradeoff is that it can stop at a local minimum. Try the 2-opt visualizer in the lab.
Routing on the server, not in the browser. The optimization runs in an Express service so the Maps API key and distance lookups stay off the client, and the frontend only renders the result.
Server state and UI state kept apart. TanStack Query owns everything fetched (places, distances, the solved route), with caching and retries. Zustand holds what the user is doing: selected stops, the active route and map focus. Neither library has to pretend to be the other.
A full-screen dark map. The map is the interface. Controls sit over it instead of beside it, so the route stays the largest thing on screen.
Result
Deployed and usable at the live link.
Production notes
- Cost: distance lookups are the paid part of the Maps API.
- Security: the API key lives on the server.
- Latency: