Defining variables for optimization problem

49 Views Asked by At

I'm defining variables for a linear programming problem, where I've already defined $x_{kj}\in\mathbb{Z}^+$. I'd like to define

$$y_{kj}=\begin{cases} 1 & x_{kj}\geq 1\\ 0 & x_{kj}=0 \end{cases}$$

Since $y_{kj}\in\{0,1\}$ and $x_{kj}\geq 0$, I can write $y_{kj}\leq x_{kj}$ to make sure $x_{kj}=0\Rightarrow y_{kj}=0$. But I can't find a linear expression that implies $x_{kj}\geq 1\Rightarrow y_{kj}=1$

What additional restrictions do I need in order to make sure that $y_{kj}=1$ when $x_{kj}\geq 1$?

1

There are 1 best solutions below

1
On BEST ANSWER

Let M be an upper bound on $x_{jk}$

Use the constraints:

$x_{kj} \le My_{kj}$

$x_{kj} \ge y_{kj}$

The first constraint forces $y_{kj} = 1$ when $x_{kj} \ge 1$.