Originally posted by: JorisK
Dear,
I have implemented a Mixed integer model using the java interface of cplex 12.5.0.1. In order to obtain the LP relaxation and the corresponding variable values, i.e. the solution of the root node *after* all cuts have been added, I have added a simple branch callback:
private class BranchCallbackImpl extends BranchCallback{
@Override
protected void main() throws IloException {
IloIntVar[] flowVarArray=mipData.flowVars.values().toArray(new IloIntVar[mipData.flowVars.size()]);
flowValues=this.getValues(flowVarArray);
IloIntVar[] complVarArray=mipData.complVars.values().toArray(new IloIntVar[mipData.complVars.size()]);
complValues=this.getValues(complVarArray);
IloIntVar[] fulfVarArray=mipData.fulfVars.values().toArray(new IloIntVar[mipData.fulfVars.size()]);
fulfValues=this.getValues(fulfVarArray);
objectiveValue=this.getBestObjValue();
this.abort();
}
}
I ran my code both on cplex 12.4 and cplex 12.5.0.1. The lp relaxation of the model using cplex 12.4 results in an objective of 135, whereas cplex 12.5.0.1 produces a solution with objective 150. Since its a minimization problem, cplex 12.4 produces a stronger LP relaxation than cplex 12.5.0.1. Apparently, cplex 12.5.0.1 uses different cuts than 12.4?
When I remove the above callback and in fact solve (using 12.5.0.1) the integer problem, I get the following output:
====================================
Nodes Cuts/
Node Left Objective IInf Best Integer Best Bound ItCnt Gap
* 0+ 0 85.0000 150.0000 116 76.47%
0 0 150.0000 28 85.0000 150.0000 116 76.47%
0 0 150.0000 31 85.0000 Cuts: 12 168 76.47%
0 0 150.0000 28 85.0000 Covers: 1 192 76.47%
0 0 150.0000 37 85.0000 Cuts: 32 247 76.47%
0 0 cutoff 85.0000 85.0000 247 0.00%
Elapsed time = 0.07 sec. (22.61 ticks, tree = 0.00 MB, solutions = 1)
Cover cuts applied: 1
Implied bound cuts applied: 3
Zero-half cuts applied: 4
Gomory fractional cuts applied: 3
Root node processing (before b&c):
Real time = 0.05 sec. (19.32 ticks)
Parallel b&c, 8 threads:
Real time = 0.00 sec. (0.00 ticks)
Sync time (average) = 0.00 sec.
Wait time (average) = 0.00 sec.
------------
Total (root+branch&cut) = 0.05 sec. (19.32 ticks)
======================================
Judging from the output (MipInterval=1), it seems that cplex does not branch, i.e. that the optimal solution is found at the root node? So I'm wondering:
1. why did cplex invoke the BranchCallBack in the first place, as it apparently finds the optimal solution at the root node?
2. why does my BranchCallBack produce an objective of 150, whereas in the above output, the optimal solution found at the root node has an objective of 85?
#CPLEXOptimizers#DecisionOptimization