Decision Optimization

Decision Optimization

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

 View Only
  • 1.  x2 > x1 (integer constraint)

    Posted Mon August 24, 2015 11:47 AM

    Originally posted by: fcimeson


    I'm trying to construct a integer program that has a solution of x2 > x1 when x3 = 1, however cplex seems do something odd with the constraint c1 (x2 - x1 + 99 x3 > -99), perhaps it's a rounding error. Is there a different syntax that I can use to express c1 (x2 - x1 + 99 x3 > -99) to get the desired result? Thanks

    Problem File

    
    Maximize
     obj: x1 + x2
    Subject To
     c1: x2 - x1 + 99 x3 > -99
     c3: x3 = 1
    Bounds
     1 <= x1 <= 2
     1 <= x2 <= 2
    Binary
     x3
    General
     x1
     x2
    

    Solution

    
    MIP - Integer optimal solution:  Objective =  4.0000000000e+00
    Solution time =    0.00 sec.  Iterations = 0  Nodes = 0
    Deterministic time = 0.00 ticks  (1.11 ticks/sec)
    
    CPLEX> Incumbent solution
    Variable Name           Solution Value
    x1                            2.000000
    x2                            2.000000
    

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: x2 > x1 (integer constraint)

    Posted Mon August 24, 2015 12:19 PM

    Hi

    which API do you use ?

    in your example, imply is linearized.

    You could also in the lp format use indicators.

    Let me quote documentation:

    MIP indicator constraints

    This rule applies to CPLEX MIP optimizer.

    To specify an indicator constraint, enter it among any other constraints in the model, like this:

    
    [constraintname:]  binaryvariable = value  ->  linear constraint
    

    The constraint name, followed by a colon, is optional. The hyphen followed by the greater-than symbol (->), separates the indicator variable and its value from the linear constraint that is controlled. The indicator variable must be declared as a binary variable, and the value it is compared to must be either 0 (zero) or 1 (one).

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: x2 > x1 (integer constraint)

    Posted Tue August 25, 2015 02:08 PM

    Originally posted by: fcimeson


    Thank you, that is helpful.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer