Skip to main content
5 votes
Accepted

Reformulate constraints

It looks like You want to enforce for all $i,t,k$: $$ x_{itk}=1 \implies v_{itk} = u_{it} \quad $$ and $$ x_{itk}=0 \implies v_{itk} =0 $$ You can get rid of the big-M as follows: \begin{align} x_{...
Kuifje's user avatar
  • 13.5k
5 votes
Accepted

if else condition with multiple criteria in MIP

Let $\epsilon$ be a small constant positive tolerance, and let $M$ be a constant upper bound on $x_1$. Now impose linear constraints $$\epsilon s_1 \le x_1 \le M s_1.$$
RobPratt's user avatar
  • 32.3k
3 votes

Matrix lookup modelling variants

If your modeling API supports indicator constraints, you can impose $$y_j =1 \implies c_i=x_{ij}.$$ @prubin’s answer provides the corresponding big-M formulation of this constraint.
RobPratt's user avatar
  • 32.3k
3 votes
Accepted

Matrix lookup modelling variants

You do not really need the $z$ variables. You can just add the constraints $$x_{ij} - M(1-y_j) \le c_i \le x_{ij} + M(1-y_j)\quad \forall j.$$
prubin's user avatar
  • 39.3k
3 votes
Accepted

Formulation for choosing how many items to manufacture

If you need both $x$ and $y$ in the model, a third option is to enforce \begin{align} y_{m,p,s} &\ge x_{m,p,s} \\ y_{m,p,s} &\le \text{PartsPerShift}_p x_{m,p,s} \end{align} This modification ...
RobPratt's user avatar
  • 32.3k
3 votes

Modelling a binary variable in LPs

You want to enforce $$b_{it} = 0 \iff \sum_{j \le t} a_{ij} \le n.$$ You can enforce $$b_{it} = 0 \implies \sum_{j \le t} a_{ij} \le n$$ with big-M constraint $$\sum_{j \le t} a_{ij} - n \le M_1 b_{it}...
RobPratt's user avatar
  • 32.3k
2 votes

When to use indicator constraints versus big-M approaches in solving (mixed-)integer programs

I'm currently working on the optimal transmission problem (OTS), that is a particular optimization problem that is originally formulated as a mixed-integer non-linear problem and usually reformulated ...
Salva's user avatar
  • 31
2 votes

Priotization rules for variable allocation in linear programming

A prioritization rule is applied to the variables $zn_{t}$ and $z_{t}$. The model initially attempts to satisfy the constraint using $zn_{t}$. However, if $zn_{t}$ proves inadequate, the model then ...
fontanf's user avatar
  • 2,623
1 vote

Converting a piecewise function to linear equations

Judging by the additional remarks in the comments, it seems like you want to linearize: $$ \alpha = \begin{cases} \alpha_1, \quad \text{if} \quad \sum_{i \in J_1} x_i = |J_1| = 1 \\ \alpha_2, \quad \...
joni's user avatar
  • 1,572
1 vote
Accepted

Logical conditions

I'm going to drop the subscript $t$ to save clutter. Let $B = C\cdot x - E.$ Introduce three binary variables $\omega_1,$ $\omega_2,$ $\omega_3$ together with the constraints $y \le \omega_1,$ $zn \le ...
prubin's user avatar
  • 39.3k
1 vote

Mixed Integer programming, the big M

This is a common modeling techniques in operations research. Another interpretation is if-then relationship or indicator. When you have to count how many days you have to setup to produce then you can ...
ytsao's user avatar
  • 386

Only top scored, non community-wiki answers of a minimum length are eligible