I am solving a MIP problem. During the solving, I add constraints into the model (Separation of subtour elimination constraints) using usercutcallback. Moreover, I would like to remove some unless constraints during the solving. How to remove a constraint during the solving ?
Thanks,
bqt
Topic

Re: How to remove a constraint during the solving a problem with the MIP solver
20130212T17:09:22ZThis is the accepted answer. This is the accepted answer.You cannot explicitly remove the constraints, but you use the purgeable argument in the add() method to tell CPLEX it has permission to delete the constraints if it sees fit.
Paul
Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe) 
Re: How to remove a constraint during the solving a problem with the MIP solver
20130226T17:24:11ZThis is the accepted answer. This is the accepted answer. SystemAdmin
 20130212T17:09:22Z
You cannot explicitly remove the constraints, but you use the purgeable argument in the add() method to tell CPLEX it has permission to delete the constraints if it sees fit.
Paul
Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
How to do that ?
Thanks 
Re: How to remove a constraint during the solving a problem with the MIP solver
20130226T20:10:26ZThis is the accepted answer. This is the accepted answer. bqt
 20130226T17:24:11Z
I would like to keep two pools of constraints, one for active constraints and another for inactive constraints. At a node of branchandcut tree, I would like to add some constraints in the pool of active constraints to the current model. In addition, I add new constraints into the pool of active constraints and remove some constraints in the pool of active constraints into another pool.
How to do that ?
Thanks
> I would like to keep two pools of constraints, one for active constraints and another for inactive constraints. At a node of branchandcut tree, I would like to add some constraints in the pool of active constraints to the current model.
If they are not already in the model, what makes them "active" (v. "inactive")?
> In addition, I add new constraints into the pool of active constraints
Meaning that these new constraints should now by used by CPLEX in solving node LPs?
> and remove some constraints in the pool of active constraints into another pool.
If you mean that you want a constraint that solutions previously were forced to satisfy to now be removed from the problem being solved (so that it is legal to violate it), I do not believe that is possible (other than to stop the solver, modify the model, and start solving again from scratch).
Paul
Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe) 
Re: How to remove a constraint during the solving a problem with the MIP solver
20130226T22:37:40ZThis is the accepted answer. This is the accepted answer. SystemAdmin
 20130226T20:10:26Z
> bqt wrote:
> I would like to keep two pools of constraints, one for active constraints and another for inactive constraints. At a node of branchandcut tree, I would like to add some constraints in the pool of active constraints to the current model.
If they are not already in the model, what makes them "active" (v. "inactive")?
> In addition, I add new constraints into the pool of active constraints
Meaning that these new constraints should now by used by CPLEX in solving node LPs?
> and remove some constraints in the pool of active constraints into another pool.
If you mean that you want a constraint that solutions previously were forced to satisfy to now be removed from the problem being solved (so that it is legal to violate it), I do not believe that is possible (other than to stop the solver, modify the model, and start solving again from scratch).
Paul
Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
Could you give me a solution to realize that idea ?
Thanks,
bqt 
Re: How to remove a constraint during the solving a problem with the MIP solver
20130227T22:58:05ZThis is the accepted answer. This is the accepted answer. bqt
 20130226T22:37:40Z
I solve a problem as MIP. Because of an exponential number of subtour elimination constraints, I can not add all of them into a model at the beginning. At node of branchandcut tree, I find some constraints that are violated by the LP solution at this node, and then add these constraints into the model ( as local cuts or global cuts using Usercutcallback and Lazyconstraintcallback). In some situations, the number of add constraints is so large, and almost of them are no longer needed. I wold like to remove these unless constraints to keep a small model. To do that, I construct two pools of constraints, one including active constraints and another containing inactive constraints, so that a constraint can be moved from a pool to another pool.
Could you give me a solution to realize that idea ?
Thanks,
bqt
Paul
Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)