Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  LazyContraints repeated cut generation

    Posted 06/30/14 07:08 AM

    Originally posted by: GiovanniP


    Hello,

    I am having a hard time understanding this behavior of Lazy Constraints callback.

    A bit of background: I am using Cplex 12.5.1 from the Java Callable Libraries. I am coding a Benders decomposition, where I have an MIP master, with general integers (not binary).

    I do the following: In the lazycallback main I use node data to check at which B&C node things happen, print some info and then call my cuts generation routine.

    I experiencing the following: Cplex returns twice to the same integer node, with the same identical integer solution generated at that node one iteration before. Therefore I need to check that in order to prevent the algorithm to resolve the same subproblems. In other words it seems that lazyconstraint callbacks do the following:

    1) find an integer node and call the callback

    2) add cuts

    3) find again the same integer solution (same B&C node)

    4) re-add (obviously the same) cuts

    5) find a different integer solution (possibly for the same B&C node)

    Skipping this is not a problem though. It is easy to skip the cuts routing. However, I would like to know what is the reason cplex does what I mentioned before.

    Is there anything I am missing? something like isAfterCutLoop()?

    I should mention that when I skip the cuts generation in the second callback call, the algorithm still works fine producing the optimal solution. 

    Thanks for the comments in advance.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: LazyContraints repeated cut generation

    Posted 06/30/14 07:25 AM

    Originally posted by: T_O


    Hmm, this might be due to a bug with lazy constraints in CPLEX 12.5. Can you first of all upgrade to 12.6?

    Another question: Did you check whether your cuts really cut off the optimal solution? Maybe the cuts are just wrong.

    Best regards,
    Thomas


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: LazyContraints repeated cut generation

    Posted 06/30/14 08:01 AM

    Originally posted by: GiovanniP


    The cuts are classic L-shaped method optimality cuts, therefore are (at least in theory) correct. I am quite confident there is no bug in the implementation of the cuts. The fact that the cuts are correct is sort of confirmed by the fact that the same solution is not generated again after the node is left.

    I will try with 12.6.

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: LazyContraints repeated cut generation

    Posted 06/30/14 02:25 PM

    Originally posted by: T_O


    In theory, L-shaped cuts are correct, but in practice, they are often not implemented correctly (not taking variable bounds into account, etc.). So just take the solution, calculate the left-hand side of the cut and compare it to the right-hand side. If the cut is not violated at all, then you did something wrong. If it is only slightly violated or slightly fulfilled, you might have run into numerical trouble as Daniel already mentioned.

    Best regards,
    Thomas


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: LazyContraints repeated cut generation

    Posted 06/30/14 08:42 AM

    It at least one of the constraints you add in the lazy constraint callback is violated by the optimal solution then this should not happen.

    So can you please check that the solution at the current node violates at least one of those constraints? This may also be an issue with tolerances: by how much are the constraints violated? If they are only violated by a very small epsilon then it could well be that due to numerics they do not actually cut off the current solution.


    #CPLEXOptimizers
    #DecisionOptimization