A Decision Support System (DSS) for optimizing last-mile delivery networks using Mixed Integer Linear Programming (MILP).
UrbanLogistics AI is an analytical tool designed to solve the Capacitated Facility Location Problem (CFLP) for quick-commerce (q-commerce) companies. It helps strategic decision-makers minimize operational costs while maximizing customer coverage.
Unlike simple distance-based heuristics, this project uses a mathematical optimization engine (PuLP) to determine:
- Where to open "Dark Stores" among candidate locations.
- Which customers should be assigned to which depot.
- How to balance capacity constraints and service level agreements (SLA).
In the competitive landscape of quick commerce (e.g., Getir, Gopuff, Gorillas), logistics costs and delivery speed are the key differentiators.
- Challenge: Opening too many depots increases CAPEX and OPEX (Rent). Opening too few leads to long delivery times and customer churn.
- Goal: Find the "sweet spot" that minimizes total cost (Rent + Transportation) while ensuring delivery times are under a specific threshold (e.g., <15 mins).
This project bridges Data Science and Industrial Engineering:
- Synthetic Data Generation: Simulates realistic customer clusters (Gaussian Blobs) and candidate sites with variable rent costs based on city center proximity.
-
Mathematical Modeling (MILP):
-
Objective Function: Minimize
$Z = \sum (Fixed Costs) + \sum (Variable Transportation Costs)$ . -
Constraints:
- Capacity Constraints (Depots cannot exceed max daily orders).
- Assignment Constraints (Each customer assigned to exactly one depot).
- Service Range Constraints (Max distance e.g., 8km).
- Budget Constraints (Max number of depots).
-
Objective Function: Minimize
- Visualization: Interactive "Spider Maps" to visualize the supply chain network and KPI dashboards for financial impact analysis.
- Language: Python
- Optimization: PuLP (Linear Programming Solver)
- Web Framework: Streamlit
- Geospatial Analysis: Folium, Geopy
- Visualization: Plotly Express, Plotly Graph Objects
- Data Manipulation: Pandas, NumPy
-
Clone the repository
git clone https://github.com/Farslan-x/UrbanLogistics-AI.git cd UrbanLogistics-AI -
Create a Virtual Environment (Optional but recommended)
python -m venv venv # Windows venv\Scripts\activate # Mac/Linux source venv/bin/activate
-
Install Dependencies
pip install -r requirements.txt
-
Run the App
streamlit run app.py
- Integration with real-world traffic data (OSRM / Google Maps API).
- Demand forecasting module using Time Series Analysis (ARIMA/Prophet).
- Multi-objective optimization (minimizing CO2 emissions).

