GitHub: https://github.com/omemai
Van Route Optimizer is a backend-driven route optimization system that integrates real-world APIs with algorithmic optimization to solve a practical logistics problem.
The system ingests live delivery data from Google Sheets, constructs a distance matrix using the Google Maps Distance Matrix API, solves a multi-vehicle routing problem, and writes structured results back to the source.
This project demonstrates applied optimization, API-driven backend design, and modular system architecture in a production-style Python environment.
- Multi-vehicle route optimization (Vehicle Routing Problem)
- Google Sheets integration for live operational data
- Google Maps Distance Matrix API integration
- Intelligent distance caching to reduce redundant API calls
- Agent-based orchestration and validation layer
- Secure environment-based API key management
- Modular backend architecture designed for scalability
- Read stop and depot data from Google Sheets
- Validate and normalize address inputs
- Retrieve distance and duration matrices from Google Maps
- Construct and solve a Vehicle Routing Problem (VRP)
- Assign optimized stop sequences to each vehicle
- Calculate total route distance and duration per van
- Write structured route results back to Google Sheets
The project follows a clean separation-of-concerns backend design:
- main.py — Entry point and orchestration
- sheets.py — Google Sheets I/O layer
- maps.py — Distance matrix retrieval and caching
- optimizer.py — Core routing and optimization logic
- formatter.py — Structured output formatting
- agent.py — Execution coordination and validation
The architecture isolates business logic from infrastructure layers, enabling maintainability, extensibility, and future integration of additional optimization constraints.
Below is an example of optimized route assignments written back to Google Sheets:
