Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Why is branch callback not invoked

  • 1.  Why is branch callback not invoked

    Posted Thu February 26, 2015 09:31 AM

    Originally posted by: srinit34


    Hi

    I have a simple IP program.

    I have set params to use traditional BB.

    I have disabled all cuts.

    But still, it seems no branches are created. How do I force cplex to create branches ?

    Here is a code snippet:

     cplex.setParam(IloCplex.Param.MIP.Cuts.Cliques, -1);

    .... //many more cuts disabled

     cplex.setParam(IloCplex.Param.MIP.Cuts.ZeroHalfCut, -1);

     cplex.setParam(IloCplex.Param.MIP.Strategy.Search, IloCplex.MIPSearch.Traditional);
                 cplex.solve();

     IloNumVarType[] xt  = {IloNumVarType.Int,  IloNumVarType.Int };

     IloNumVar[]     x  = model.numVarArray(2, xlb, xub, xt);
          var[0] = x;

          // Objective Function:
          double[] objvals = {8, 5};
          model.addMaximize(model.scalProd(x, objvals));

    //some constraints

    Here is the output:

    MIP search method: traditional branch-and-cut.
    Parallel mode: none, using 1 thread.
    Root relaxation solution time = 0.00 sec. (0.00 ticks)

            Nodes                                         Cuts/
       Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap         Variable B NodeID Parent  Depth

    *     0+    0                            0.0000       70.0000              ---
          0     0       41.2500     2        0.0000       41.2500        2     ---
    *     0+    0                           39.0000       41.2500             5.77%
    *     0+    0                           40.0000       41.2500             3.12%
          0     0        cutoff             40.0000       41.2500        2    3.12%                        0             0
    Elapsed time = 0.02 sec. (0.03 ticks, tree = 0.00 MB, solutions = 3)


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Why is branch callback not invoked

    Posted Thu February 26, 2015 01:31 PM

    Originally posted by: EdKlotz


    Based on the node log you sent, it looks to me like your model was simple enough that CPLEX managed to solve it at the root node before any branching was needed.   So, I suspect CPLEX never even calls your branch callback.   This probably happened because each new integer feasible solution may enable CPLEX to fix additional variables via reduced cost fixing or additional probing.    The '+' at each node log line associated with a feasible solution indicates that these solutions came from heuristics.    So, for this easy model, I suspect you can force CPLEX to do some branches by disabling heuristics in addition to the features you have already disabled.  Give that a try and let everyone know how it goes.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Why is branch callback not invoked

    Posted Thu February 26, 2015 02:23 PM

    Originally posted by: srinit34


    Branch callback is invoked when I disable heuristics by adding this line of code:

              cplex.setParam(IloCplex.Param.MIP.Strategy.HeuristicFreq, -1);


    Thanks, this thread can be marked as answered.


    #CPLEXOptimizers
    #DecisionOptimization