As mentioned in the title, how to use a linear constrain to ensure an integer n is staying out of (n1, n2), in which n,n1,n2 are all integers, and the interval is not [n1, n2].
I formulate the problem in GAMS as
n2 - n1 =l= abs(2*n - n2 - n1)
but the abs()
is not allowed in a MIP model.
THX
You need to define a binary variable (nlow) for n beening eighter below or above the interval. Then use two constraints to inforce this. The number M should be large egnouf that it does not limit your variable n.