How to convert a non-linear constraint to a linear constraint?

150 Views Asked by At

How to convert non-linear constraint $s_{k} = \min(t_i y_{ik})$ to MIP constraint?

Here, $t_i$ is a positive decision variable and $y_{ik}$ is a binary decision variable.

2

There are 2 best solutions below

4
On

Disclaimer: This answers the question as posted, which (based on a comment below) is apparently not what was intended. I have a second answer below for what I believe was intended.

Given the clarification in the comment, it should be sufficient to enforce $s_k \le t_i \cdot y_{ik}$ for all $i.$ Since cost is a decreasing function of $s_k,$ any optimal solution will automatically use the largest possible value of $s_k.$

Assuming you know an upper bound $T_i$ for $t_i,$ you just need the following constraints for each $k:$ $$s_k \le t_i\quad\forall i$$ and $$s_k \le T_i\cdot y_{ik}\quad\forall i.$$ If any $y_{ik}$ is 0, $s_k$ will be 0. Otherwise, $s_k$ will be set to the smallest $t_i.$

2
On

The following answers what appears to have been the intended question: how to model the constraint that $s_k = \min \lbrace t_i | y_{ik}=1 \rbrace$ with the minimum of an empty set taken to be 0 (i.e., $s_k=0$ if $y_{ik}=0$ for all $i.$

Assume that $i$ runs from 1 to $N$ and that $M_k$ is a valid upper bound for $s_k \ge 0.$ Introduce binary variables $z_{ik}$ for $i=0,\dots,N$ along with the following constraints: $$\sum_{i=0}^N z_{ik}=1\quad (1)$$ $$z_{ik}\le y_{ik} \quad i=1,\dots,N\quad (2)$$ $$\sum_{i=1}^N y_{ik} \le N(1-z_{0k})\quad (3)$$ $$s_k = \sum_{i=1}^N t_i z_{ik} \quad (4)$$ $$s_k \le t_i + M_k(1 - y_{ik})\quad i=1,\dots,N\quad (5).$$ Variable $z_{ik}$ selects which $t_i$ will be the value of $s_k$ (or sets $s_k=0$ if $z_{0k}=1$). Constraint (4) enforces that, and constraint (1) enforces selection of a single $i.$ Constraint (2) says that we cannot select an $i\in \lbrace 1,\dots,N\rbrace$ unless $y_{ik}=1.$ Constraint (3) says that we can only set $z_{0k}=1$ if all $y_{ik}=0.$ Finally, constraint (5) ensures $s_k \le t_i$ whenever $y_{ik} = 1.$

An alternative to (3) is $$y_{ik} \le 1-z_{0k}\quad i=1,\dots,N\quad (3').$$ (3') makes the formulation a bit larger but a bit tighter.