3
$\begingroup$

Given a set $J$, I have the following constraint:

$w_j = y_j u \quad \forall j \in J$

where $y_j \in \mathbb{N}$ and $u \in \mathbb{R}⁺_0$. I would like to make this constraint linear.

Note: I am familiar with the linearization of this similar constraint when $y_j \in \{0, 1\} \quad \forall j \in J$ which could be

$w_j \leq u, \quad \forall j \in J$

$w_j \leq My_j, \quad \forall j \in J$

$w_j \geq u - M(1 - y_j), \quad \forall j \in J$.

However in my case, $y_j$ is not a binary variable but a integer non-negative variable.

Just so it is clear, $\mathbb{N}$ is the set of all integers including $0$ and $\mathbb{R}⁺_0$ is the set of all real non-negative numbers.

$\endgroup$

1 Answer 1

5
$\begingroup$

If you can bound $y_j$ by some (not too large) positive integer $Y$, so that $y_j\in \{0,1,\dots,Y\}$, you can introduce binary variables $z_0, z_1,\dots,z_Y$ and add the following constraints:$$\sum_{i=0}^Y z_i=1$$ $$y_j=\sum_{i=0}^Y i\cdot z_i$$and $$w_j=\sum_{i=0}^Y i\cdot z_i \cdot u.$$Now linearize each of the products $z_i\cdot u$.

$\endgroup$
2
  • $\begingroup$ That worked for me! I would just like to point out that I think it may be missing a j index in the z variable. $\endgroup$ Commented Apr 12, 2019 at 13:52
  • $\begingroup$ Yes. I wrote it for a single value of $j$, but if you are going to do it for each $j\in J$, then $z_i$ should be $z_{ji}$ (or $z_{ij}$). $\endgroup$
    – prubin
    Commented Apr 13, 2019 at 15:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .