Skip to content

om-gorakhia/Ecommerce_Warehouse_Optimization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ E-Commerce Warehouse Optimization

Interactive Analytics Platform for Supply Chain Optimization using Linear Programming

Python Streamlit License

πŸš€ Overview

A comprehensive Linear Programming solution for multi-warehouse inventory allocation that achieves 99%+ order fulfillment and $44.9M profit improvement through optimal resource distribution and cost minimization.

This project optimizes inventory allocation across 6 warehouses serving 10 delivery regions with 300+ products, solving the complex problem of balancing transportation costs, holding costs, and service level targets.


🎯 Key Results

Metric Before Optimization After Optimization Improvement
Order Fulfillment 45% 99%+ +54 pp
Stockout Rate 55% <5% -50 pp
Annual Profit -$9.5M (loss) +$35.4M $44.9M
System Cost $36M Optimized Minimized

Key Achievements:

  • βœ… 99% fulfillment rate (up from 45%)
  • βœ… $44.9M profit improvement from optimization
  • βœ… $3.7M savings opportunity identified (20% transport cost reduction)
  • βœ… Optimal allocation across 6-warehouse network

πŸ› οΈ Features

Interactive Streamlit Dashboard

  • 🏠 Executive Summary: High-level KPIs and business impact metrics
  • πŸ“ˆ Performance Analysis: Deep dive into fulfillment, delivery, warehouse, and transport metrics
  • πŸ”„ Scenario Comparison: Sensitivity analysis across 9 optimization strategies
  • πŸ—ΊοΈ Network Visualization: Interactive global map of warehouse-region connections
  • πŸ’‘ Strategic Insights: Data-driven recommendations with ROI projections
  • πŸ”¬ Technical Documentation: Mathematical formulations and methodology
  • πŸ“Š Validation Logs: Complete audit trail of calculations and assumptions

Optimization Engine

  • Multi-Commodity Network Flow optimization
  • Linear Programming using PuLP/CBC solver
  • Flow Capacity Model (12Γ— inventory turnover)
  • Cost Minimization (transport + holding + stockout penalties)
  • Constraint Optimization (capacity, demand, service levels)

πŸ’» Technology Stack

  • Python 3.10+ - Core programming language
  • PuLP - Linear Programming and optimization
  • Pandas - Data manipulation and analysis
  • Streamlit - Interactive dashboard framework
  • Plotly - Advanced data visualization
  • NumPy - Numerical computing

πŸ“ Project Structure

Ecommerce_Warehouse_Optimization/
β”‚
β”œβ”€β”€ streamlit_dashboard.py    # Main dashboard application
β”œβ”€β”€ requirements.txt          # Python dependencies
β”œβ”€β”€ .devcontainer/            # Development container config
β”‚
β”œβ”€β”€ results/                  # Generated optimization results
β”‚   β”œβ”€β”€ scenario_comparison_kpis.csv
β”‚   β”œβ”€β”€ cost_breakdown_comparison.csv
β”‚   β”œβ”€β”€ network_nodes.csv
β”‚   β”œβ”€β”€ network_edges.csv
β”‚   └── Baseline/             # Baseline scenario results
β”‚       β”œβ”€β”€ shipments.csv
β”‚       β”œβ”€β”€ stocking.csv
β”‚       β”œβ”€β”€ stockouts.csv
β”‚       └── kpis.json
β”‚
└── README.md                 # Project documentation

βš™οΈ Installation & Setup

Prerequisites

  • Python 3.10 or higher
  • pip package manager

Step 1: Clone the Repository

git clone https://github.com/om-gorakhia/Ecommerce_Warehouse_Optimization.git
cd Ecommerce_Warehouse_Optimization

Step 2: Install Dependencies

pip install -r requirements.txt

Required Packages:

streamlit>=1.28.0
pandas>=2.0.0
numpy>=1.24.0
plotly>=5.17.0
pulp>=2.7.0
json
pathlib

Step 3: Run the Dashboard

streamlit run streamlit_dashboard.py

The dashboard will open in your default browser at http://localhost:8501


πŸ“Š How It Works

Problem Statement

Challenge: An e-commerce company has:

  • 6 warehouses with limited capacity
  • 10 delivery regions with varying demand
  • 300+ products to allocate
  • 45% fulfillment rate (55% stockouts)
  • Negative profitability

Goal: Maximize order fulfillment while minimizing total system costs

Solution Approach

1. Flow Capacity Model

Instead of static inventory, we model continuous replenishment:

Flow Capacity = Static Inventory Γ— Annual Turnover Rate
              = 50,000 units Γ— 12 turns/year
              = 600,000 units/year capacity

2. Objective Function

Minimize total system cost:

Minimize: Transportation Cost + Holding Cost + Stockout Penalties

3. Key Constraints

  • Demand Satisfaction: All demand must be fulfilled or recorded as stockout
  • Capacity Limits: Shipments cannot exceed warehouse capacity
  • Service Targets: 95% fulfillment, 3-day delivery window
  • Non-negativity: All quantities must be β‰₯ 0

4. Optimization

Using Linear Programming (PuLP with CBC solver) to find the mathematically optimal allocation.


πŸ’Ό Business Impact

Problems Solved

Problem Solution Result
Low Fulfillment (45%) Flow Capacity Model + Optimal Allocation 99%+ fulfillment
High Stockouts (55%) Linear Programming optimization <5% stockouts
Unprofitable Operations Cost minimization with 10Γ— CLV penalty $44.9M profit gain
Inefficient Transport Carrier negotiation opportunity $3.7M savings potential

Strategic Recommendations

πŸ”΄ Priority 1: Transportation Cost Negotiation (6 months)

  • Expected savings: $3.0-3.7M annually
  • Action: Negotiate 15-20% rate reduction with carriers
  • ROI: Highest sensitivity

🟑 Priority 2: On-Time Delivery Improvement (18 months)

  • Target: 95%+ on-time rate
  • Action: Add 2-3 regional distribution centers
  • ROI: High

🟒 Priority 3: Capacity Monitoring (Ongoing)

  • Current: 68% average utilization
  • Headroom: 25% volume growth before expansion
  • Action: Quarterly monitoring

πŸ”¬ Technical Details

Mathematical Formulation

Decision Variables:

  • x[i,j,p] = Quantity of product p shipped from warehouse i to region j
  • y[i,p] = Binary indicator (1 if product p stocked at warehouse i)
  • s[j,p] = Stockout quantity for product p in region j

Objective Function:

Minimize Z = ΣΣΣ c[i,j] Γ— x[i,j,p]           (Transportation)
           + ΣΣ h[i] Γ— inventory[i,p]      (Holding)
           + ΣΣ penalty[p] Γ— s[j,p]      (Stockouts)

Subject to:

  • Demand satisfaction: Ξ£ x[i,j,p] + s[j,p] = demand[j,p]
  • Capacity constraint: Ξ£ x[i,j,p] ≀ flow_capacity[i,p]
  • Service level: On-time delivery β‰₯ 95%

Performance

  • Solve Time: ~2 seconds
  • Problem Size: ~14,000 variables, ~5,000 constraints
  • Optimization Status: Optimal solution guaranteed
  • Algorithm: Branch-and-Cut with CBC solver

πŸ“ Use Cases

This solution is applicable to:

  • βœ… E-commerce fulfillment network optimization
  • βœ… Multi-warehouse inventory allocation
  • βœ… Supply chain cost reduction initiatives
  • βœ… Service level improvement projects
  • βœ… Capacity planning and expansion analysis
  • βœ… Warehouse network design
  • βœ… Transportation optimization

πŸ“¦ Scenarios Analyzed

The project evaluates 9 optimization scenarios:

  1. Baseline - Current optimal allocation 2-4. Capacity Expansion - 10%, 20%, 30% increase 5-6. Transport Cost Reduction - 10%, 20% decrease
  2. Transport Cost Increase - 10% increase 8-9. Higher Service Targets - 97%, 99% fulfillment

πŸ‘₯ Team

DBA5103 Operations Research & Analytics
National University of Singapore (NUS)

  • Om Gorakhia
  • Prisha Shah
  • Nourah Algiffari
  • Pranay Samineni
  • Sanya Rajpal

πŸ“Œ Next Steps

To extend this project:

  1. Real-time Integration: Connect to live inventory systems
  2. Demand Forecasting: Add ML-based demand prediction
  3. Dynamic Pricing: Incorporate pricing optimization
  4. Route Optimization: Detailed last-mile delivery routing
  5. Multi-period Planning: Extend to monthly/quarterly planning horizon
  6. Sustainability Metrics: Add carbon footprint optimization

πŸ“ License

This project is part of academic coursework at NUS Business School.


πŸš€ Quick Start

# Clone repository
git clone https://github.com/om-gorakhia/Ecommerce_Warehouse_Optimization.git

# Navigate to directory
cd Ecommerce_Warehouse_Optimization

# Install dependencies
pip install -r requirements.txt

# Launch dashboard
streamlit run streamlit_dashboard.py

Dashboard URL: http://localhost:8501


❓ FAQ

Q: What data is required to run this optimization?
A: The model requires warehouse capacities, product dimensions, demand by region, transportation costs, and service level targets.

Q: Can this work for my business?
A: Yes! The framework is adaptable to any multi-location inventory allocation problem. Adjust parameters in the optimization engine to match your specific requirements.

Q: How long does optimization take?
A: The CBC solver finds optimal solutions in ~2 seconds for networks of this size (6 warehouses, 10 regions, 300 products).

Q: What if I don't have optimization results?
A: Run the analysis engine first (check code comments for execution). Pre-generated results are included in the /results folder.


πŸ“ž Contact

For questions or collaboration:


⭐ If you find this project helpful, please give it a star!


Built with ❀️ for supply chain optimization | NUS Business Analytics 2025

About

Supply chain optimization using linear programming to minimize warehouse costs and improve distribution efficiency

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages