Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  how to handle the situation with a indicator (binary)

    Posted 12/29/10 03:41 AM

    Originally posted by: QINGQINGQING


    dear all,
    I am now using cplex 9.0 to handle a MIP in java, I do not know how to handle the situation with a indicator (binary variable X).

    x=1 --> a=b

    both a and b are variables.
    Thank you
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: how to handle the situation with a indicator (binary)

    Posted 12/30/10 02:41 PM

    Originally posted by: SystemAdmin


    I believe you are responding to a suggestion I offered a few weeks ago. Indicator constraints were introduced five years ago in CPLEX 10, and if you are still using CPLEX 9 then the feature is not available to you. Many of the logical constraints and other modeling constructs in the Concert modeling layer for Java, which have been discussed in your other postings, are implemented using Indicator constraints.

    If you are at a university then the IBM Academic Initiative may be an option you should consider. It would allow you to install the current version of CPLEX Optimization Studio, which is now 12.2, and then many of the suggestions you are seeing here will be more directly applicable. There is a posting found on the main page of this Forum that explains more about enrolling in the Academic Initiative - this is a link to it: http://www.ibm.com/developerworks/forums/thread.jspa?threadID=335577 .

    If your CPLEX license is commercial then you should check with your IBM account manager to see what options you have for upgrading, because it sounds like you would benefit from using the newer features in the product.

    Regarding your specific question here, if Indicator constraints are unavailable, then the usual modeling technique is the so-called Big M method which depends on selecting a large coefficient in an inequality constraint to ensure that your desired constraint is enforced. For the example you gave, you could model it this way:
    a - b + Mx <= M
    a - b - Mx >= -M
    where the coefficient M is chosen so that it doesn't constrain the values a and b can take. When variable 'x' is 0, 'a-b' is required only to be between -M and M, i.e. effectively unconstrained if M is large enough. But when 'x' is 1, then a=b is enforced by the two constraints.

    The Big M method has been used successfully by many people, but some care must be taken. Making M too large can introduce numerical instability in a model that otherwise doesn't have trouble - this is one of the motivations behind the Indicators feature. Depending on information you have about variables 'a' and 'b', you may be able to select a modest value for M. Or the Presolve feature in the solver may be able to make the inferences for you and reduce the coefficient size, but this is not always possible.
    #CPLEXOptimizers
    #DecisionOptimization