Originally posted by: SystemAdmin
[prubin said:]
[quote author=tomba12 link=topic=1397.msg3881#msg3881 date=1254437729]
I have a constraint like the following :
a-b>d or c-a<d<br />
only one of these conditions must be satisfied. How do i create such constraint in Linear Programming?
You don't. First, a disjunction creates a nonconvex feasible region, so LP is out; you will have to settle for a MILP model (one or more binary variables). Second, you can't have strong inequalities, so you'll have to settle for a - b >= d or c - a <= d (unless the terms are integers, since > integer is the same as >= integer + 1 -- but if this was supposed to be an LP, presumably the variables are not integers).
If only one condition needs to be satisfied but it is permissible to satisfy both (or if satisfying both is impossible due to other constraints), then a single binary variable z will do the job, assuming that you have a priori bounds for the two left-hand sides. Add the constraints
a - b >= d - M_1*z
c - a <= d + M_2*(1 - z)<br />
where z is a binary variable, M_1 is a valid lower bound for a - b - d, and M_2 is a valid upper bound for c - a - d.
/Paul
#DecisionOptimization#MathematicalProgramming-General