Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Adding lazy constraints from multiple subproblems in Benders decomposition

    Posted Fri January 26, 2018 11:34 AM

    Originally posted by: MarkOpus


    Hello,

     

    I'm solving a milp using benders decomposition. I have multiple sub problems of the same form from which I want to add lazy constraints using callbacks. However, I can't figure out how to access the variables (constraints, objective) of the sub problem in question from the callback.

    I have been trying to adapt the code in the ilobendersatsp.cpp example, but, if I'm not mistaken, there is only one sub problem and so they can simply always access the same variable arrays, objective, etc.

    So my question would be: within the callback code, how do I know "which" sub problem I'm dealing with and how do I access its variables (etc.) ?

     

    I'm using c++ and cplex version 12.7.1.0.

     

    Thanks!


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Adding lazy constraints from multiple subproblems in Benders decomposition

    Posted Fri January 26, 2018 02:36 PM

    Are you using CPLEX's automatic Benders decomposition (in which case you cannot have a lazy constraint callback) or are you implementing Benders decomposition yourself? In the latter case I am not clear about your question: the callback is invoked for the master problem not for any of the sub-problems.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Adding lazy constraints from multiple subproblems in Benders decomposition

    Posted Sun January 28, 2018 10:58 PM

    Originally posted by: MarkOpus


    I am using "setAnnotations" in order to specify the subproblems. Does that correspond to implementing it myself? If not, how would I go about  implementing Benders decomposition in a way that would allow me to use a callback?


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Adding lazy constraints from multiple subproblems in Benders decomposition

    Posted Mon January 29, 2018 03:04 AM

    setAnnotations() is used with the automatic Benders decomposition and for that the lazy constraint callback is not supported. Everything related to Benders is supposed to be done by CPLEX automatically. This is illustrated in the ilobenders.cpp example.

    The ilobendersatsp.cpp instead implements an explicit Benders decomposition in which everything is done by the user explicitly. In that case you can (and must) use a lazy constraint callback. Like Paul said, in this case the callback would usually loop through the sub-problems to generate cuts from them.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Adding lazy constraints from multiple subproblems in Benders decomposition

    Posted Fri January 26, 2018 04:15 PM

    Inside the callback, wouldn't you just loop through all the subproblems, applying the same master solution to each? The master solution is not specific to a single subproblem.


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Adding lazy constraints from multiple subproblems in Benders decomposition

    Posted Sun January 28, 2018 10:59 PM

    Originally posted by: MarkOpus


    Yes thank you, I better understand how a callback works!
     


    #CPLEXOptimizers
    #DecisionOptimization