Originally posted by: gkirlik
Dear All,
I am using a cut callback that is very similar to ILOUSERCUTCALLBACK3 (one of the example callbacks and given below). Instead applying one time, I am applying cuts in every 100 nodes. Another difference is I am getting cut constraints into the callback by using function references. My questions are as follows;
1-In the Branch-and-Cut procedure, CPLEX applies all default properties (node heuristic, clique cuts etc.) perfectly, until I add cuts at Node-100. After that time CPLEX never apply any of them. How can I activate these automatic cuts and heuristic after I apply user cut?
2-My second question is about getting reduced cost information into the cut callback. I tried "getReducedCost" method, but compiler gives an error. How can I get reduced cost information of variables into the cut callback?
3-My final question is about lazy constraints and cutting plane (user cuts). I knew the differences between them. But I am confused in cut callback. In the given cut callback (ILOUSERCUTCALLBACK3) which one is applied? Actually, I want to apply cutting plane. If this function adds lazy constraints, how can I add cutting planes in the cut callback?
Best Regards
gokhan
ILOUSERCUTCALLBACK3(CtCallback, IloExprArray, lhs, IloNumArray, rhs, IloNum, eps) {
IloInt n = lhs.getSize();
for (IloInt i = 0; i < n; i++) {
IloNum xrhs = rhs[i];
if ( xrhs < IloInfinity && getValue(lhs[i]) > xrhs + eps ) {
IloRange cut;
try {
cut = (lhs[i] <= xrhs);
add(cut).end();
rhs[i] = IloInfinity;
}
catch (...) {
cut.end();
throw;
}
}
}
}
#CPLEXOptimizers#DecisionOptimization