3
$\begingroup$

I am working on a large NLP model with equilibrium equations in which the variables are defined in the following form: $$x_i \in [L_B, U_B] \cup\{0\} \quad \text{where} \quad L_B \ \& \ U_B \in\Bbb R^+ \quad \text{and } \quad 0<L_B<U_B$$

Is there any way to define such a hybrid (mixed discrete, continuous) domain for variables in Pyomo or Ampl? I know that it's possible to define binary variables as indicators but this approach added a big number of binary variables to the model which is already hard to be solved.

One idea is to implement something like an MPEC or variational inequalities (mpec package of Pyomo) approach where XOR has been defined for sets of constraints. But is it possible for variables?

$\endgroup$
2

1 Answer 1

3
$\begingroup$

An alternative approach to binary variables or semicontinuous variables is the following cubic polynomial inequality: $$x(x-L_B)(U_B-x)\ge 0$$ Because $x \ge 0$, this constraint enforces $$(x = 0) \lor (x - L_B \ge 0 \land U_B - x \ge 0),$$ as desired. The case $(x - L_B \le 0 \land U_B - x \le 0)$ is prevented by $L_B < U_B$.


After further consideration, I realized that a quadratic constraint and simple bounds are enough. We want to enforce $$(x = 0) \lor (x \ge L_B \land x \le U_B).$$ Distribute the $\lor$ to rewrite in conjunctive normal form: $$(x = 0 \lor x \ge L_B) \land (x = 0 \lor x \le U_B).$$ Because $U_B > 0$, this reduces to $$(x = 0 \lor x \ge L_B) \land (x \le U_B),$$ which you can enforce via \begin{align} x(x-L_B) &\ge 0 \\ 0 \le x &\le U_B \end{align} (For comparison, the usual big-M approach instead would replace the quadratic constraint with a binary variable and linear constraints to enforce the disjunction.)

$\endgroup$
2
  • $\begingroup$ I suppose modelling this way, we cannot guarantee to get a global optimum by the solver? The proposed constraint doesn´t define a convex set or am I mistaken? $\endgroup$
    – Clement
    Commented Dec 14, 2020 at 15:12
  • $\begingroup$ Yes, the feasible region is not convex, so a local solver would not guarantee global optimality. $\endgroup$
    – RobPratt
    Commented Dec 14, 2020 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.