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