# WIP Inventory Level Constraint?

I'm modeling a continuous-time, two-stage manufacturing process with an MIP. There are about 100 finished-goods SKUs, and each of those belongs to about 25 different semi-finished categories in a many-to-one fashion. For approximation, let's say SKU1,SKU2,SKU3,SKU4 belong to semi-finished category A, SKU5,SKU6,SKU7,SKU8 belong to semi-finished cateogry B, etc.

In the first stage, semi-finished WIP materials are produced in one section of the plant (four lines in this section). If a manufacturing line produces 1000 pounds of semi-finished category A, those 1000 WIP pounds can then be "converted" into SKU1,SKU2,SKU3, or SKU4 in a different section of the plant, at different rates across about 20 lines.

Right now, I am treating semi-finished production "as if" it's finished-goods production. E.g., SKU1 is produced in the first section of the plant, then transferred to the other section for completion as a finished good. This is causing significant model complexity that I think could be avoided if I can just model the first stage of manufacturing as 25 semi-finished goods, instead of 100 individual finished SKUs.

The tricky part is that there's a time component - you can't manufacture a unit of SKU1 in the finished-goods process, without having completed sufficient production in the semi-finished section. I'd like to be able to implement some sort of net inventory constraint in my model. E.g., you can't begin to process X units of SKU1 in the second section, unless there are X units of semi-finished category A sitting around. Even more troublesome is that there is a many-to-one relationship between finished-goods SKUs and semi-finished products.

Any advice on how this net inventory relationship may be modeled?

• Can any unit of category A coming out of the first stage be converted into SKU3, or are first stage units already designated for/limited to a single SKU?
– prubin
May 10 at 18:17
• Any unit of category A can be converted into SKU3. It's in pounds, so e.g., 100 pounds of semi-finished A can be converted into 100 pounds of SKU3 at a processing rate that is line-specific in the second stage May 10 at 18:20
• Any unit of category A can be converted into SKU1,SKU2,SKU3, or SKU4. It's in pounds, so e.g., 100 pounds of semi-finished A can be converted into 100 pounds of SKU1/2/3/4 at a processing rate that is SKU- and line-specific in the second stage May 10 at 18:27

What you are trying to do sounds like an MRP (material requirement planning) system. For this, you already need to define the component's precedence relations as a directed graph and apply the stages to produce semi-defined materials in your desired given planning horizon. In the following picture:

there are three stages. Stage three is also determined as the finished products. Each node represents each component and the arcs determine the relations between components and whose semi-defined materials. The shown number on each arc turns out the required components to produce its follow-up materials. By the above definition, the MRP system can be formulated as mixed-integer programming as follows:

\begin{align} \min & \quad \text{your desired objective function} \\ \text{s.t.} & \sum_{\tau=1}^{t-L T(i)} x_{i, \tau}+I(i, 0)-\sum_{\tau=1}^{t}\left(D(i, \tau)+\sum_{j=1}^{P} R(i, j) x_{j, \tau}\right) \geq 0, \quad \forall i, t\\ & x_{i, t}-\delta_{i, t} L S(i) \quad \geq 0, \quad \forall i, t \\ & \delta_{i, t}-\frac{x_{i, t}}{M} \quad \geq 0, \quad \forall i, t\\ & x_{i,t} \in \text{R}, \delta_{i, t}\{0,1\}, \forall i \in N \end{align}

$$P$$ is the number of SKUs, $$T$$ is the number of time buckets (i.e., daily, weekly, etc.), $$LT$$ is the Lead time for SKU $$i$$, $$R$$ the number of $$i$$’s needed to make one $$j$$, $$I$$ is the beginning inventory and $$LS$$ is the minimum lot size for SKU $$i$$. Also, $$x_{i,t}$$ represents the amount of produced components in each stage and $$\delta_{i,t}$$ is a switching variable to active/inactive producing the components.

I assume this is a multiperiod problem. Create a variable $$I_{k,t}$$ for the inventory of category of category $$k$$ material available to the second stage at the end of time period $$t$$. Production variables in the first stage are the amount of "category" material of each type produced. Production variables in the second stage are the amount of each SKU produced.

There are a couple of ways to handle the intermediate inventory, depending on the granularity of your time units and how picky you are. One approach would look like this, where $$x_{k,t}$$ is production of category $$k$$ during time period $$t,$$, $$S_k$$ is the set of SKUs in category $$k$$, and $$y_{s,t}$$ is the production of SKU $$s$$ during time period $$t$$: $$0\le I_{k,t} = I_{i,t-1} + x_{k,t} - \sum_{s \in S_k} y_{s,t}.$$ The caveat here is that the constraint allows category material produced in period $$t$$ to be consumed in the same period (which may not be overly permissive). An alternate approach would be to add the constraint $$\sum_{s \in S_k} y_{s,t} \le I_{i,t-1},$$ which would limit stage 2 consumption to category material that was available at the start of the time period (which might be overly restrictive).

Of course, the accuracy of either approach can be improved by shrinking the duration of a time period, at the cost of making the model bigger.

• It's single period (a fiscal month, either 4 or 5 weeks). Stage 1 and Stage 2 production are continuous decision variables (start time and duration). There are some limitations around weekend production that are built in to the MIP. (Some weekends you can produce, some you can't... but I take care of that with non-overlap constraints on the prohibited weekends) May 10 at 18:46