Originally posted by: AndreaTramontani
Dear Prasenjit,
there are two possibilities to achieve what you ask for.
1. If you use control callbacks, this can be obtained by using a usercut callback.
Here's a quick description. For more details, please refer to the documentation of the usercut callback for C APIs (for other APIs the behavior is the same) at https://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.1/ilog.odms.cplex.help/refcallablelibrary/mipapi/setusercutcallbackfunc.html.
If you install a usercut callback function of name (say) "mycutcallback()" with CPXXsetusercutcallbackfunc(), then your function mycutcallback() is called whenever CPLEX separate the cuts.
The signature of your callback function must be
int CPXPUBLIC mycutcallback (CPXCENVptr env, void *cbdata, int wherefrom, void *cbhandle, int *useraction_p);
Whenever CPLEX decides to separate cuts at a given node in the tree (the root node or a child node), your function mycutcallback() is called.
The first time it is invoked happens before CPLEX generate its own cuts.
If you set *useraction_p = CPX_CALLBACK_ABORT_CUT_LOOP then CPLEX will abort the cutloop without generating its cuts.
So, from the callback, you can query the depth of the node you are in, with CPXXgetcallbacknodeinfo() (see https://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.1/ilog.odms.cplex.help/refcallablelibrary/mipapi/getcallbacknodeinfo.html).
If the depth is 0, then you are at the root node and you can simply set
*useraction_p = CPX_CALLBACK_DEFAULT;
If the depth is greater than 0, then you are at a child node and you can simply set
*useraction_p = CPX_CALLBACK_ABORT_CUT_LOOP;
2. If you don't use control callbacks, then you can first solve the root node with default parameters, then disable all cuts and restart.
With CPLEX interactive it would be something like this:
read myprob.lp
set mip limits nodes 1
opt
set mip cuts all -1
set mip limits nodes DEFAULT_VALUE
opt
The same can be done easily with all CPLEX APIs.
Best,
Andrea
#DecisionOptimization#MathematicalProgramming-General