Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Solving a subproblem in a Callback

    Posted 12/03/11 02:47 PM

    Originally posted by: ecnirp


    Hi,

    I was wondering if someone that has experience with solving subproblems in a cut callback could give me some advice on the most efficient way to deal with the SP. I don't want to regenerate the SP each time the callback is entered. Should I globally define the model or pass the model as an argument? In the first (second) case, is it only the model that needs to be globally defined (passed as an argument), or must I also globally define (pass as an argument) the environment, CPlex object, variables, and constraints as well?

    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Solving a subproblem in a Callback

    Posted 12/05/11 08:01 AM

    Originally posted by: SystemAdmin


    What API do you intend to use (C, C++, Java)? Are you planning to solve the problem on multiple threads or on a single thread?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Solving a subproblem in a Callback

    Posted 12/05/11 11:48 AM

    Originally posted by: ecnirp


    I am using C++ and on a single thread.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Solving a subproblem in a Callback

    Posted 12/06/11 06:10 AM

    Originally posted by: SystemAdmin


    In that case I would recommend to create a new instance of IloCplex to solve the separation problem. Make that instance an instance variable of the class that implements the callback.
    For the IloModel instance you need there are two different approaches:
    1. Create a new instance of IloModel every time the callback is invoked and use IloCplex::extract() to make this model known to the IloCplex instance that solves the separation problem. This is the less error prone approach and if your model is not too big it should also be fast.
    2. Create an instance of IloModel before you start the optimization and extract the model to the IloCplex instance that solves the separation problem. In the callback then update your model using IloModel::add() and IloModel::remove(). Adding tp and removing stuff from the model will notify the IloCplex instance that has extracted the model of any changes. This notification may slow things down. If you observe this then unextract the model before modifying it and extract again after you did all modifications.
    #CPLEXOptimizers
    #DecisionOptimization