Topic
  • 5 replies
  • Latest Post - ‏2013-02-27T22:58:05Z by SystemAdmin
bqt
bqt
25 Posts

Pinned topic How to remove a constraint during the solving a problem with the MIP solver

‏2013-02-12T09:04:01Z |
I am solving a MIP problem. During the solving, I add constraints into the model (Separation of sub-tour 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
Updated on 2013-02-27T22:58:05Z at 2013-02-27T22:58:05Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: How to remove a constraint during the solving a problem with the MIP solver

    ‏2013-02-12T17: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)
  • bqt
    bqt
    25 Posts

    Re: How to remove a constraint during the solving a problem with the MIP solver

    ‏2013-02-26T17:24:11Z  
    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)
    I would like to keep two pools of constraints, one for active constraints and another for inactive constraints. At a node of branch-and-cut 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
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: How to remove a constraint during the solving a problem with the MIP solver

    ‏2013-02-26T20:10:26Z  
    • bqt
    • ‏2013-02-26T17:24:11Z
    I would like to keep two pools of constraints, one for active constraints and another for inactive constraints. At a node of branch-and-cut 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
    > bqt wrote:
    > I would like to keep two pools of constraints, one for active constraints and another for inactive constraints. At a node of branch-and-cut 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)
  • bqt
    bqt
    25 Posts

    Re: How to remove a constraint during the solving a problem with the MIP solver

    ‏2013-02-26T22:37:40Z  
    > bqt wrote:
    > I would like to keep two pools of constraints, one for active constraints and another for inactive constraints. At a node of branch-and-cut 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)
    I solve a problem as MIP. Because of an exponential number of sub-tour elimination constraints, I can not add all of them into a model at the beginning. At node of branch-and-cut 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
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: How to remove a constraint during the solving a problem with the MIP solver

    ‏2013-02-27T22:58:05Z  
    • bqt
    • ‏2013-02-26T22:37:40Z
    I solve a problem as MIP. Because of an exponential number of sub-tour elimination constraints, I can not add all of them into a model at the beginning. At node of branch-and-cut 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
    I do not believe it is possible for you to manually delete any of those cuts. For global cuts added in a user cut callback or a lazy constraint callback, you have the option to add an integer argument (a value from IloCplex.CutManagement) specifying how to handle the cuts. The value IloCplex.CutManagement.UseCutPurge tells CPLEX that it is free to purge (delete) the cut at a later point if it deems the cut to be ineffective. The cut management option is not available when you add local cuts, but they will disappear on their own when the subtree into which they were introduced is completely exhausted.

    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)