Skip to content

VirusHacks/Supply-Chain

Repository files navigation

Smart Supply Chains

An integrated supply chain intelligence platform for early risk detection, demand forecasting, coordinated response, and route optimization.

Instead of treating these as separate tools, this project connects them into one decision workflow.

Why Now

Imagine a small logistics operator moving temperature-sensitive goods across western India during monsoon season.

A route that usually works fine starts slowing down. A port is getting congested. Warehouse pressure is rising. Demand is about to shift, but none of this is fully visible in one place yet.

In a traditional setup, the operator learns about the problem after delays, wasted capacity, or spoilage have already started.

In our approach, the system starts earlier:

  • it detects disruption risk
  • it forecasts likely downstream demand pressure
  • it recommends how the network should respond
  • it suggests a better route before the situation gets worse

Challenge

Supply chains usually react too late.

By the time a delay becomes visible, the real damage may already be spreading across the network. A congested port can affect warehouse planning. A weak route can delay deliveries and distort future inventory needs. A sudden change in demand can put pressure on transport, storage, and execution at the same time.

Most existing solutions handle these problems in isolation. One tool tracks shipments. Another forecasts demand. Another helps with routing. Another is still managed manually through calls, spreadsheets, and operator judgment.

That is the gap this project tries to close.

We wanted to build a system that helps answer four connected questions in one place:

  1. Is disruption risk building?
  2. What demand is likely to come next?
  3. How should the network respond?
  4. What route should the shipment take now?

What Is At Stake

Even small improvements matter when the network is large and time-sensitive.

This project is designed to reduce the kind of operational friction that compounds quickly:

  • delays that spread from one node to another
  • inventory decisions made with weak visibility
  • route choices based on static logic
  • manual responses that arrive too late

The strongest notebook-backed signals in the project show why this is worth solving:

  • disruption detection reached 0.9993 test AUC
  • forecasting reached 1.79% overall MAPE
  • resource allocation reached 73.44 reward vs 23.55 baseline
  • route optimization improved route length by 15.00% over greedy routing

Solution

Most supply chain systems are good at reporting what already happened.

This project is designed to help answer what should happen next.

It brings together four linked capabilities:

Layer What it answers Why it matters
Disruption detection Is a disruption likely? Creates early warning before losses spread
Demand forecasting What demand is coming next? Improves stock and replenishment planning
Resource allocation How should the network respond? Coordinates trucks, warehouses, and carriers
Route optimization What path should the shipment take now? Improves movement under changing conditions

Why It Stands Out

This solution is novel in three ways:

Traditional approach Our approach
Separate dashboards for separate problems One connected decision system
One model or one heuristic used everywhere Different model for each decision type
Static reporting after issues appear Action-oriented intelligence that can guide next steps

The goal is not to replace every existing ERP, routing tool, or operations dashboard. The goal is to sit on top of existing systems and make their decisions better.

AI + Google Tools

This project is not using AI as a label. AI is built into the core decision layers of the system.

Need AI approach used
Early disruption warning Causal GNN over a supply chain network
Future demand planning Temporal Fusion Transformer
Coordinated operational response QMIX multi-agent reinforcement learning
Better route selection POMO neural route optimization

We also leverage Google tools where they add practical value to the system:

Google tool How it is used
Google Maps Live travel duration input for route optimization
Gemini Optional route reasoning and explanation output
Cloud Build Build pipeline for the web application
Cloud Run Configured deployment target for the web application

System Flow

Risk signal -> Demand view -> Resource response -> Route choice
     |              |                |                 |
     v              v                v                 v
  Causal GNN       TFT             QMIX              POMO

This structure is what makes the project stronger than a single-model demo. Each layer solves a different kind of operational problem.

Results

These are the strongest notebook-backed results across the four core features:

Feature Model Best reported result
Disruption detection Causal GNN Test AUC 0.9993, accuracy 0.98
Demand forecasting Temporal Fusion Transformer Overall MAPE 1.79%
Resource allocation QMIX MARL Reward 73.44 vs baseline 23.55
Route optimization POMO 3410.91 km vs greedy 4012.83 km

Core Features

Disruption Detection

This is the early warning layer. It detects disruption risk in the network, suggests likely stress points, and recommends interventions. Its strongest result is a test AUC of 0.9993, which makes it the clearest risk signal in the platform.

Full feature note: disruption-detection.md

Demand Forecasting

This is the planning layer. It estimates future node-level demand so the system can prepare before stock pressure becomes operational pain. Its strongest overall result is 1.79% MAPE, along with forecast ranges and reorder alerts.

Full feature note: demand-forecasting.md

Resource Allocation

This is the coordinated response layer. It recommends what trucks, warehouses, and carriers should do once disruption risk becomes real. In the main benchmark, it reached 73.44 reward versus 23.55 for the baseline.

Full feature note: resource-allocation.md

Route Optimization

This is the movement execution layer. It chooses better shipment paths than simple routing rules. Its clearest benchmark result is a 15.00% improvement over greedy nearest neighbor routing.

Full feature note: route-optimization.md

Why It Helps Existing Systems

This project can strengthen existing supply chain tools without replacing the whole stack.

Existing setup What this project adds
Monitoring dashboards Early warning and intervention suggestions
Forecasting tools Weather, season, festival, and safety-stock aware planning
Routing tools More adaptive path selection under changing conditions
Manual operations workflows Faster, more structured response decisions

Product

The webapp brings the system into one workflow with pages for:

  • dashboard
  • disruption
  • forecasting
  • routes
  • resources
  • shipments
  • alerts

Core app stack:

Area Technology
Frontend Next.js 16, React 19
Auth NextAuth
Database Neon PostgreSQL, Drizzle ORM
Mapping Google Maps, Mapbox

Limits

This is a strong prototype, but the honest picture matters:

Area Current limitation
Disruption detection Prediction is stronger than root-cause precision
Forecasting Accuracy is strong overall, but interval calibration varies by node
Resource allocation Strong in simulation, weaker under real-world adaptation
Route optimization Core benchmark is strong, but some advanced extensions are still less proven

Repository

google-solution-challenge/
├── causal-gnn-disruption-detection/
├── smartchain-forecasting/
├── marl-resource-allocation/
├── pomo-route-optimization/
├── webapp/
├── disruption-detection.md
├── demand-forecasting.md
├── resource-allocation.md
├── route-optimization.md
└── supplychainmanagement.txt

Local Setup

Web app

cd webapp
npm install
npm run dev

Model services

cd causal-gnn-disruption-detection && pip install -r requirements.txt && uvicorn app:app --port 8001
cd smartchain-forecasting && pip install -r requirements.txt && uvicorn app:app --port 8002
cd marl-resource-allocation && pip install -r requirements.txt && uvicorn app:app --port 8003
cd pomo-route-optimization && pip install -r requirements.txt && python app.py

Takeaway

This project is not just a dashboard and not just a single AI model.

It is a connected supply chain intelligence stack that can:

  • see risk earlier
  • estimate demand more accurately
  • recommend coordinated action
  • choose better routes than simple baselines

That combination is the real value of the system.

Releases

No releases published

Packages

 
 
 

Contributors