Decision Optimization

Decision Optimization

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

 View Only
  • 1.  user-cut and lazy-constraint

    Posted Thu October 01, 2015 11:01 PM

    Originally posted by: agamemnon


    what should i do to add a constraint to the user-cut pool and lazy-constraint pool at the same time. It is said to be possible in the user manual --Advanced programming techniques--Differences between user cuts and lazy constraints ,"  However, CPLEX can support optimality-based cuts as lazy constraints. If you add an optimality-based cut as a lazy constraint in your model, you can also add it to the user cut pool. " But  how should I use these two methods of different callbackclass at the same time?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: user-cut and lazy-constraint

    Posted Fri October 02, 2015 04:10 PM

    There are probably multiple ways to do this. Let's suppose that you only look for these cuts when CPLEX identifies a potential new incumbent (integer-feasible solution). It makes sense to put the cut generation code in the lazy constraint callback (or at least to call it from there). If a new cut is identified, add it in the lazy constraint callback and also push it onto a global stack.

    In the user cut callback, beyond any other cut generators you may have there, program a check of the stack. If the stack is not empty, pop the cut(s) there and add them (presumably as global rather than local cuts). The user cut callback will automatically be called at the next feasible node visited after the node where the lazy constraint callback generated the cuts. (Minor technicality: if the next feasible node has an integer solution to the LP relaxation, I'm not sure the user cut callback will be called there; but it will definitely be called the next time a node is feasible and does not have an integer relaxed solution.)


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: user-cut and lazy-constraint

    Posted Sat October 03, 2015 01:36 AM

    Originally posted by: agamemnon


    Thank you very much! I will have a try.


    #CPLEXOptimizers
    #DecisionOptimization