Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Strange error when migrating from CPLEX 10.2 to 12.1

    Posted 03/22/10 10:04 AM

    Originally posted by: Chicoscience


    Hi, I am now migrating to CPLEX 12.1 and my code, which works perfectly with CPLEX 10.2, is not working anymore.

    When the following code is executed:

    cplex.solve();
    IloNum status = cplex.getStatus();
    try {
    IloNum value = cplex.getObjValue();
    } catch (IloCplex::Exception e) {
    printf("ERROR: %d\n", (int)e.getStatus());
    }

    On CPLEX 12.1, the satus returned is Optimal (alright) but when I try to retrieve the best objective value the following error code is printed:

    ERROR: 1217

    which estates that there exists no solution to the problem. This piece of code works fine with CPLEX 10.2. Can anybody help me?

    Thank you very much,
    Chicoscience
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Strange error when migrating from CPLEX 10.2 to 12.1

    Posted 03/22/10 11:25 AM

    Originally posted by: Chicoscience


    Return value of a few functions:

    cplex.solve() -> true
    cplex.getStatus() -> Optimal
    cplex.isPrimalFeasible() -> FALSE
    cplex.isDualFeasible() -> FALSE

    How can that be possible? There has to be a very simple solution to this problem.

    Thank you,
    Chicoscience
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Strange error when migrating from CPLEX 10.2 to 12.1

    Posted 03/22/10 11:31 AM

    Originally posted by: SystemAdmin


    First, I'm not sure I would trust assigning the value of getStatus to an IloNum. IloCplex::getStatus returns an enumeration (type IloAlgorithm::Status), and while I don't know that it actually happens, conceivably the CPLEX developers could change the indexing of that enumeration from one version to the next. You might try

    IloAlgorithm::Status status = cplex.getStatus();
    if (status == IloAlgorithm::Status::Optimal) { ... }

    to verify that you're really getting an optimal solution.

    Also, it might be useful to check cplex.getCplexStatus(), which returns an enumeration (IloCplex::CplexStatus) that's a bit more granular.

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Strange error when migrating from CPLEX 10.2 to 12.1

    Posted 03/22/10 12:15 PM

    Originally posted by: Chicoscience


    Hi Paul, thank you for your answer.

    I put the following piece of code:

    cplex.out() << "Status is " << cplex.getStatus() << endl;
    cplex.out() << "Cplex Status is " << cplex.getCplexStatus() << endl;

    And the result was:

    Status is Optimal
    Cplex Status is OptimalTol

    I defined a tolerance value, that's why I got OptimalTol. I still don't get it, why does it happen?
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Strange error when migrating from CPLEX 10.2 to 12.1

    Posted 03/22/10 01:11 PM

    Originally posted by: EdKlotz


    > Chicoscience wrote:
    > Hi Paul, thank you for your answer.
    >
    > I put the following piece of code:
    >
    > cplex.out() << "Status is " << cplex.getStatus() << endl;
    > cplex.out() << "Cplex Status is " << cplex.getCplexStatus() << endl;
    >
    > And the result was:
    >
    > Status is Optimal
    > Cplex Status is OptimalTol
    >
    > I defined a tolerance value, that's why I got OptimalTol. I still >on't get it, why does it happen?

    Can you provide a bit more information. Specifically:

    1) What type of problems are you solving? LP? MILP?

    2) Can you provide the optimizer output from the run with CPLEX 10.2 and 12.1?
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Strange error when migrating from CPLEX 10.2 to 12.1

    Posted 03/23/10 07:18 AM

    Originally posted by: Chicoscience


    Hi Edklotz, thank you for your answer as well. I am solving a MIP problem, even on CPLEX 12.1 the output is ok, it looks like the problem was solved. The outputs:

    Output with CPLEX 10.2

    ILOG CPLEX 10.200, licensed to "IBM ILOG Optimization Suite for Academic Initiative", options: e m b q 
    MIP start values provide initial solution with objective 369.0000.
    Clique table members: 1614.
    MIP emphasis: balance optimality and feasibility.
    Root relaxation solution time =    0.01 sec.
     
            Nodes                                         Cuts/ 
       Node  Left     Objective  IInf  Best Integer     Best Node    ItCnt     Gap         Variable B Parent  Depth
     
          0     0      341.7500    66      369.0000      341.7500       95    7.39%
                       352.4375    69      369.0000     Cuts:  67      137    4.49%
                       354.0357    83      369.0000     Cuts:  70      160    4.06%
                       354.2237    88      369.0000      User:  1      174    4.00%
                       354.6180    87      369.0000      User:  1      188    3.90%
                       354.8965    85      369.0000      User:  1      206    3.82%
                       355.6667    92      369.0000      User:  1      233    3.61%
                       356.5511    77      369.0000      User:  1      253    3.37%
                       356.6270    89      369.0000      User:  1      263    3.35%
                       357.2500    77      369.0000      User:  1      284    3.18%
                       357.5000    78      369.0000      User:  1      294    3.12%
                       357.5278    87      369.0000      User:  1      309    3.11%
                       357.5972    82      369.0000      User:  1      315    3.09%
                       357.6250    81      369.0000      User:  1      320    3.08%
                       357.7917    77      369.0000      User:  1      327    3.04%
                       357.8750    75      369.0000      User:  1      329    3.02%
                       357.9375    88      369.0000      User:  1      334    3.00%
                       358.0000    86      369.0000      User:  1      336    2.98%
                       358.2339    69      369.0000      User:  1      346    2.92%
                       358.2353    71      369.0000      User:  1      347    2.92%
                       358.2372    71      369.0000      User:  1      350    2.92%
                       358.2730    77      369.0000      User:  1      355    2.91%
                       358.2730    80      369.0000      User:  1      356    2.91%
                       358.2857    79      369.0000      User:  1      359    2.90%
                       358.2976    82      369.0000      User:  1      361    2.90%
                       358.2976    85      369.0000      User:  1      362    2.90%
                       358.3033    76      369.0000      User:  1      364    2.90%
                       358.3073    83      369.0000      User:  1      366    2.90%
                       358.3108    85      369.0000      User:  1      368    2.90%
                       358.3199    82      369.0000      User:  1      373    2.89%
                       358.3333    79      369.0000      User:  1      376    2.89%
                       358.3333    92      369.0000      User:  1      377    2.89%
                       358.3333    95      369.0000      User:  1      378    2.89%
                       358.3514    89      369.0000      User:  1      385    2.89%
                       358.3708    92      369.0000      User:  1      389    2.88%
                       358.3750    76      369.0000      User:  1      391    2.88%
                       358.6207    78      369.0000      User:  1      403    2.81%
                       358.6619    91      369.0000      User:  1      412    2.80%
                       358.7273    86      369.0000      User:  1      415    2.78%
                       358.7500    77      369.0000      User:  1      417    2.78%
                       359.0000    67      369.0000      User:  1      420    2.71%
                       359.0000    76      369.0000      User:  1      424    2.71%
         10     9      362.5000    10      369.0000      360.9167      874    2.19%          id1290 U      9      6
    *    13     9                   0      365.0000      360.9167      977    1.12%          id1248 N     12      8
         20     9      363.4722    44      365.0000      361.3750     1315    0.99%          id1319 U     19      8
         30     7      364.1000    40      365.0000      362.9500     1671    0.56%          id1292 U     29      6
    *    36     0                   0      364.0000      363.6667     1986    0.09%          id1325 U     35      7
     
    Gomory fractional cuts applied:  10
    User cuts applied:  207
    Return from cplex.solve(): true
    Status is Optimal
    Cplex Status is 102
    cplex.isPrimalFeasible()? true
    cplex.isDualFeasible()? true
    

    Output with CPLEX 12.1

    IBM ILOG License Manager: "IBM ILOG Optimization Suite for Academic Initiative" is accessing CPLEX 12 with option(s): "e m b q ".
    1 of 1 MIP starts provided solutions.
    MIP start 'm1' defined initial solution with objective 369.0000.
    Warning: Control callbacks may disable some MIP features.
    Clique table members: 1614.
    MIP emphasis: balance optimality and feasibility.
    MIP search method: traditional branch-and-cut.
    Parallel mode: none, using 1 thread.
    Root relaxation solution time =    0.02 sec.
     
            Nodes                                         Cuts/ 
       Node  Left     Objective  IInf  Best Integer     Best Node    ItCnt     Gap         Variable B NodeID Parent  Depth
     
    *     0+    0                          369.0000                     95     --- 
          0     0      341.7500    66      369.0000      341.7500       95    7.38%
          0     0      353.8333    55      369.0000      Cuts: 70      148    4.11%
          0     0      355.5000    74      369.0000       Cuts: 5      161    3.66%
          0     0      356.2500    85      369.0000       Cuts: 3      175    3.46%
          0     0      357.0135    60      369.0000       User: 1      191    3.25%
          0     0      358.2500    46      369.0000       Cuts: 4      202    2.91%
          0     0      358.5000    22      369.0000       Cuts: 3      204    2.85%
          0     0      358.6111    80      369.0000       Cuts: 3      211    2.82%
          0     0      359.0000    40      369.0000       User: 1      220    2.71%
          0     0      359.5000    69      369.0000       Cuts: 3      236    2.57%
          0     0      359.5000    77      369.0000       User: 1      239    2.57%
          0     0      359.5000    44      369.0000       User: 1      241    2.57%
          0     0      359.5000    82      369.0000       User: 1      242    2.57%
          0     0      359.5000    37      369.0000       User: 1      246    2.57%
          0     0      359.5000    42      369.0000       User: 1      247    2.57%
          0     0      359.5000    30      369.0000       User: 1      251    2.57%
          0     0      359.5000    34      369.0000       User: 1      252    2.57%
          0     0      359.5333    81      369.0000       User: 1      259    2.57%
          0     0      359.5714    73      369.0000       User: 1      262    2.56%
          0     0      359.5789    82      369.0000       User: 1      263    2.55%
          0     0      359.6000    52      369.0000       User: 1      267    2.55%
          0     0      359.6250    58      369.0000       User: 1      269    2.54%
          0     0      359.6667    41      369.0000       User: 1      270    2.53%
          0     0      359.6785    87      369.0000       User: 1      280    2.53%
          0     0      359.6849    86      369.0000       User: 1      283    2.52%
          0     0      359.7273    85      369.0000       User: 1      284    2.51%
          0     0      359.7778    55      369.0000       User: 1      288    2.50%
          0     0      359.7778    56      369.0000       User: 1      291    2.50%
          0     0      360.0000    30      369.0000       User: 1      298    2.44%
          0     0      360.1364    61      369.0000       User: 1      304    2.40%
          0     0      360.1667    60      369.0000       User: 1      305    2.39%
          0     0      360.2209    84      369.0000       User: 1      309    2.38%
          0     0      360.2500    61      369.0000       User: 1      311    2.37%
          0     0      360.2500    55      369.0000       User: 1      313    2.37%
          0     0      360.2500    45      369.0000       User: 1      314    2.37%
          0     0      360.2500    63      369.0000       User: 1      315    2.37%
          0     0      360.2500    53      369.0000       User: 1      316    2.37%
          0     0      360.2500    53      369.0000       User: 1      317    2.37%
          0     0      360.2632    56      369.0000       User: 1      318    2.37%
          0     0      360.2652    89      369.0000       User: 1      319    2.37%
          0     0      360.2667    59      369.0000       User: 1      321    2.37%
          0     2      360.2667    59      369.0000      360.3333      321    2.35%                        0             0
         10    12      363.2500    18      369.0000      362.8333      696    1.67%          id1307 D     10      9      7
    *    12    12      integral     0      365.0000      362.8333      738    0.59%            id10 U     12     11      9
         20    10      364.7031    58      365.0000      363.2647     1090    0.48%          id1284 U     20     19      3
    *    23     5      integral     0      364.0000      363.3333     1177    0.18%
     
    Zero-half cuts applied:  17
    Gomory fractional cuts applied:  1
    User cuts applied:  151
     
    Return from cplex.solve(): true
    Status is Optimal
    Cplex Status is OptimalTol
    cplex.isPrimalFeasible()? false
    cplex.isDualFeasible()? false
    Error 1217 when calling cplex.getObjValue()
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Strange error when migrating from CPLEX 10.2 to 12.1

    Posted 03/23/10 07:21 AM

    Originally posted by: Chicoscience


    As you can see by the output, it is a Branch-and-Cut algorithm and the Cplex Status is different, it is 102 when using Cplex 10.2 and OptimalTol when using Cplex 12.1... what 102 means?
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Strange error when migrating from CPLEX 10.2 to 12.1

    Posted 03/23/10 10:38 AM

    Originally posted by: SystemAdmin


    Status 102 is CPXMIP_OPTIMAL_TOL, so the same as in CPLEX 12.1. Maybe, the << operator in the Concert version shipped with CPLEX 10 did not understand status 102?
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Strange error when migrating from CPLEX 10.2 to 12.1

    Posted 03/23/10 10:40 AM

    Originally posted by: Chicoscience


    Probably yes... very strange, all seems fine with CPLEX 12.1 as the output shows, but I just can't read the solution and cplex thinks the problem is not primal feasible!! Very very strange!
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Strange error when migrating from CPLEX 10.2 to 12.1

    Posted 03/23/10 10:52 AM

    Originally posted by: SystemAdmin


    Does this happen for all problem instances that you try, or is this specific to this one? Can you post the problem instance such that we can take a look?
    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: Strange error when migrating from CPLEX 10.2 to 12.1

    Posted 03/23/10 11:02 AM

    Originally posted by: Chicoscience


    Hi Tobias, I found it! As usual it was the programmer's fault :-), but it is still interesting to report it.

    After cplex.solve(), I was calling cplex.clearCuts() - this is because this code (and the object it represents) is also used as a inner solver of a Local Branching algorithm.

    When I removed the execution of cplex.clearCuts(), it worked properly with CPLEX 12.1. I still don't get why did it work with CPLEX 10.2 but not with 12.1, what changed in clearCuts() function?

    Thank you very much,
    Chicoscience
    #CPLEXOptimizers
    #DecisionOptimization