An end-to-end intelligent logistics optimization system integrating Capacitated Vehicle Routing Problem (CVRP) modeling, Google OR-Tools optimization, LLM-based business analysis, and interactive agent-based scenario replanning.
This project simulates a real-world last-mile delivery scenario, where a fleet of vehicles must deliver parcels from a central depot to multiple customers under strict capacity constraints.
The system provides a complete pipeline for data-driven logistics decision-making:
- Optimization-based routing (OR-Tools)
- Baseline heuristic comparison
- KPI-driven performance evaluation
- LLM-powered interpretation of results
- Agent-based interactive replanning via a Streamlit dashboard
The core routing engine optimizes the standard CVRP objective—minimizing total transportation cost while satisfying rigid physical constraints:
Objective Function:
Capacity Constraint:
- Modeled as CVRP (Capacitated Vehicle Routing Problem).
- Single depot + multiple customer nodes.
- Fixed vehicle capacity constraint.
- Greedy nearest-neighbor heuristic.
- Google OR-Tools routing solver (Guided Local Search).
- Total distance, Total cost, Vehicles used, Average load utilization, Cost per parcel.
- Converts optimization results into human-readable business insights.
- Supports natural language queries for dynamic replanning (e.g.,
"replan with capacity 120","compare baseline and ortools").
Clone the repository and install the required packages:
git clone https://github.com/kangwooho0126-prog/Intelligent-Last-Mile-Logistics-Optimization-System.git
cd Intelligent-Last-Mile-Logistics-Optimization-System
pip install -r requirements.txtStart the Streamlit web application to access the OR-Tools solver and the LLM Agent:
streamlit run app/streamlit_app.pyAlternatively, run the core backend solver directly:
python main.py| Metric | Baseline (Greedy) | OR-Tools (Optimized) | Improvement |
|---|---|---|---|
| Total Distance | 1146.40 km | 787.08 km | ↓ 31.34% |
| Total Cost | $3839.20 | $2761.25 | ↓ 28.08% |
| Vehicles Used | 5 Trucks | 5 Trucks | = |
| Load Utilization | 82.0% | 82.0% | = |
"Optimization improves delivery efficiency primarily through better route structuring (reducing overlapping paths and deadhead miles), rather than increasing logistics resources."
The integrated LLM Agent allows dispatchers to dynamically interact with the system using natural language.
User Query:
> "replan with capacity 120"
System Action & Output:
- Intent Parsing: Agent identifies the intent to change
MAX_CAPACITYconstraint to 120. - Re-Optimization: Triggers the OR-Tools solver seamlessly with the new parameters.
- LLM Summary: Generates a comparative business report detailing how the reduced capacity impacts fleet utilization and operational costs, displaying the new metrics directly on the Streamlit dashboard.