Control Room Omar
Menu

Case Study

Production Optimizer: ILP-Driven Manufacturing Scheduling

A web-based optimization engine that maximizes profit by solving complex production constraints using Integer Linear Programming (ILP).

2025-05-20 Supply Chain & Operations Personal Build
Cover for Production Optimizer: ILP-Driven Manufacturing Scheduling

My Role

Lead Developer; engineered the mathematical optimization model and developed a modular backend to handle complex manufacturing constraints.

Outcome

Automated production scheduling, enabling real-time 'what-if' analysis for machine downtime and demand spikes.

Tools

Python PuLP Streamlit Pandas

TL;DR

The Production Optimizer is a high-fidelity decision-support tool designed to solve the “N-Product, M-Machine” scheduling problem. By leveraging Integer Linear Programming (ILP), the system evaluates thousands of potential configurations to identify the mathematically optimal production path—accounting for setup times, machine maintenance costs, and penalties associated with unmet demand.

Problem

Manufacturing environments face multi-dimensional optimization challenges: determining how to allocate limited machine hours across a diverse product portfolio with varying profit margins, setup requirements, and production rates. Manual scheduling is often inefficient and prone to sub-optimal resource allocation when faced with dynamic variables such as:

  • Equipment Failure: Unexpected downtime requiring immediate, automated rescheduling.
  • Demand Volatility: Fluctuating order volumes that necessitate the prioritization of high-margin products.
  • Operational Constraints: Fixed setup durations and specific batch size requirements that limit production flexibility.

Design Iterations

The project evolved from a static calculation script into a robust, modular system. The initial development phase focused on the Mathematical Core, ensuring the ILP model could handle any arbitrary combination of products and machines.

Once the core logic was validated, the focus shifted toward User Experience (UX). By integrating a Streamlit-based frontend, the tool was transformed from a “black box” script into an interactive dashboard. This allows production engineers to input data via structured tables and immediately visualize the impact of changing variables—such as tripling demand for a specific SKU or simulating a machine failure—without modifying the underlying codebase.

Enlarged visualization

Technical Details

The system utilizes a decoupled architecture where the Backend executes the heavy lifting of optimization logic via the PuLP library, while the Frontend manages data ingestion and visualization.

The Mathematical Model

The core of the system is an ILP model designed to maximize total profit (ZZ).

Decision Variables:

  • xi,j,bx_{i,j,b}: Number of batches of Product ii on Machine jj with batch type bb (Integer).
  • yi,j,by_{i,j,b}: Binary indicator if Product ii is assigned to Machine jj with batch type bb.
  • uiu_i: Integer variable representing unmet demand for Product ii.

Objective Function: The model maximizes profit while subtracting maintenance costs and penalties for unfulfilled orders: maxZ=i(Profitij,bxi,j,bBatchSizei,b)i(Penaltyiui)j,i,b(Maintenancejyi,j,b)\max Z = \sum_{i} (Profit_i \cdot \sum_{j,b} x_{i,j,b} \cdot BatchSize_{i,b}) - \sum_{i} (Penalty_i \cdot u_i) - \sum_{j,i,b} (Maintenance_j \cdot y_{i,j,b})

Key Constraints:

  1. Machine Time: Ensures production plus setup time does not exceed available hours: i,b(xi,j,bBatchSizei,bRatei,j+SetupTimeiyi,j,b)AvailableHoursj\sum_{i,b} \left( \frac{x_{i,j,b} \cdot BatchSize_{i,b}}{Rate_{i,j}} + SetupTime_i \cdot y_{i,j,b} \right) \leq AvailableHours_j
  2. Batch Exclusivity: Ensures only one batch type (min or max) is selected per product-machine pair.
  3. Demand Satisfaction: Ensures the sum of produced units and unmet demand exactly equals the total demand.

Results & Key Metrics

The Production Optimizer successfully handles complex “what-if” scenarios that are computationally difficult to calculate manually:

A screenshot of the optimization output displaying total profit, machine utilization percentages, and specific production counts for various products.
  • Scenario A (Standard Operations): The system identifies the optimal distribution of products across machines to maximize profit while remaining within strict machine time limits.

  • Scenario B (Machine Failure): By setting a machine’s available hours to zero, the model automatically redistributes the workload across the remaining functional units.

  • Scenario C (Demand Surge): When demand for a specific product triples, the system calculates the optimal trade-off between fulfilling high-demand orders and maintaining production of other high-margin items.

Frameworks & Tooling