New answers tagged

6 votes
Accepted

Is it possible to do a linearization without introducing new variables?

You want to enforce $$\bigvee_m x_{i,j}^{m,r} \implies w_j^r = w_i^r + \sum_{m} y_j^{m,r} - \sum_{m} z_j^{m,r} \quad \text{for all $r,i,j$}$$ Rewriting in conjunctive normal form leads to linear big-M ...
RobPratt's user avatar
  • 29.8k
3 votes
Accepted

Formulation of binary constraint with the least binary variables for linear programming

You want to impose the following two logical constraints: $$ \begin{align} \delta_{t-1} = 1 \wedge \delta_t = 0 &\implies \beta_t = 1 \tag{1} \\ \neg (\delta_{t-1} = 1 \wedge \delta_t = 0) &\...
joni's user avatar
  • 1,477
2 votes

Linearizing if else conditions in ILP

Besides @RobPratt's answer, the first condition would be (for simplicity I omitted indices $i$ and $j$ and continued with only two $y$ variables: $$ x \implies (y_1 \oplus y_2) $$ $$ \lnot x \lor (y_1 ...
A.Omidi's user avatar
  • 8,187
2 votes
Accepted

Linearizing if else conditions in ILP

Your first constraint enforces more than was asked. When $X_{ij}=0$, it forces $\sum_k Y_{jk}=0$, hence $Y_{jk}=0$ for all $k$. To enforce only $$X_{ij}=1 \implies \sum_k Y_{jk}=1,$$ you can instead ...
RobPratt's user avatar
  • 29.8k
2 votes
Accepted

Activating a sequence of the binary variables in a multi-dimensional array

Introduce an ordering $\text{ord}: I \to \{1,\dots,|I|\}$ and impose $$x_i \le x_j$$ for all $i\in I$ and $j\in I$ such that $\text{ord}_i + 1 = \text{ord}_j$. An alternative, less efficient, approach ...
RobPratt's user avatar
  • 29.8k

Top 50 recent answers are included