Topic
  • 2 replies
  • Latest Post - ‏2013-07-04T07:48:36Z by veronicads
veronicads
veronicads
10 Posts

Pinned topic Adding constraints at each node of a branching tree

‏2013-07-04T07:02:42Z |

Good morning!

I'm solving a mixed-integer problem via branch and cut using both a Lazy Constraint callback (where I add the violated constraints) and a User Cut callback to implement other cuts. I would like to check if there are violated constraints at each node of the branching tree and not only when I find an integer feasible solution, so I added the procedure to check the constraints also in the User Cut callback. But I'm wondering if Cplex always adds the violated inequalities or if it only adds the ones that don't cut off integer-feasible solutions, as I'm inside a User Cut callback. If this is the case, is there a way to add violated constraints at each node? (I'm using Cplex 12.4 with Python)

Thank you very much for your help!

Veronica

  • DanielJunglas
    DanielJunglas
    1579 Posts
    ACCEPTED ANSWER

    Re: Adding constraints at each node of a branching tree

    ‏2013-07-04T07:24:46Z  

    CPLEX has no way of telling whether a UserCut would cut off integer solutions or not.

    So it will usually add any violated cut that you specify in the UserCutCallback. You can get a little more control over what CPLEX does with your cuts by using different values from the use_cut enumeration as use arguments to the callback's add() function. The default for this argument is force (0) which forces CPLEX to use the cut.

    In general, in a UserCutCallback you are supposed not to add any cuts that may cut off integer solutions. There is one exception to this rule (and this seems to be what you are doing): if you simultaneously use a LazyConstraintCallback that separates the same cuts then it is fine to also add user cuts that may cut off integral solutions.

  • DanielJunglas
    DanielJunglas
    1579 Posts

    Re: Adding constraints at each node of a branching tree

    ‏2013-07-04T07:24:46Z  

    CPLEX has no way of telling whether a UserCut would cut off integer solutions or not.

    So it will usually add any violated cut that you specify in the UserCutCallback. You can get a little more control over what CPLEX does with your cuts by using different values from the use_cut enumeration as use arguments to the callback's add() function. The default for this argument is force (0) which forces CPLEX to use the cut.

    In general, in a UserCutCallback you are supposed not to add any cuts that may cut off integer solutions. There is one exception to this rule (and this seems to be what you are doing): if you simultaneously use a LazyConstraintCallback that separates the same cuts then it is fine to also add user cuts that may cut off integral solutions.

  • veronicads
    veronicads
    10 Posts

    Re: Adding constraints at each node of a branching tree

    ‏2013-07-04T07:48:36Z  

    CPLEX has no way of telling whether a UserCut would cut off integer solutions or not.

    So it will usually add any violated cut that you specify in the UserCutCallback. You can get a little more control over what CPLEX does with your cuts by using different values from the use_cut enumeration as use arguments to the callback's add() function. The default for this argument is force (0) which forces CPLEX to use the cut.

    In general, in a UserCutCallback you are supposed not to add any cuts that may cut off integer solutions. There is one exception to this rule (and this seems to be what you are doing): if you simultaneously use a LazyConstraintCallback that separates the same cuts then it is fine to also add user cuts that may cut off integral solutions.

    Thank you! Yes, that is exactly what I'm doing.