/Mixed-Binary-Program

Mixed Binary Program is a generalized solution of the "Tiny Planning Problem"

Primary LanguageJavaScript

Mixed Binary Program

The code consists in a generalized solution of the "Tiny Planning Problem" proposed in the first chapter of the book "Production Planning by Mixed Integer Programming" written by Yves Pochet and Laurence A. Wosley. This solution contains the CPLEX Optimzer model and a web interface to display each one of the models.

Problem

Optimize a cost model that contains demand, production, unit cost, set-up cost, inventory cost and end inventory, in an arbitrary period of time. The unit cost, set-up cost and inventory cost are fixed, while the demand is variable for each month, so it's necessary to find the optimal production for each period to obtain the lowest cost possible.

So the Total inventory Cost can be represented by:

Inventory Cost = \sum_{t=0}^{NT} hcost \cdot \frac{INV_{t-1} + INV}{2}

And the total cost is:

MinCost := \sum_{t=0}^{NT}(p x_t + qx_t)  + \sum_{t=0}^{NT} h s_t + \frac{h}{2}s_{NT}

Where in the data: NT stands for the total time period, p is the production unit cost and q is the set-up cost.

And the variables are: x: the production size, yt: the production set-up and s: end inventory level.

To solve the problem, there are some constraints that should be taken in consideration:

The demand satisfaction constraint which ensures that the production and the inventory are capable to supply all the demand in each period and can be modeled as

dem\_sat := s_{t-1} + x_t = d_t + s_t        for all t = 1, . . . , NT

s_0 = s_{init}, s_{NT} = 0 ,

The variable upper bound (VUB) constraint, a classical generic constraint used to enforce a set-up:

vub_t := x_t \leq \sum_{k=t}^{NT}(d_k)y_t        for all t = 1, . . . , NT

x_t, s_t  \in \Re_+, y_t \in \{0,1\}        for all t = 1, . . . , NT