Originally posted by: UserCplex
Suppose the "original model", the one submitted to CPXmipopt() is:
Min cx
s.t. Ax = b
x >=0, integer
Suppose number of x variables is n
If I understand correctly, CPLEX internally converts this to a different but equivalent presolved model:
Min dy
s.t. Ey = f
y >= 0, integer
Number of y variables need not be n.
Now, the user has to convert the LP model to the "original model" by using functions:
int status = CPXchgctype(env, lp, n, indices, ctype);//ctype is 'I' denoting conversion of the n continuous x variables to integer variables
status = CPXchgprobtype(env, lp, CPXPROB_MILP);
The callbacks I have are setup thus:
status = CPXsetusercutcallbackfunc(env, mycutcallback, &usercutinfo);
status = CPXsetlazyconstraintcallbackfunc(env, mylazycutcallback, &usercutinfo);
//CPXsetintparam(env, CPX_PARAM_PRELINEAR, 0);//Whether this line is commented or not makes no difference in the performance of cplex branch and bound
//CPXsetintparam(env, CPX_PARAM_MIPCBREDLP, CPX_OFF);////Whether this line is commented or not makes no difference in the performance of cplex branch and bound
After the above, I call CPXmipopt()
My cut separation function separate() creates cuts for the original model, i.e., in terms of the x variables and they are called by the callback functions during branch and bound of CPXmipopt(). Within both the user cut and the lazy cut functions, I access the x variables of the original model by
status = CPXgetcallbacknodex(env, cbdata, wherefrom, cutinfo->x, 0, cutinfo->numcols - 1);
and then pass cutinfo->x as one argument to separate() function.
If the two parameter setting lines are commented out as above, and if I understood your response correctly, CPLEX should thrown an error since the CPX_PARAM_MIPCBREDLP
parameter is on by default and the cut must have been in terms of the presolved model's variables. Am I right? Yet, CPLEX works just fine with my user defined cuts in terms of the x variables whether the parameters are On or Off. In both cases (whether the lines are commented out or not), CPLEX gets me the same optimal solution with exactly the same performance metrics (running time, number of branch and bound nodes).
#CPLEXOptimizers#DecisionOptimization