Cut callback

Describes special considerations of the cut callback.

The next example to consider is the user cut callback routine. The user calls CPXsetusercutcallbackfunc to set a user cut callback. Then CPLEX calls the user's callback routine at every viable node of the branch & cut tree. See the sample admipex5.c for a detailed demonstration.

A likely sequence of events after the user cut callback function is called goes like this. First, the routine calls CPXgetcallbacknodex to get the relaxation solution for the current node. It possibly also gathers other information about the problem (through such routines as CPXgetcallbacklp, CPXgetcallbackgloballb, and others). It then calls a user separation routine to identify violated user cuts. These cuts are then added to the problem by a call to CPXcutcallbackadd, and the callback returns. You can add local cuts, that is, cuts that apply to the subtree of which the current node is the root, by means of the routine CPXcutcallbackaddlocal.

CPLEX supports two rather different types of constraints that might both be regarded as cuts in some sense.

As with the heuristic callback, the user can choose whether to work with presolved values or original values of the model. If the user chooses to work with original values, a few parameters must be modified:

Concert Technology users use the class IloCplex::LazyConstraintCallbackI when adding lazy constraints. CPLEX then automatically turns off dual reductions and nonlinear reductions.

Concert Technology users use the class IloCplex::UserCutCallbackI when adding cutting planes. In this case, CPLEX does not adjust parameters because these parameter changes are not required for user cuts.

One scenario that merits special attention is when the user knows a large set of cuts because of prior knowledge. Rather than adding them to the original problem one by one, the user can add them only when they are violated. The CPLEX advanced MIP control interface provides more than one mechanism for accomplishing this. The first and probably most obvious at this point is to install a lazy constraint callback that checks each of them at each node, adding those that are violated.

Another, perhaps simpler alternative is to add them to a pool of user cuts or lazy constraints before optimization begins. The topic User-cut and lazy-constraint pools discusses pools in greater detail.