Path invariance and generic callbacks

An empty generic callback produces the same solution path as no generic callback.

Using an empty generic callback will yield the same solution path as using no generic callback. (This convention is not true for CPLEX legacy callbacks.) Of course, invoking an empty callback incurs some overhead, so a run with an empty callback will be slightly slower than a run without any callback, but the solution path will still be the same.

One exception to this convention about same solution path occurs if you ask CPLEX to invoke the callback in the context CPX_CALLBACKCONTEXT_CANDIDATE. Since CPLEX cannot know whether your callback is empty or not, CPLEX always disables dual and nonlinear reductions when you ask CPLEX to invoke the callback in that context. This disablement of dual reductions and nonlinear reductions can result in a different solution path, of course. Similar considerations apply to using the CPX_CALLBACKCONTEXT_BRANCHING context. For this context, certain presolve reductions have to be disabled as well to make sure results are correct. Disabling these reductions may again result in path changes.