Decision Optimization

Decision Optimization

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

 View Only
  • 1.  lazy constraints do not cut infeasible solutions (have no effect)

    Posted Wed October 10, 2012 06:22 PM

    Originally posted by: SamirUSebbane


    Hi all,

    I changed the benders example distributed with 12.4 to solve the magic square problem in Constraint programming.
    I decomposed the model into 2 parts, the first contains the summation constraints on the rows, columns.
    The second set (larger set of constraints) is composed of all different constraints Xij ! Xipjp, of course I linearized these constraints by adding a new variables y.
    xij != xXipjp <-----> ( Xij - Xipjp + BigM*y >=1 and Xij - Xipjp + (y+1)*BigM <= BigM).
    I followed the same approach used in benders.cpp, ILP model and separation procedure that constructs lazy cuts and user cuts.
    Each time a violated cut is identified I add it to the model. However, cplex does not change the model, does not use the cuts (the final solution is violating the added cuts).
    In another model for the same problem, I exported the model, and removed the sentence "LAZY CONSTRAINTS", so that, all the constraints are regular constraints, then, I obtained the optimal solution which satisfies the violated lazy constraints (in this case they are regular constraints.)

    Any idea why cplex is not considering these violated cuts?
    Thanks
    Samir,
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: lazy constraints do not cut infeasible solutions (have no effect)

    Posted Wed October 10, 2012 11:23 PM

    Originally posted by: SamirUSebbane


    In addition, I added a incumbent call back to reject the current incumbent solution.
    It seems like cplex cannot escape from this incumbent solution and generate it over and over.

    Thanks
    Samir,
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: lazy constraints do not cut infeasible solutions (have no effect)

    Posted Thu October 11, 2012 09:27 AM

    Originally posted by: SamirUSebbane


    In addition, all the LP solutions are integer and cplex is trying to branch on integer variables but regenerate the same incumbent solution.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: lazy constraints do not cut infeasible solutions (have no effect)

    Posted Thu October 11, 2012 11:43 AM

    Originally posted by: SamirUSebbane


    In addition, as user cuts do not cut off integer solution, then, the problem is still there.
    How to escape from an integer infeasible solution and find another?
    CPLEX cannot handle this problem.
    The LP solution is integer, but as infeasible, I reject it with incumbent callback, then, CPLEX will branch on an integer variable, form time to time, it escapes from this inconsistency, but
    most of time, it doesn't and keeps regenerating the same solution and calling the incumbent to reject, and, looping....

    BTW: my objective expression is max 0, no objective, I am looking for a feasible solution (constraint programming). I don't want to use CP solver.
    Thanks,
    Samir,
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: lazy constraints do not cut infeasible solutions (have no effect)

    Posted Thu October 11, 2012 05:31 PM

    Originally posted by: SystemAdmin


    If you reject an incumbent found by a heuristic (rather than a node solution), and you do not add a lazy constraint to cut off that solution, it is entirely possible that CPLEX will find the same solution again (quite possibly via the same heuristic).

    If you reject an incumbent that is the integer-feasible solution to a node LP and do not cut it off with a lazy constraint, whether you see it again depends partly on whether you or CPLEX prunes that node (if CPLEX separates the node, the same solution may live in one of the children, and will of course be found again there).

    I'm not sure those are the only two ways for a rejected solution to repeat.

    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)
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: lazy constraints do not cut infeasible solutions (have no effect)

    Posted Thu October 11, 2012 05:31 PM

    Originally posted by: SystemAdmin


    If you reject an incumbent found by a heuristic (rather than a node solution), and you do not add a lazy constraint to cut off that solution, it is entirely possible that CPLEX will find the same solution again (quite possibly via the same heuristic).

    If you reject an incumbent that is the integer-feasible solution to a node LP and do not cut it off with a lazy constraint, whether you see it again depends partly on whether you or CPLEX prunes that node (if CPLEX separates the node, the same solution may live in one of the children, and will of course be found again there).

    I'm not sure those are the only two ways for a rejected solution to repeat.

    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)
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: lazy constraints do not cut infeasible solutions (have no effect)

    Posted Thu October 11, 2012 05:31 PM

    Originally posted by: SystemAdmin


    Sorry for the duplicate response -- the browser burped.
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: lazy constraints do not cut infeasible solutions (have no effect)

    Posted Fri October 12, 2012 04:30 AM

    Originally posted by: SystemAdmin


    By how much are the constraints violated?
    Are you sure you add the constraint to the correct CPLEX instance (and not by chance to the sub-CPLEX instance)?
    Can you show us the relevant code that adds the constraints in the callback?
    #CPLEXOptimizers
    #DecisionOptimization