I found a solution for just one term here
How can we formulate constraints of the form
$$ \sum_{i=1}^n |x_i -a_i| \ge K $$
in Mixed Integer Linear Programming ?
Operations Research Stack Exchange is a question and answer site for operations research and analytics professionals, educators, and students. It only takes a minute to sign up.
Sign up to join this communityI found a solution for just one term here
How can we formulate constraints of the form
$$ \sum_{i=1}^n |x_i -a_i| \ge K $$
in Mixed Integer Linear Programming ?
In CPLEX you can use the absolute value. For instance with the OPL API you can write
int n=5;
range r=1..n;
int K=10;
int a[i in r]=i;
dvar int x[r];
subject to
{
sum (i in r) abs(x[i]-a[i])>=K;
}