- Find the most time-efficient route between multiple locations using the Google Distance Matrix API and an optimization algorithm.
- Supports driving, walking, biking, and public transport.
Streamlit app link: https://routes-maps.streamlit.app/
- Add and edit a list of addresses dynamically
- Select start and end points independently
- Choose transportation mode (driving, walking, biking, public transport)
- Optimize route using the Traveling Salesman Problem formulation with constraints
- Generate a link to the optimized route directly on Google Maps
- Display the route on an embedded map
For macOS / Linux:
python3 -m venv .venv
source .venv/bin/activateFor Windows:
python -m venv .venv
.venv\Scripts\activatepip install -r requirements.txtstreamlit run main.pyTo deactivate the virtual environment when you're done:
deactivateThis app uses the Google Routes API to calculate travel times between addresses, then applies a Linear Programming model to find the shortest-duration route based on:
- Start and end location
- Selected travel mode (car, walk, bike, public transport)
It supports both circular (round-trip) and open (point-to-point) route planning.
.
├── main.py # Streamlit app
├── aux.py # Route calculation and API integration
└── requirements.txt
- Ensure all addresses are valid and correctly formatted.
- API responses may vary based on limits and usage quota.
