Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Question on User Defined Cuts

    Posted 08/04/20 02:09 PM
    Hi,

    I would like to use both lazy and user callback functions for an MILP formulation. For the sake this arguments, let's assume that I have two different variable types namely X and Y. I know that CPLEX would use lazy callback whenever both variables get an integer value. Therefore, I do not need to anything extra except defining my cut inside the function. 

    My question is that if it is possible to get into user callback function to generate a cutting plane based on a certain criteria. For instance, can I use the callback function only when X takes an integer value and Y takes a fractional value. If so, is there a source that one can recommend me?


    ------------------------------
    Ser Giovio
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Question on User Defined Cuts
    Best Answer

    Posted 08/04/20 03:11 PM
    No, I do not believe that there is a way to have CPLEX call your callback only when X is integer and Y is not. If you use a user cut callback (as opposed to a lazy constraint callback), you can check your conditions for suitability (X integer, Y not integer) at the start of the callback function and, if not met, exit the callback without doing anything. This will obviously create some "drag" on the solver, since your integrality check will be done at every node. If you adopt this approach with legacy callbacks, also note that user cuts are not supposed to cut off integer-feasible solutions. If your cuts do that, you can get away with putting them in a user cut callback by also attaching an empty lazy constraint callback. Even though the lazy constraint callback does nothing, CPLEX will see it and make the necessary modifications (turn off dynamic search and some dual stuff) to allow it to work with cuts that do cut off integer-feasible solutions.

    ------------------------------
    Paul Rubin
    Professor Emeritus
    Michigan State University
    ------------------------------



  • 3.  RE: Question on User Defined Cuts

    Posted 08/04/20 05:10 PM
    Thanks for the useful information. Just to make sure, I can use both callbacks together, right? My intention is to generate different cutting planes based on the fixed solution (i.e., incumbent or fractional). Also, I will use the generic callback rather than legacy. 


    ------------------------------
    Ser Giovio
    ------------------------------



  • 4.  RE: Question on User Defined Cuts

    Posted 08/04/20 05:30 PM
    Yes, you can use both together, including with the generic callback system (in which case you have a single callback that checks the context in which it was called and generates the corresponding type of cuts).

    ------------------------------
    Paul Rubin
    Professor Emeritus
    Michigan State University
    ------------------------------



  • 5.  RE: Question on User Defined Cuts

    Posted 08/04/20 08:18 PM
    In that scenario, is there method provided by CPLEX that would indicate that the fixed solution is incumbent or fractional? or Should I make my own inquiry? Since I aim to create different types of cutting planes, how do I know which solution (i.e., incumbent or fractional) is passed into the callback function?

    ------------------------------
    Ser Giovio
    ------------------------------



  • 6.  RE: Question on User Defined Cuts

    Posted 08/05/20 12:36 AM
    The generic callback is invoked with a context argument that tells you whether you are looking at a feasible solution (candidate) or at a solution to the current LP relaxation (relaxation). You may want to check the documentation about the generic callbacks. The details are explained there.

    ------------------------------
    Daniel Junglas
    ------------------------------