Interactive Analytics Platform for Supply Chain Optimization using Linear Programming
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.
| 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
- π 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
- 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)
- 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
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
- Python 3.10 or higher
- pip package manager
git clone https://github.com/om-gorakhia/Ecommerce_Warehouse_Optimization.git
cd Ecommerce_Warehouse_Optimizationpip install -r requirements.txtRequired Packages:
streamlit>=1.28.0
pandas>=2.0.0
numpy>=1.24.0
plotly>=5.17.0
pulp>=2.7.0
json
pathlibstreamlit run streamlit_dashboard.pyThe dashboard will open in your default browser at http://localhost:8501
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
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
Minimize total system cost:
Minimize: Transportation Cost + Holding Cost + Stockout Penalties
- 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
Using Linear Programming (PuLP with CBC solver) to find the mathematically optimal allocation.
| 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 |
π΄ 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
Decision Variables:
x[i,j,p]= Quantity of productpshipped from warehouseito regionjy[i,p]= Binary indicator (1 if productpstocked at warehousei)s[j,p]= Stockout quantity for productpin regionj
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%
- Solve Time: ~2 seconds
- Problem Size: ~14,000 variables, ~5,000 constraints
- Optimization Status: Optimal solution guaranteed
- Algorithm: Branch-and-Cut with CBC solver
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
The project evaluates 9 optimization scenarios:
- Baseline - Current optimal allocation 2-4. Capacity Expansion - 10%, 20%, 30% increase 5-6. Transport Cost Reduction - 10%, 20% decrease
- Transport Cost Increase - 10% increase 8-9. Higher Service Targets - 97%, 99% fulfillment
DBA5103 Operations Research & Analytics
National University of Singapore (NUS)
- Om Gorakhia
- Prisha Shah
- Nourah Algiffari
- Pranay Samineni
- Sanya Rajpal
To extend this project:
- Real-time Integration: Connect to live inventory systems
- Demand Forecasting: Add ML-based demand prediction
- Dynamic Pricing: Incorporate pricing optimization
- Route Optimization: Detailed last-mile delivery routing
- Multi-period Planning: Extend to monthly/quarterly planning horizon
- Sustainability Metrics: Add carbon footprint optimization
This project is part of academic coursework at NUS Business School.
# 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.pyDashboard URL: http://localhost:8501
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.
For questions or collaboration:
- Email: om.gorakhia@u.nus.edu
- LinkedIn: linkedin.com/in/omgorakhia
- GitHub: @om-gorakhia
β If you find this project helpful, please give it a star!
Built with β€οΈ for supply chain optimization | NUS Business Analytics 2025