Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX MIP CALLBACK termination

    Posted 10/09/15 02:27 PM

    Originally posted by: prasr29


    Hello,

                 Greetings. I am using concert technology in C++ and I am facing an issue with respect to the callback which I have written. Actually the problem is to as soon as an incumbent node has a integer value less than a particular value, the program should stop execution.  The code I have written is as follows: 

    ILOMIPINFOCALLBACK3(abortingCallback,
                        IloCplex, cplex,
                        IloBool, aborted,
                        double, sol_cut1)
    {
         if ( !aborted  &&  hasIncumbent()) {
             cout<<"sol_cut"<<sol_cut1<<endl;
            if(sol_cut1 > getIncumbentObjValue()){
                //printf ("Obj at Incumbent\n", cplex.getObjValue);
             aborted = IloTrue;
             abort();
          }
       }
    }

    The value sol_cut is passed from the main program.

    Cplex is giving results as follows:

    After the callback is encountered it stops but in this stage I want the execution to stop but it solves still optimality. Is it something wrong that I am doing here ? Thanks for your help.

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: CPLEX MIP CALLBACK termination

    Posted 10/09/15 02:58 PM

    The log looks as if you call IloCplex::solve() a second time? Is that possible?

    We can see the line

    sol_cut ...

    printed. This comes from your callback that is supposed to abort the run. A few lines later we see CPLEX report timings:

    Root node processing (before b&c): ...
    ...
    Total (root+branch&cut) = ...

    This is usually printed right before solve() returns. Next we see the line

    MIP emphasis ...

    which usually indicates a new call to solve().


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: CPLEX MIP CALLBACK termination

    Posted 10/09/15 03:14 PM

    Originally posted by: prasr29


    Thanks for your answer Daniel. Indeed that's the problem. There is another solve command, after the callback. Corrected it now and its all good. Thank you :) 


    #CPLEXOptimizers
    #DecisionOptimization