I have an optimization problem that I'm working on. The objective is defined as follows:
$Maximize: c_i\cdot w_i \cdot x_i - d_i \cdot y_i \cdot \delta_i $
subject to some linear constraints where $c_i, w_i$ and $d_i$ are scalars and
$x_i, \delta_i \in \{0,1\}$ and $y_i \in Z^+$
I wish to linearize this objective function so that I can solve it with an existing ILP solver. I found this link that suggests the following in case of a quadratic variable like $y_i\cdot\delta_i$ above:
Introduce a variable $z_i = y_i \cdot \delta_i$ w.r.t. to the following constraints:
$ L\cdot\delta_i \leq z_i \leq U \cdot \delta_i $
$ z_i \leq y_i - L\cdot(1-\delta_i)$
$ z_i \geq y_i - U \cdot (1-\delta_i)$
where: $ L \leq y_i \leq U$ are the lower and upper bounds on the values of $y_i$
Questions:
- Is this a common trick to linearize quadratic variables where one of them is a binary variable?
- How to intuitively understand this transformation so as to remember why/how it works?
- Are there other ways to achieve the same thing?