A production-grade logistics intelligence system inspired by Delhivery's hub-and-spoke delivery network — combining graph analytics, ML-based ETA prediction, and an interactive Streamlit dashboard to help operations teams reduce delays, detect bottlenecks, and make smarter routing decisions.
This project addresses a core challenge in last-mile and inter-city logistics: ETA accuracy. By modeling the delivery network as a directed graph and engineering graph-aware features (betweenness centrality, corridor risk scores, segment delay ratios), the system substantially outperforms a distance-only baseline model while providing explainable, actionable operational intelligence.
| Capability | Description |
|---|---|
| Graph Network Analysis | Directed hub-and-spoke graph built from 2,783 corridors and modeled with NetworkX |
| Bottleneck Detection | Betweenness-centrality-based identification of critical transit hubs |
| ETA Prediction | Graph-enhanced ML model (LightGBM/XGBoost) vs. distance-only baseline |
| Corridor Risk Scoring | Composite risk score combining delay ratio and trip volume |
| FTL vs Carting Intelligence | Data-driven mode recommendation engine with mismatch detection |
| SLA Breach Analysis | Trip-level and corridor-level SLA monitoring with breach attribution |
| Interactive Dashboard | 7-page Streamlit analytics platform for operations leadership |
ETA Optimization/
├── data/
│ ├── raw/ # Raw Delhivery delivery data
│ └── cleaned/
│ ├── cleaned_data.csv # Pre-processed trip data
│ ├── graph_data.csv # Aggregated corridor-level stats (2,783 corridors)
│ └── graph_featured_data.csv # Full dataset with engineered graph features
│
├── notebooks/
│ ├── 01_data_understanding.ipynb
│ ├── 02_data_cleaning.ipynb
│ ├── 03_feature_engineering_eda.ipynb
│ ├── 04_graph_construction.ipynb
│ └── 05_ml_modeling.ipynb
│
├── reports/
│ └── model_comparison.csv # Baseline vs Graph-Enhanced metrics
│
├── dashboard/ # Streamlit analytics dashboard
│ ├── app.py # Main entry point & sidebar navigation
│ ├── config.py # Theme colors, paths, constants
│ ├── components.py # Reusable UI components & CSS
│ ├── data_loader.py # Cached data loading & graph construction
│ └── views/
│ ├── overview.py # Executive KPIs & trend charts
│ ├── network_graph.py # Interactive Plotly network visualization
│ ├── bottleneck_hubs.py # Centrality analysis & hub heatmaps
│ ├── corridor_analysis.py # Delay, risk, congestion analysis
│ ├── model_performance.py # ML model head-to-head comparison
│ ├── ftl_carting.py # Transport mode intelligence
│ └── operational_insights.py # Health score & prioritized recommendations
│
├── requirements.txt
└── README.md
| Layer | Technology |
|---|---|
| Language | Python 3.11+ |
| Graph Analytics | NetworkX 3.6 |
| ML Models | XGBoost 2.0, LightGBM 4.6, Scikit-learn 1.8 |
| Dashboard | Streamlit 1.57, Plotly 6.7 |
| Data | Pandas 3.0, NumPy 2.4 |
| Visualization | Plotly, Matplotlib, Seaborn |
| Model | MAE (min) | RMSE (min) | Accuracy ±15% |
|---|---|---|---|
| Baseline | 5.936 | 14.481 | 99.20% |
| Graph Enhanced | 5.684 | 13.767 | 99.31% |
| Improvement | −4.2% | −4.9% | +0.11 pp |
Graph-aware features (betweenness centrality, corridor risk scores, segment delay ratios) contribute ~17% of the total prediction signal.
source_betweenness/destination_betweenness— Hub centrality in the network graphcorridor_risk_score—delay_ratio × log(1 + trip_count)composite risk metricsegment_delay_ratio— Per-leg actual vs OSRM time ratioavg_speed— Derived from distance and actual travel timerecommended_mode— FTL vs Carting recommendation based on distance and delay
Prerequisites: Python virtual environment with all dependencies installed.
# From the project root
& "d:\ETA Optimization\venv\Scripts\python.exe" -m streamlit run "dashboard\app.py"Open http://localhost:8501 in your browser.
- Executive Overview — KPI cards, delay distribution, hourly trends, route-type performance

- Network Graph — Interactive hub-and-spoke visualization with centrality coloring

- Bottleneck Hubs — Centrality ranking, flow analysis, connectivity heatmap

- Corridor Analysis — Searchable corridors, risk scatter, congestion matrix

- ML Model Performance — Head-to-head comparison, radar chart, feature importance

- FTL vs Carting — Mode analysis, high-risk corridors, AI recommendations

- Operational Insights — Network health gauge, prioritized action items, downloadable report

- SLA breaches are concentrated in a small subset of corridors — targeted intervention can reduce network-wide breaches by 20–35%
- Top bottleneck hubs (by betweenness centrality) act as critical choke points; capacity upgrades here yield the highest ROI
- Carting routes show consistently higher delay ratios than FTL; ~15% of carting trips are candidates for mode conversion
- Peak congestion occurs at specific hours — time-of-day routing adjustments can reduce peak load by 15–20%
- Graph features provide measurable, statistically significant ETA prediction improvement over distance-only baselines
Inspired by the publicly available Delhivery logistics dataset — India's largest fully-integrated logistics provider. The dataset covers inter-city shipment routes across India's hub-and-spoke network.