-1

I am performing an Integer Linear Programming optimisation with the following constraint:

s.t. Constraint {i in N}: sum {j in F} A[i,j] * X[j] >= B[i];

How do I modify the constraint above so that it is able to constrain my model in a way that X1 and X3 are not present in any solution at the same time? These two variables may never coincide. Thanks for your input.

1 Answers1

0

This can be formulated by a complementarity constraint:

x[1]*x[3] = 0

However, this is nonlinear (and non-convex). A linear approach can look like:

x[1] <= M*δ
x[3] <= M*(1-δ)
δ ∈ {0,1}

We added a binary variable δ to the problem. I assume here that x[1] and x[3] are non-negative variables, and that M is a reasonable upper bound on x[1] and x[3].

If x[1] and x[3] are free variables (i.e., they can assume positive and negative values), one can write:

-M*δ <= x[1] <= M*δ
-M*(1-δ) <= x[3] <= M*(1-δ)
δ ∈ {0,1}

Notes:

  1. It is important to choose a value for M with care. It should not be too large, but too small will cut off solutions. It is possible to use different big-M values for the different places we used M instead of just one value.
  2. If you don't have good bounds available on x[1],x[3] then you can use a SOS1 (Special Ordered Set of Type 1) construct, or indicator constraints (implications). This is a bit more advanced and exotic, so see the AMPL documentation for details on how to use these in AMPL models.
  3. The above is in "math" notation, but transcribing this into AMPL syntax is not difficult. The first step is always to get the concepts right, and mathematical notation is a good tool for that.
Erwin Kalvelagen
  • 15,677
  • 2
  • 14
  • 39