Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ETA Optimization using Graph-Based Network Intelligence

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.


Overview

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.


Key Capabilities

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

Project Structure

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

Tech Stack

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 Performance

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.


Engineered Graph Features

  • source_betweenness / destination_betweenness — Hub centrality in the network graph
  • corridor_risk_scoredelay_ratio × log(1 + trip_count) composite risk metric
  • segment_delay_ratio — Per-leg actual vs OSRM time ratio
  • avg_speed — Derived from distance and actual travel time
  • recommended_mode — FTL vs Carting recommendation based on distance and delay

Running the Dashboard

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.

Dashboard Pages

  1. Executive Overview — KPI cards, delay distribution, hourly trends, route-type performance Project Screenshot1
  2. Network Graph — Interactive hub-and-spoke visualization with centrality coloring Project Screenshot2
  3. Bottleneck Hubs — Centrality ranking, flow analysis, connectivity heatmap Project Screenshot3
  4. Corridor Analysis — Searchable corridors, risk scatter, congestion matrix Project Screenshot4
  5. ML Model Performance — Head-to-head comparison, radar chart, feature importance Project Screenshot5
  6. FTL vs Carting — Mode analysis, high-risk corridors, AI recommendations Project Screenshot6
  7. Operational Insights — Network health gauge, prioritized action items, downloadable report Project Screenshot7

Key Findings

  • 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

Data Source

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages