Edited to add: sorry, did not realize the difference between CPXgetcallbacknodelp and CPXgetcallbacklp. Below question therefore is invalid as of now. I will study the example admipex1.c and documentation further and more carefully to see if there is still something I do not understand.
----
admipex1.c is the suggested example to understand branch callback. I have the following query regarding it:
According to https://www.ibm.com/docs/en/icos/22.1.1?topic=lcp-mip-callback-switch-between-original-model-reduced-presolved-model
"The routine CPXgetcallbacknodelp is an exception: it always accesses the current node LP associated with the presolved model, regardless of the setting of this parameter.", the parameter in question being CPXPARAM_MIP_Strategy_CallbackReducedLP
Now, admipex1.c sets this paramter to CPX_OFF in line 171. We also have on line 398 of admipex1.c, the following in the user written branch callback:
status = CPXgetcallbacklp (env, cbdata, wherefrom, &lp);
followed by
cols = CPXgetnumcols (env, lp); //Suppose the number of variables in the presolved version is 10
and
x = (double *) malloc (cols * sizeof (double)); //So, x is allocated space for 10 doubles.
Thus, I understand that lp points to the presolved problem at the current node.
From https://www.ibm.com/docs/en/cofz/12.10.0?topic=g-cpxxgetcallbacknodex-cpxgetcallbacknodex, we have:
"The routine CPXXgetcallbacknodex/CPXgetcallbacknodex retrieves the primal variable (x) values for the subproblem at the current node during MIP optimization from within a user-written callback. The values are from the original problem if the MIP callback switch between original model and reduced, presolved model (CPXPARAM_MIP_Strategy_CallbackReducedLP) is set to CPX_OFF; otherwise, they are from the presolved problem."
We have the following line (line # 424) in the branch callback function in admipex1.c
status = CPXgetcallbacknodex (env, cbdata, wherefrom, x, 0, cols-1);
The question here is about the integrity/correctness of x. Since CPXPARAM_MIP_Strategy_CallbackReducedLP has been set to CPX_OFF, wouldn't the functioin above return the primal variable values from the original problem and not the presolved problem? So, if the original problem had 15 variables which presolve has reduced to 10, isn't there incompatibility?
Thank you.
------------------------------
CPLEX User
------------------------------