Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX behavoir with and without callback function

    Posted 05/21/16 04:28 PM

    Originally posted by: Lessi


     

    I use the callback function to estimate how long a solution is found. Without the callback function, it took about 100 secs, and with the callback function, it took more than  5 minutes. What should I do to obtain the similar performance to the one without the callback function.

     

    Another question, I set the optimal gap is 1%, so why the solver stopped with the gap  9.36%. There are other runs with other instances that the gaps were 0.0%

     

    
    This is the callback function
    IloNum bestSolnTime;
    
    ILOINCUMBENTCALLBACK0(BestSolnCPUTimeCallback)
    {
       bestSonTime = cplex.getTime();
    }
    

     

    Without callback function  

    39298  6818     2568.0000    11     2650.0000     2402.0000   380691    9.36%
      39299  6818     2568.0000    10     2650.0000     2402.0000   380694    9.36%
    Elapsed time = 98.84 sec. (51366.20 ticks, tree = 8.45 MB, solutions = 3)

    Cover cuts applied:  2
    Flow cuts applied:  4
    Mixed integer rounding cuts applied:  3
    Gomory fractional cuts applied:  1

    Root node processing (before b&c):
      Real time             =    0.88 sec. (306.66 ticks)
    Sequential b&c:
      Real time             =  100.13 sec. (52188.00 ticks)
                              ------------
    Total (root+branch&cut) =  101.00 sec. (52494.65 ticks)
    Objective value:2650

     

    With callback function

      185848 152322     2506.0000     8     2650.0000     2241.0000  2050007   15.43%         z_1.638 D 185848 185847    449
     185849 152323     2506.0000     8     2650.0000     2241.0000  2050009   15.43%         z_1.642 D 185849 185848    450
    Elapsed time = 321.80 sec. (142953.75 ticks, tree = 170.72 MB, solutions = 3)

    .....

    Thanks,

    Lessi

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: CPLEX behavoir with and without callback function

    Posted 05/23/16 01:09 AM

    The incumbent callback is a control callback. Using a control callback will do two things:

    1. It will switch CPLEX to sequential mode by default (you can go back to multi-threaded mode by explicitly setting CPX_PARAM_THREADS),
    2. it will turn off dynamic search (this does not work with control callbacks).

    Depending on how accurate your measurements need to be, you can either use an info callback (which is not a control callback) or use CPX_PARAM_INTSOLFILEPREFIX and check the creation times of the created files.

    What is the CPLEX status when CPLEX stops with a gap that looks too big for the current parameter settings? Could it be that some other termination criterion was satisfied? Do your read the final gap from the log or do you get it from IloCplex::getMipRelativeGap()? The last gap reported in the log may not be the gap with which CPLEX stopped.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: CPLEX behavoir with and without callback function

    Posted 05/23/16 09:28 AM

    Originally posted by: Lessi



    Thank you very much. I tried your suggestion and it works. getMipRelativeGap returns 0 as I expect.

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: CPLEX behavoir with and without callback function

    Posted 05/23/16 02:24 PM

    Originally posted by: EhsanN


    Dear Daniel,

    Thanks for your answer. The CPX_PARAM_INTSOLFILEPREFIX parameter is interesting and useful for other purposes as well. However, I cannot figure out how to use the information callback to achieve the aforementioned goal. I checked the documentation and the most relevant information it could return is the objective value of the best integer solution found so far. Can you elaborate on that.

     

    Thanks,

    Ehsan


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: CPLEX behavoir with and without callback function

    Posted 05/30/16 01:31 AM

    The idea is to remember the incumbent objective value reported in the last invocation of the callback. If that value changed then you know that the new solution was found between the two invocations of the callback.


    #CPLEXOptimizers
    #DecisionOptimization