[Math] Conditional Constraints in Linear Programming

linear programmingoptimization

My variables are [$x_1,x_2,x_3,x_4,x_5,x_6,x_7,x_8$]. All are continuous variables within the range of $[0,1]$. I want to impose a conditional constraint which is as follows:

if $x_6 \gt 0$
then $x_1 + x_3 =1$.

How can I go about doing this using linear inequalities?

Best Answer

The possible constraints of a linear program are of the form $$ a^\top \, x \, \triangle \, \beta, \quad \triangle \in \{ =, \le, \ge \} $$ These are statements about the solution vector $x$ being part of the hyperplane or lying in a half space below or above an affine hyperplane with normal $a$.

Your constraints would require half a hyperplane only, which is not possible to express by a set of full hyperplanes.

Note: The following all include the constraints $x_i \in [0,1]$, restricting the search space to a cube.

Here is a visualization in $(x_1, x_2, x_6)$:

problem 1

The search space is the union of the green square $x_6 = 0$ and the purple rectangle without bottom border $x_1 + x_2 = 1 \wedge x_6 > 0$. We can only model $x_1 + x_2 = 1$, but the extra part $x_1 + x_2 = 1 \wedge x_6 = 0$ is part of the first region, so we do not leave the search space. The solution can be found by running two optimizations and then selecting the best result.

This is a visualization of the second problem in $(x_1,x_2,x_3)$ only:

problem 2

The search space is the union of the yellow square $x \mid x_2 = 0$ and the purple square without the foremost side $x_2 > 0 \wedge x_3 = 0$. Again run as two problems and pick the best solution.

For all variables we hope as well, to describe the search space as union of spaces that can be modelled by LP constraints.

  • $X_1 = \{ x \mid x_2 = x_4 = x_6 = 0 \}$
  • $X_2 = \{ x \mid x_2 > 0 \wedge x_3 = x_5 = x_7 = 0 \}$
  • $X_3 = \{ x \mid x_2 = 0 \wedge x_4 > 0 \wedge x_5 = x_7 = 0 \}$
  • $X_4 = \{ x \mid x_2 = x_4 = 0 \wedge x_6 > 0 \wedge x_7 = 0 \}$

This seems to be covering the whole search space $X$, e.g.

  • $X_5 = \{ x \mid x_2 > 0 \wedge x_4 > 0 \wedge x_3 = x_5 = x_7 = 0 \subsetneq X_2$
  • $X_6 = \{ x \mid x_2 > 0 \wedge x_6 > 0 \wedge x_3 = x_5 = x_7 = 0 \subsetneq X_2$
  • $X_7 = \{ x \mid x_2 > 0 \wedge x_4 > 0 \wedge x_6 > 0 \wedge x_3 = x_5 = x_7 = 0 \subsetneq X_2$
Related Question