Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to model disjunctive constraints in CPLEX?

    Posted 10/02/09 03:55 AM

    Originally posted by: SystemAdmin


    [tomba12 said:]

    Hi,

    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?
    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: How to model disjunctive constraints in CPLEX?

    Posted 10/03/09 03:13 AM

    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


  • 3.  Re: How to model disjunctive constraints in CPLEX?

    Posted 10/05/09 07:17 PM

    Originally posted by: SystemAdmin


    [jfk said:]

    Hello,
    if you find what Paul suggested hard or inconvenient then look for logical constraints in the doc, there are a couple of examples for each API:
    in the C++ API you can do

    model.add((a-b>d)  || (or c-a<d));<br />
    in OPL you can do
    (a-b>d)  ||  (c-a<d);<br />or
    (a-b>d)  +  (c-a<d) =< 1;<br />

    cheers



    #DecisionOptimization
    #MathematicalProgramming-General