A comprehensive AI-powered delivery route optimization system designed for the Epilog challenge, helping logistics companies in Slovenia reduce fuel costs, delivery times, and environmental impact through intelligent route planning.
RouteOptimize is a full-stack application that combines advanced routing algorithms with an intuitive interface to optimize delivery routes for logistics companies, e-commerce deliverers, retail chains, and courier services. The system can achieve 15-25% reductions in kilometers driven, potentially saving medium-sized logistics companies 50,000-150,000 EUR annually.
- Multiple Algorithm Support: Two proven optimization strategies
- Distance-First: Minimizes total kilometers driven (lowest cost)
- Time-First: Maximizes on-time deliveries (best service)
- Real Road Distance Calculation: Integration with OSRM (OpenStreetMap Routing Machine) for accurate real-world routing
- Time Window Management: Respects delivery time constraints with configurable maximum lateness limits
- Vehicle Capacity Management: Considers weight limits and vehicle capabilities
- Pre-calculated Solutions: 6 ready-to-use optimization scenarios for common use cases
- Interactive Route Visualization: Leaflet-based mapping with color-coded routes
- Collapsible Sidebar: Toggle interface for maximum map viewing area
- Excel Upload Support: Easy data import for orders and vehicles
- Algorithm Comparison: Side-by-side comparison of optimization strategies
- Vehicle Filtering: Show/hide specific routes for detailed analysis
- Address Geocoding: Automatic conversion of addresses to coordinates with caching
- Vehicle Selection: Choose assigned vehicle and view route details
- Interactive Route Map: Visual representation of delivery sequence
- Delivery Tracking: Mark deliveries as completed in real-time
- Progress Monitoring: Track completion status throughout the day
- Sync with Admin System: Automatic updates when routes are optimized
- React: Modern UI framework
- Leaflet: Interactive mapping library
- Lucide React: Icon library
- XLSX: Excel file processing
- Python 3: Core optimization engine
- Flask: REST API framework
- CORS: Cross-origin resource sharing
- OSRM: Real road distance and route geometry
- Nominatim: Address geocoding (OpenStreetMap)
hackaton/
├── frontend/ # Admin React application
│ ├── App.jsx # Main admin interface
│ ├── solution_*.json # Pre-calculated optimization results
│ └── ...
├── backend/ # Python Flask API
│ └── backend_app.py # Optimization algorithms and API endpoints
└── driver-app/ # Mobile driver interface
└── App.js # Driver application
- Node.js (v14 or higher)
- Python 3.8+
- npm or yarn
- Navigate to the backend directory:
cd backend- Install Python dependencies:
pip install flask flask-cors- Start the backend server:
python backend_app.pyThe backend will run on http://localhost:5000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm startThe admin app will run on http://localhost:3000
- Navigate to the driver-app directory:
cd driver-app- Install dependencies:
npm install- Start the development server:
npm startThe driver app will run on http://localhost:3001
-
Upload Data
- Click "Upload Orders Excel" and select your orders file (must contain address, weight, priority, time windows)
- Click "Upload Vehicles Excel" and select your vehicles file (must contain ID, capacity, type)
-
Choose Optimization Strategy
- Select from 6 pre-calculated solutions:
- Simple Route: Basic distance optimization
- Eco-Friendly: Minimize CO2 emissions
- Electric Only: Use only electric vehicles
- Time Priority: Optimize for delivery windows
- 7h Shifts: Standard driver shifts
- Rainy Conditions: Bikes are excluded
- Select from 6 pre-calculated solutions:
-
Analyze Results
- View statistics: total distance, on-time deliveries, vehicle utilization
- Toggle visibility of individual vehicle routes
- Zoom and pan the map to examine specific areas
-
Collapse/Expand Sidebar
- Click the chevron button in the top-right of the sidebar to maximize map viewing area
-
Select Vehicle
- Open the driver app and view available vehicles
- Each card shows number of stops and total distance
- Tap a vehicle to view its route
-
Follow Route
- View the complete route on an interactive map
- See delivery sequence with numbered markers
- Current delivery is highlighted in color
- Completed deliveries show green checkmarks
-
Complete Deliveries
- Tap "Complete Delivery" when arriving at a stop
- Progress automatically updates
- View remaining deliveries at the bottom
-
Return to Vehicle Selection
- Use the back button to choose a different vehicle
- Routes sync automatically with admin app
Required columns:
Addressorstreet,house_number,postal_code,cityWeight(kg)orWeightorweightPriority(optional: standard, urgent)WindowStart(optional: HH:MM format)WindowEnd(optional: HH:MM format)OrderID(optional, auto-generated if missing)
Example:
OrderID | Address | Weight(kg) | Priority | WindowStart | WindowEnd
ORD0001 | Slovenska cesta 1, Ljubljana | 5.2 | standard | 09:00 | 12:00
ORD0002 | Trubarjeva 10, Ljubljana | 3.8 | urgent | 08:00 | 10:00
Required columns:
VehicleIDorIDCapacity(kg)orCapacityType(optional: van, truck, bike, electric)
Example:
VehicleID | Capacity(kg) | Type
VAN01 | 1000 | van
BIKE01 | 30 | bike
TRUCK01 | 3000 | truck
Optimize routes using both algorithms.
Request:
{
"orders": [...],
"vehicles": [...]
}Response:
{
"algorithms": {
"distanceFirst": {
"name": "Distance-First",
"routes": [...],
"stats": {...}
},
"timeFirst": {
"name": "Time-First",
"routes": [...],
"stats": {...}
}
}
}Recalculate routes with real OSRM road distances.
Get list of available vehicles for driver app.
Get detailed route for specific vehicle.
Update routes available to driver app.
Health check endpoint.
- Goal: Minimize total kilometers driven
- Strategy: Assigns orders to nearest available vehicle with capacity
- Use Case: Cost optimization, fuel savings
- Constraint: Maximum 240 minutes lateness allowed
- Goal: Maximize on-time deliveries
- Strategy: Prioritizes orders by urgency and time windows
- Use Case: Customer service optimization, premium deliveries
- Constraint: Maximum 120 minutes lateness allowed
- Estimated Distance: Quick Euclidean calculation for comparisons
- Road Multiplier: 1.3x multiplier for realistic routing estimates
- OSRM Integration: Precise real road distances when recalculation is triggered
The system tracks comprehensive statistics for each optimization:
- Total Distance: Sum of all route kilometers
- Assigned Orders: Number of successfully routed deliveries
- Unassigned Orders: Orders that couldn't be assigned
- Vehicles Used: Number of vehicles with routes
- On-Time Deliveries: Deliveries within time windows
- Late Deliveries: Deliveries exceeding time windows
- Average Lateness: Mean lateness in minutes
- Average Utilization: Mean vehicle capacity usage percentage
By reducing delivery distances by 15-25%, RouteOptimize helps address Slovenia's transport-related CO2 emissions (27% of total emissions). A medium-sized logistics company can expect:
- 50,000-150,000 EUR annual savings
- Significant reduction in fuel consumption
- Lower carbon footprint
- Improved operational efficiency
- Automatically caches geocoded addresses in browser localStorage
- Prevents repeated API calls for known addresses
- View cache count in sidebar
- Clear cache button available
- Nominatim API: 1 request per second (respected automatically)
- OSRM API: Unlimited for self-hosted instances
If you see "Couldn't connect to optimization backend":
- Ensure Python backend is running:
python backend_app.py - Check backend is on port 5000
- Verify no firewall blocking localhost connections
If addresses fail to geocode:
- Check address format includes city/country
- Verify internet connection
- Clear geocoding cache and retry
- Consider more specific addresses
If map doesn't display:
- Check browser console for errors
- Verify Leaflet CDN is accessible
- Clear browser cache
- Try different browser
If driver app shows no routes:
- Run optimization in admin app first
- Select an algorithm in admin app
- Ensure backend is running
- Refresh driver app
- Multi-depot support
- Dynamic route updates (real-time order additions)
- Traffic integration
- Driver break time optimization
- Historical data analysis
- Route comparison history
- Export to PDF/Excel
- Mobile notifications
- GPS tracking integration
This project was developed for the Epilog challenge. For questions or contributions, please contact the development team.
[Specify your license here]
- OpenStreetMap for mapping data
- OSRM for routing engine
- Nominatim for geocoding services
- Leaflet for mapping library
- The logistics companies who provided feedback during development
Version: 1.0
Last Updated: November 2025
Developed for: Epilog Challenge - Smart Technologies in Logistics