Optimizing multi-stop errands through intelligent route planning

OnTheWay

Problem

Everyday errand planning is inherently inefficient. Users often need to visit multiple destinations—such as grocery stores, banks, coffee shops, and retail chains—but most navigation tools are built around single-destination routing. Store-finder websites and traditional map apps do not support optimizing across sets of possible locations, forcing users into manual searching, route comparison, and unnecessary driving.

Solution

OnTheWay is designed to optimize multi-stop errands by intelligently calculating the most efficient route across several destinations. By allowing users to specify the types of stops they need — or even specific store chains — OnTheWay computes the best combination of locations and presents a streamlined route that minimizes travel time and distance.

System Design & Technical Approach

Multi-Stop Optimization Engine

At the core of OnTheWay is a route optimization engine that treats each stop as a set of candidate locations rather than a single point. For each stop type, the app:

  • Queries nearby locations using Google Maps and Yelp APIs
  • Filters and ranks candidates based on distance, direction of travel, and user constraints
  • Evaluates route permutations to determine the lowest-cost path across all stops

This approach resembles a constrained variant of the Traveling Salesperson Problem, optimized for real-world performance by pruning unlikely routes and limiting the search space.

Routing & Cost Modeling

Routes are scored using a weighted cost function that accounts for:

  • Total travel distance and estimated time
  • Backtracking and directional inefficiencies
  • Real-world road network constraints (turn penalties, highways vs. surface streets)

The optimal route is recalculated dynamically as stops are added, removed, or reordered.

OnTheWay
OnTheWay

Mapping & Visualization

OnTheWay leverages Apple Maps for displaying, but uses the Google Maps API on the backend for querying potential locations.

  • Display candidate locations and the selected route in real time
  • Visually differentiate stop categories and chosen locations
  • Provide turn-by-turn navigation using system-level map services
  • Included an onboarding flow to help users understand the app and how to use it

The UI is designed to keep the optimization process transparent while minimizing cognitive load for the user.

Performance Considerations

To maintain responsiveness on mobile devices:

  • Location searches and route evaluations are performed asynchronously
  • Intermediate results are cached to avoid redundant API calls
  • The optimization algorithm is tuned to balance accuracy with speed, ensuring near-instant feedback even with multiple stops

Results & Impact

By optimizing errands into a single, efficient route, OnTheWay helps users save time, reduce fuel consumption, and lower their environmental footprint. The app transforms fragmented, inefficient trips into a cohesive journey—allowing users to complete all their errands on the way to each other.

Key Features

  • Multi-stop route planning across location categories or brands
  • Intelligent selection of optimal locations within each stop set
  • Real-time map-based route visualization
  • Seamless handoff to navigation
  • Onboarding flow to help users understand the app and how to use it
OnTheWay