Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Solver ignoring constraints in C++

    Posted Thu June 06, 2013 12:10 PM

    Originally posted by: vicsana1


    I am generating MIP problems with binary variables that need to be optimized. There is a set of constraints that make that some of the variables are not possible at the same time. However, the solver is completely ignoring these constraints despite the fact that there are feasible solutions. It is making all of the variables true. The solver automatically transforms my model to this model:

    \ENCODING=ISO-8859-1
    \Problem name: IloCplex

    Maximize
     obj: 63 x1 + 97 x2 + 24 x3 + 59 x4 + 93 x5 + 83 x6 + 68 x7 + 13 x8 + 14 x9
          + 97 x10 + 98 x11 + x12
    Subject To
     c1: x13 <= 1e+20
     c2: x14 <= 1e+20
     c3: x15 <= 1e+20
     c4: x16 <= 1e+20
     c5: x17 <= 1e+20
     i1: x13 = 1 <-> x1 + x5 + x6  = 1
     i2: x14 = 1 <-> x2 + x4 + x7 + x8  = 1
     i3: x15 = 1 <-> x4 + x9 + x10  = 1
     i4: x16 = 1 <-> x5 + x7 + x9 + x11  = 1
     i5: x17 = 1 <-> x3 + x6 + x8 + x10 + x11  = 1
    Bounds
     0 <= x1 <= 1
     0 <= x2 <= 1
     0 <= x3 <= 1
     0 <= x4 <= 1
     0 <= x5 <= 1
     0 <= x6 <= 1
     0 <= x7 <= 1
     0 <= x8 <= 1
     0 <= x9 <= 1
     0 <= x10 <= 1
     0 <= x11 <= 1
          x12 = 0
     0 <= x13 <= 1
     0 <= x14 <= 1
     0 <= x15 <= 1
     0 <= x16 <= 1
     0 <= x17 <= 1
    Binaries
     x1  x2  x3  x4  x5  x6  x7  x8  x9  x10  x11  x13  x14  x15  x16  x17
    End

    As you can see,  x2 x5 x10 is a valid solution, but still the solver is computing x1 x2 x3... x11

    Any suggestions?

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Solver ignoring constraints in C++

    Posted Thu June 06, 2013 04:11 PM

    Variables x1 through x11 all have positive coefficients in the objective, and if you set all the variables x1 through x11 equal to 1 and all of x13 through x17 equal to zero then i1 through i5 are satisfied. (I assume that "<->" means equivalence, or "if and only if".) So x1 = ... = x11 = 1, x12 = ... = x17 = 0 looks optimal to me.

    Paul


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Solver ignoring constraints in C++

    Posted Thu June 06, 2013 04:50 PM

    Originally posted by: T_O


    I did not check the solutions, but as Paul said, maybe you just mixed up Maximize and Minimize.

    Best regards,
    Thomas


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Solver ignoring constraints in C++

    Posted Thu June 06, 2013 05:14 PM

    Originally posted by: vicsana1


    Thanks to both for the quick response.

    From the model printed, the goal of the objective function is maximizing, so whenever it is possible they should be 1 instead of 0. However, constraints i1 to i5 should make some of those binary variables exclusive. For instance, in the case of i1, x1 + x5+ x6 = 1, so if x1=1, then x5 and x6 should be equal to 0. Otherwise the constraint is violated. The solver is returning all of the variables set to 1 so those constraints are violated. That's what is really shocking me.

    Thanks in advance and best regards,

     

    Victor


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Solver ignoring constraints in C++

    Posted Fri June 07, 2013 03:21 AM

    Originally posted by: T_O


    I think you are misinterpreting the these equivalence constraints:

    i1: x13 = 1 <-> x1 + x5 + x6 = 1 means that x13 = 1 iff x1 + x5 + x6 = 1. In your case, x13 = 0, so x1 + x5 + x6  = 1 MUST NOT be true, which is correct.

    Best regards,
    Thomas


    #CPLEXOptimizers
    #DecisionOptimization