Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  What is really disabled by control callbacks

    Posted 10/05/18 10:57 AM

    Originally posted by: Rafael Colares


    Hi,

    I'am using CPLEX 12.7.1 with C++ to solve a MIP program.

    My problem is the following: if I solve the model without using any control callback, I get an optimal solution in "reasonable" time. However, if I add a dummy control callback (an empty callback), then the execution is much slower than before.

    I know, control callbacks may disable some features, such as dynamic search and parallelism. I also saw on the display log that presolve phase was slightly different in each case. For this reason, I set the following parameters:


            cplex.setParam(IloCplex::Param::MIP::Strategy::Search, 1);        

            cplex.setParam(IloCplex::Threads, 1);
            cplex.setParam(IloCplex::ParallelMode, 1);
            cplex.setParam(IloCplex::PreInd, 0);

     

    In this way, there is no parallelism, no dynamic search and no preprocessing. Still, performances were highly different ! 
    Without any callbacks, CPLEX finds an optimal solution after 70 sec.
    With a dummy callback, CPLEX struggles for more than 700 sec !

    Could someone please clarify me on what's going on? Which other features control callbacks may influence? I have searched for it but all I could find was dynamic search and parallelism...

     

    Thank you.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: What is really disabled by control callbacks

    Posted 10/05/18 12:04 PM

    What type of control callback did you set? A lazy constraint callback for example also disables dual reductions (since they are potentially invalid if CPLEX does not know all constraints).


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: What is really disabled by control callbacks

    Posted 10/05/18 05:57 PM

    Originally posted by: Rafael Colares


    Hello Daniel,

     

    In this case it was a branch callback. But I've seen the same behaviour with UserCutCallback...


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: What is really disabled by control callbacks

    Posted 10/10/18 01:57 AM

    Using a branch callback implicitly disables dual and non-linear reductions.

    The "problem" here is that Concert and its callbacks always work on the original model and anything you potentially submit in the callback must be translated to the presolved model so that CPLEX can use it. To make sure this translation is possible, non-linear reductions must be disabled.

    Dual reductions may cut off optimal solutions as long as they leave at least one optimal solution. This may interfere with branching decisions a callback makes and together callback and dual reductions may end up cutting off all optimal solutions. Hence in presence of the callback, dual reductions must be disabled (CPLEX cannot know whether the branching decisions interfere with the dual reductions, hence it choose to be better safe than sorry).

    The presence of certain callbacks also disables certain parallel things at the root node.

    What seems odd is that in your experiment you have explicitly disabled all of this anyway. Can you try to also explicitly set parameter Reduce=1 and PreLinear=0? Does that change anything? Can you share the code for your experiment? Or the model on which this happens as a SAV file?


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: What is really disabled by control callbacks

    Posted 10/10/18 09:02 AM

    Originally posted by: Rafael Colares


    Thank you for your answer Daniel, it was very clarifying!

    Indeed, setting parameter Reduce=1 slows down its performance to the point of being comparable to the activation of callbacks. Do you have an idea why these dual reduction might be this powerful?

    Furthermore, in version 12.8, may I use a generic callback for adding user cuts (not lazy constraints) without disabling dual reductions?

     

     

    You can find the SAV file in the attachments.


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: What is really disabled by control callbacks

    Posted 10/25/18 08:08 AM

    In the log you can see that with dual reductions enabled, the presolved model is significantly smaller than without:

    With dual reductions:

    Reduced MIP has 1980 rows, 1350 columns, and 8010 nonzeros.
    Reduced MIP has 1350 binaries, 0 generals, 0 SOSs, and 0 indicators.

    Without dual reductions:

    Reduced MIP has 2070 rows, 1500 columns, and 8190 nonzeros.
    Reduced MIP has 1500 binaries, 0 generals, 0 SOSs, and 0 indicators.

    That may already explain the difference.

    What exactly the reduction is that pays off here I cannot tell because that is a trade secret.

    Dual reductions usually use arguments like "in an optimal solution, this variable can never be 0/1" or look at the dual of a column to learn something from that.


    #CPLEXOptimizers
    #DecisionOptimization