Class of callbacks called when a new incumbent is found.

Namespace: ILOG.CPLEX
Assembly: ILOG.CPLEX (in ILOG.CPLEX.dll) Version: 22.1.1.0

Syntax

C#
public abstract class IncumbentCallback : Cplex..::..MIPCallback
Visual Basic
Public MustInherit Class IncumbentCallback _
	Inherits Cplex..::..MIPCallback

Remarks

This is an advanced class.

Important:

Advanced classes typically demand a profound understanding of the algorithms used by CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, the team encourages you to consider carefully whether you can accomplish the same task by means of other classes instead.

An instance of this callback class is called whenever a new potential incumbent is found during the branch-and-cut search. It allows you to analyze the proposed incumbent and optionally reject it. In this case, CPLEX will continue the branch-and-cut search. However, since CPLEX considers the current node solution to be integer feasible, it will not be able to determine a reasonable way to branch. Thus, when this callback is implemented in such a way that it may reject an incumbent, it is typically paired with a branch callback to perform the branching after an incumbent has been rejected.

When you use this callback to reject an incumbent, you must set the parameter to control the type of primal and dual reductions, Cplex.IntParam.Reduce either to 1 (one) in order to restrict presolve to primal reductions only, or to 0 (zero) in order to disable all presolve reductions. This setting of the reduction parameter is not necessary if the incumbent callback is used for other purposes.

The constructor and methods of this class are protected to make sure that they are used only to derive a user-written callback class or to implement the main method in it.

Important:

The incumbent callback may be invoked during MIP start processing. In that case, {@link Cplex.IncumbentCallback#getSolutionSource() Cplex.IncumbentCallback.GetSolutionSource()} will return MIPStartSolution. In this situation, the following special consideration applies:

  • MIP start processing occurs very early in the solution process. At this point no search tree is setup yet and there are no search tree nodes yet. Consequently, a lot of the callback functions that require a node context will fail in this situation.

Inheritance Hierarchy

System..::..Object
  ILOG.CPLEX..::..Cplex..::..Callback
    ILOG.CPLEX..::..Cplex..::..OptimizationCallback
      ILOG.CPLEX..::..Cplex..::..MIPInfoCallback
        ILOG.CPLEX..::..Cplex..::..MIPCallback
          ILOG.CPLEX..::..Cplex..::..IncumbentCallback

See Also