Skip to main content

New answers tagged

0 votes

Adopt constraint formulation

Maybe try something like: $$\sum_{j=t}^{t+F-1}(1-y_{ij})\geq F\cdot (y_{i(t-1)}-y_{it})\quad \forall i\in I, t\in \{2,\ldots,T-F+1\}$$.
mingabua's user avatar
6 votes

Model ```a > 0 implies b = 1```, where a is unbounded above

I thought of SOS1 constraints, but they state that at most one variable can be non-zero, not exactly one. This is not an issue. The constraint $$a \gt 0 \implies b=1$$ for $a\ge0$ and $b\in\{0,1\}$ ...
Erwin Kalvelagen's user avatar
1 vote

If $x_1 \geq 4$ then **one** out of the following three constraints must hold: $x_2 \leq 3, x_3 \leq 4, x_4=5$

You can avoid several occurrences of $M$ as follows: \begin{align} x_1 &\leq 4 + Mz_1 \\ x_2 &\leq 3 + M(1-z_2) \\ x_3 &\leq 4 + M(1-z_3) \\ x_4 &\leq 5 + M(1-z_4) \\ x_4 &\geq 5 - ...
RobPratt's user avatar
  • 32.7k
4 votes

How to linearize the following logical constraints?

Assume $0 \le x \le U$ for some constant $U$. Introduce binary decision variable $\delta$ and impose $x=y+z$ and indicator constraints: \begin{align} \delta=0 &\implies (0 \le x \le A \land y = x)...
RobPratt's user avatar
  • 32.7k

Top 50 recent answers are included