# lokifergusion9/delivery-network-intelligence architecture

> Architecture diagram of the GitHub repository lokifergusion9/delivery-network-intelligence, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lokifergusion9/delivery-network-intelligence
- Repository: https://github.com/lokifergusion9/delivery-network-intelligence

## Overview

Delivery Network Intelligence analyzes shipment scans as a facility-and-corridor graph, scores hub delay risk, and predicts leg ETAs. Its principal workflow turns segment data into OD legs and corridors, derives graph features and risk scores, trains and compares ETA models, then presents network, hub, corridor, and prediction views in a Streamlit dashboard. The README documents notebook-only node2vec embeddings; sampled app.py excerpts confirm the lighter centrality-feature model. The notebook and several app sections were not inspected, so their internal wiring is shown only where documented.

Main entry points: [`app.py`](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py) (Streamlit dashboard), [`delivery_data.csv`](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/delivery_data.csv) (Shipment scans), [`delhivery_graph_eta.ipynb`](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/delhivery_graph_eta.ipynb) (Analysis notebook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Shipment data"]
  node_shipments["Shipment scans<br/>[delivery_data.csv]"]
  node_prep["Leg and corridor prep<br/>[app.py]"]
  node_corridors["Corridor statistics<br/>[app.py]"]
end

subgraph group_analysis["Network analysis"]
  node_notebook["Analysis notebook"]
  node_graph["Directed corridor graph<br/>[app.py]"]
  node_features["Facility graph features<br/>[app.py]"]
  node_risk["Hub risk scoring<br/>[app.py]"]
  node_embeddings["Node2vec embeddings"]
end

subgraph group_models["ETA modeling"]
  node_baseline["Baseline ETA model<br/>[app.py]"]
  node_graphmodel["Graph-enhanced ETA model<br/>[app.py]"]
  node_evaluation["Model comparison<br/>[app.py]"]
end

subgraph group_product["Dashboard and results"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
  node_map["Network map<br/>[app.py]"]
  node_hubview["Hub risk drill-down<br/>[app.py]"]
  node_corridorview["Corridor risk view<br/>[app.py]"]
  node_predictor["Interactive ETA predictor<br/>[app.py]"]
  node_memo["Strategy findings<br/>[strategy_memo.md]"]
end

node_operator(("Analyst"))

node_operator -->|"uses"| node_dashboard
node_shipments -->|"loads"| node_dashboard
node_shipments -->|"analyzes"| node_notebook
node_dashboard -->|"prepares"| node_prep
node_notebook -->|"prepares"| node_prep
node_prep -->|"aggregates"| node_corridors
node_corridors -->|"builds"| node_graph
node_graph -->|"computes"| node_features
node_corridors -->|"contributes"| node_risk
node_features -->|"blends"| node_risk
node_features -->|"features"| node_baseline
node_features -->|"enriches"| node_graphmodel
node_baseline -->|"compared in"| node_evaluation
node_graphmodel -->|"compared in"| node_evaluation
node_graph -.->|"embeds"| node_embeddings
node_risk -->|"colors"| node_map
node_risk -->|"ranks"| node_hubview
node_corridors -->|"ranks"| node_corridorview
node_graphmodel -->|"predicts"| node_predictor
node_evaluation -->|"displays"| node_dashboard
node_risk -->|"displays"| node_dashboard
node_corridorview -->|"renders in"| node_dashboard
node_hubview -->|"renders in"| node_dashboard
node_map -->|"renders in"| node_dashboard
node_predictor -->|"renders in"| node_dashboard

click node_shipments "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/delivery_data.csv"
click node_notebook "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/delhivery_graph_eta.ipynb"
click node_dashboard "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_prep "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_corridors "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_graph "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_features "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_risk "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_embeddings "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/delhivery_graph_eta.ipynb"
click node_baseline "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_graphmodel "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_evaluation "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_map "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_hubview "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_corridorview "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_predictor "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py"
click node_memo "https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/strategy_memo.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_shipments,node_prep,node_corridors toneBlue
class node_notebook,node_graph,node_features,node_risk,node_embeddings toneAmber
class node_baseline,node_graphmodel,node_evaluation toneMint
class node_dashboard,node_map,node_hubview,node_corridorview,node_predictor,node_memo toneRose
class node_operator toneIndigo
```

## Components

### Shipment data

- [Shipment scans](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/delivery_data.csv): `delivery_data.csv`
- [Leg and corridor prep](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`
- [Corridor statistics](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`

### Network analysis

- [Analysis notebook](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/delhivery_graph_eta.ipynb): `delhivery_graph_eta.ipynb`
- [Directed corridor graph](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`
- [Facility graph features](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`
- [Hub risk scoring](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`
- [Node2vec embeddings](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/delhivery_graph_eta.ipynb): `delhivery_graph_eta.ipynb`

### ETA modeling

- [Baseline ETA model](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`
- [Graph-enhanced ETA model](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`
- [Model comparison](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`

### Dashboard and results

- [Streamlit dashboard](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`
- [Network map](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`
- [Hub risk drill-down](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`
- [Corridor risk view](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`
- [Interactive ETA predictor](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/app.py): `app.py`
- [Strategy findings](https://github.com/lokifergusion9/delivery-network-intelligence/blob/main/strategy_memo.md): `strategy_memo.md`

### Other components

- **Analyst**

## Connections

- Analyst → Streamlit dashboard: uses
- Shipment scans → Streamlit dashboard: loads
- Shipment scans → Analysis notebook: analyzes
- Streamlit dashboard → Leg and corridor prep: prepares
- Analysis notebook → Leg and corridor prep: prepares
- Leg and corridor prep → Corridor statistics: aggregates
- Corridor statistics → Directed corridor graph: builds
- Directed corridor graph → Facility graph features: computes
- Corridor statistics → Hub risk scoring: contributes
- Facility graph features → Hub risk scoring: blends
- Facility graph features → Baseline ETA model: features
- Facility graph features → Graph-enhanced ETA model: enriches
- Baseline ETA model → Model comparison: compared in
- Graph-enhanced ETA model → Model comparison: compared in
- Directed corridor graph → Node2vec embeddings: embeds
- Hub risk scoring → Network map: colors
- Hub risk scoring → Hub risk drill-down: ranks
- Corridor statistics → Corridor risk view: ranks
- Graph-enhanced ETA model → Interactive ETA predictor: predicts
- Model comparison → Streamlit dashboard: displays
- Hub risk scoring → Streamlit dashboard: displays
- Corridor risk view → Streamlit dashboard: renders in
- Hub risk drill-down → Streamlit dashboard: renders in
- Network map → Streamlit dashboard: renders in
- Interactive ETA predictor → Streamlit dashboard: renders in
