An AI-powered warehouse inventory optimization system that uses demand forecasting and linear optimization to recommend optimal stock transfers between warehouses, reducing costs and improving service levels.
- Demand Forecasting: Predict future demand using historical order patterns
- Stock Pressure Index (SPI): Calculate inventory pressure for each warehouse-product combination
- Smart Recommendations: Generate optimal transfer recommendations between warehouses
- What-If Analysis: Simulate different scenarios with interactive sliders
- Interactive Dashboards: Visualize data with Plotly charts and graphs
- Cost Optimization: Minimize total logistics costs while maintaining service levels
- Python 3.8 or higher
- pip package manager
-
Clone or download the project
cd intelligent_warehouse_balancer -
Install dependencies
pip install -r requirements.txt
-
Run the application
streamlit run app.py
-
Open your browser Navigate to
http://localhost:8501to access the application.
Required columns:
Warehouse_ID: Unique identifier for each warehouseLocation: Geographic location (city/region)Product_Category: Product category (Electronics, Clothing, etc.)Current_Stock_Units: Current inventory levelReorder_Level: Minimum stock thresholdStorage_Cost_per_Unit: Cost per unit for storage (INR)
Required columns:
Order_ID: Unique order identifierOrder_Date: Date of the order (YYYY-MM-DD format)Origin: Origin location (should match warehouse locations)Product_Category: Product categoryOrder_Value_INR: Order value in Indian Rupees
- Option A: Use the provided sample data for testing
- Option B: Upload your own CSV files using the sidebar
The application has 5 main tabs:
- Key metrics and KPIs
- Total warehouses, SKUs, shortage percentage
- Potential cost savings
- Top risk categories
- Stock Pressure Index (SPI) visualization
- Stock vs Reorder Level heatmap
- Detailed stock analysis table
- Historical demand trends
- Predicted demand for next period
- Category-wise demand patterns
- Transfer recommendations table
- Transfer network visualization
- CSV export functionality
- Interactive simulation controls
- Scenario analysis (Best Case, Worst Case, Current)
- Real-time impact visualization
Use the sidebar sliders to:
- Demand Change: Simulate demand fluctuations (-50% to +50%)
- Storage Cost Change: Simulate cost variations (-30% to +30%)
SPI = (Current_Stock_Units - Reorder_Level) - Predicted_Demand
- Negative SPI: Shortage risk (needs stock)
- Positive SPI: Surplus (can donate stock)
- Zero SPI: Balanced inventory
- Identify warehouses with SPI < 0 (shortage)
- Find warehouses with SPI > 0 (surplus) for same product category
- Calculate optimal transfer units
- Estimate cost savings
Savings = Transfer_Units × (Donor_Storage_Cost - Receiver_Storage_Cost)
- Total Warehouses: 8
- Total SKUs: 32
- Shortage %: 25.0%
- Average SPI: -5.2
- Potential Cost Saving: ₹15,250
| Product_Category | From_Location | To_Location | Units | Estimated_Saving_INR |
|---|---|---|---|---|
| Electronics | Bangalore | Delhi | 30 | 240.00 |
| Clothing | Mumbai | Pune | 25 | 125.00 |
| Books | Chennai | Kolkata | 15 | 30.00 |
-
File Upload Errors
- Ensure CSV files have correct column names
- Check date format (YYYY-MM-DD)
- Verify numeric columns don't contain text
-
No Recommendations Generated
- Check if warehouses have both surplus and shortage
- Verify product categories match between files
- Ensure sufficient data for demand calculation
-
Performance Issues
- Large datasets may take time to process
- Consider filtering data for testing
- Use sample data for initial testing
The application automatically validates:
- Required columns presence
- Negative stock or cost values
- Date format consistency
- Data type compatibility
The system is designed to support PuLP-based linear optimization:
- Minimize total transfer costs
- Subject to stock constraints
- Consider distance and transportation costs
For production use, implement:
- Real distance calculations between locations
- Transportation cost factors
- Delivery time constraints
For issues or questions:
- Check the troubleshooting section
- Verify your data format matches requirements
- Test with sample data first
- Check console for error messages
- Initial release with core functionality
- Sample data and basic optimization
- Interactive dashboards and what-if analysis
- Advanced optimization algorithms
- Real-time data integration
- Multi-objective optimization
- Machine learning demand forecasting
Built with Streamlit, Pandas, and Plotly