In optimization problem, I have two constraints for decision variables $x_1$ and $x_2$ as follow

$0 \leq x_1 \leq u_1$ and $0 \leq x_2 \leq u_2$

I was wondering how can I replace these 2 constraints with just one constraint in terms of $x_1,x_2,u_1,u_2$. Hence, the goal is to reduce the number of constraints. I dont care if this results in nonlinear constraints.

  • $\begingroup$ I dont´t see a way to transform the two constraints into one constraint. Even it could be made formally you would still have technically two constraints. $\endgroup$ Commented Sep 2, 2017 at 18:39
  • $\begingroup$ May I ask what motive you have here? The answer isn't going to be any better practically. $\endgroup$ Commented Sep 3, 2017 at 2:28
  • $\begingroup$ It seems like an 'ill posed' problem. How do you count a "constraint"? Because what you wrote, in as I see it, is actually four constraints. So if I interpret the term 'constraint', I can write it as one constraint: $(x_1, x_2) \in C$, where $C = [0, u_1] \times [0, u_2]$. $\endgroup$ Commented Sep 3, 2017 at 3:21

2 Answers 2


Just replace the constraints with this one:

$$\max\{-x_1,x_1-u_1,-x_2,x_2-u_2\}\leq 0.$$

More generally, the inequality constraints

$$g_i(x)\leq 0,\;i=1,\ldots,m$$ can be replaced by the single constraint

$$\gamma(x)=\max_{i=1,...,m}\{g_i(x)\}\leq 0.$$ If $g_i$ is convex for each $i,$ then $\gamma $ is also convex. Hope this helps.


If one of the $u_i<0$, there is no solution.

If one of the $u_i=0$, we know $x_i=0$ and you can focus on another constraint.

Assuming $u_1$ and $u_2$ are both positive,

$$0 \leq \frac{x_i}{u_i} \leq 1$$

$$-\frac12 \leq \frac{x_i}{u_i} - \frac12 \leq \frac12$$

$$\left|\frac{x_i}{u_i}-0.5 \right| \leq 0.5$$

$$\max_{i=1,2} \left|\frac{x_i}{u_i}-0.5\right| \leq 0.5$$


You must log in to answer this question.

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