Originally posted by: SystemAdmin
>
> I found that getValue(IloConstraintArray[i]) on Cplex 10 does not work. I moved to Cplex 12 and it works.
>
> It seems that Cplex returns 0.00000 when a constraint is violated and 1.00000 when it is not.
If you prefer to see the slack in the constraint, you can use the getSlack(IloRange) method.
>
>
> However, now I have an another problem.
>
> I add some of these violated constraints to Cplex as a local cut and sometimes does not call the CutCallBack method after solving the LP relaxation which is problematic because I can not find violated inequalities with my algorithms.
Are you sure about this? I've never heard of CPLEX failing to call the cut callback at a node. You should note, though, that if CPLEX gets a fractional solution to the node LP (after calling the cut callback) and then finds a potential incumbent via a heuristic, it will call the incumbent callback (if there is one) but I do not believe it will call the cut callback again at that node.
> And Cplex thinks he found a feasible solution which is not..
>
>
> Other times, it seems the constraint is violated but it makes no difference to the objective function so the constraint is added over and over..
Are you saying the same cut is added repeatedly +at the same node+? If so, either the cut is not violated by the node LP solution (so you are adding a redundant cut) or the LP solution is changing (the cut is not redundant) but somehow your cut generator is repeating the same cut anyway.
/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