Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Several questions about CutCallback in C++

    Posted 03/21/10 10:56 AM

    Originally posted by: gkirlik


    Dear All,

    I am using a cut callback that is very similar to ILOUSERCUTCALLBACK3 (one of the example callbacks and given below). Instead applying one time, I am applying cuts in every 100 nodes. Another difference is I am getting cut constraints into the callback by using function references. My questions are as follows;

    1-In the Branch-and-Cut procedure, CPLEX applies all default properties (node heuristic, clique cuts etc.) perfectly, until I add cuts at Node-100. After that time CPLEX never apply any of them. How can I activate these automatic cuts and heuristic after I apply user cut?
    2-My second question is about getting reduced cost information into the cut callback. I tried "getReducedCost" method, but compiler gives an error. How can I get reduced cost information of variables into the cut callback?
    3-My final question is about lazy constraints and cutting plane (user cuts). I knew the differences between them. But I am confused in cut callback. In the given cut callback (ILOUSERCUTCALLBACK3) which one is applied? Actually, I want to apply cutting plane. If this function adds lazy constraints, how can I add cutting planes in the cut callback?

    Best Regards
    gokhan

    ILOUSERCUTCALLBACK3(CtCallback, IloExprArray, lhs, IloNumArray, rhs, IloNum, eps) {
    IloInt n = lhs.getSize();
    for (IloInt i = 0; i < n; i++) {
    IloNum xrhs = rhs[i];
    if ( xrhs < IloInfinity && getValue(lhs[i]) > xrhs + eps ) {
    IloRange cut;
    try {
    cut = (lhs[i] <= xrhs);
    add(cut).end();
    rhs[i] = IloInfinity;
    }
    catch (...) {
    cut.end();
    throw;
    }
    }
    }
    }
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Several questions about CutCallback in C++

    Posted 03/22/10 09:07 AM

    Originally posted by: CPXfanatic


    I will try to answer two of the 3 questions:

    > 1-In the Branch-and-Cut procedure, CPLEX applies all default properties (node heuristic, clique cuts etc.) perfectly, until I add cuts at Node-100. After that time CPLEX never apply any of them. How can I activate these automatic cuts and heuristic after I apply user cut?

    One reason might be that, after user cuts were added on Node-100, the problem grew enough that CPLEX decides not to add more cuts.

    AFAIK, you can only change CPLEX strategy before the optimization begins. For instance, if you turn on clique cuts, CPLEX will try to add those cuts whenever it sees fit. But you can't turn on/off clique cuts in the middle of the optimization.

    > 3-My final question is about lazy constraints and cutting plane (user cuts). I knew the differences between them. But I am confused in cut callback. In the given cut callback (ILOUSERCUTCALLBACK3) which one is applied? Actually, I want to apply cutting plane. If this function adds lazy constraints, how can I add cutting planes in the cut callback?

    The cut callback always add "user cuts".
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Several questions about CutCallback in C++

    Posted 03/30/10 10:15 AM

    Originally posted by: gokhank


    Dear All,

    Firstly, thanks for the concern. If we return to my 2nd question, I think, there is no way to get reduced cost values during the callback works. But, my first question is critical. After I add a user cut by using cut callback, CPLEX never apply neither its default heuristics nor default cuts. To prove this circumstance, I set the disjunctive (DisjCuts) cut parameter to 3 that means CPLEX will add disjunctive cuts very aggressively. Then, in the callback, I get number of added disjunctive cuts by using getNdisjunctiveCuts() function. In the first call, this function returns 21, then 21 never changes. How can I solve this problem?

    PS: I tried goals, but I obtain same result.
    Best Regards.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Several questions about CutCallback in C++

    Posted 03/30/10 11:16 AM

    Originally posted by: SystemAdmin


    Unfortunately, disjunctive cuts are a bad test case as they are only applied at the root node, even in very aggressive settings (it might be that previously discarded cuts come in later on, but we do not try to find new cuts at the nodes).

    Try to set other cuts to 2 like knapsack covers or c-MIR cuts.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Several questions about CutCallback in C++

    Posted 03/30/10 02:59 PM

    Originally posted by: gkirlik


    Although I change the cut type type, cplex still doesn't add default cuts after the user cut is added. This time, I set mixed integer round cuts (MIR) to 2 (generate MIR cuts aggressively). When the first user cut is added, total number of added MIR cuts (getNMIRs()) is 38. After that time, total number of added MIR cuts is not changing (remain in 38 until the termination condition occurs).
    Best Regards,
    gokhan
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Several questions about CutCallback in C++

    Posted 04/07/10 06:26 AM

    Originally posted by: SystemAdmin


    This is really strange. If this is possible, could you please attach your code and also post the log that shows what you report?

    Thanks,

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Several questions about CutCallback in C++

    Posted 04/13/10 02:53 PM

    Originally posted by: chrysg


    Hello everyone,

    Are there any definite answers to question #2, that is, whether one can read the reduced cost information at a given node of a MIP?

    Typically this would be helpful for fixing additional binary variables if reduced cost exceeds the node gap.
    (Is there an option with which you can instruct CPLEX to do this automatically at a node of interest?)

    Thanks.
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Several questions about CutCallback in C++

    Posted 04/13/10 03:37 PM

    Originally posted by: SystemAdmin


    CPLEX applies reduced cost fixing automatically at every node.

    As far as I know, you can only query the reduced cost information at the nodes in the C or Python APIs, because you need to access the node's LP relaxation through the method CPXgetcallbacknodelp().
    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Several questions about CutCallback in C++

    Posted 04/13/10 08:32 PM

    Originally posted by: chrysg


    Good to know...

    Thank you, Tobias!
    #CPLEXOptimizers
    #DecisionOptimization