Base class for all callback classes querying or taking control of the MIP branch-and-cut search.

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

Syntax

C#
public abstract class ControlCallback : Cplex..::..MIPCallback
Visual Basic
Public MustInherit Class ControlCallback _
	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.

This is the base class for all callback classes that allow you to query or take control of the MIP branch-and-cut search. These classes are:

  • Cplex.BranchCallback
  • Cplex.HeuristicCallback
  • Cplex.UserCutCallback
  • Cplex.LazyConstraintCallback
  • Cplex.SolveCallback

An instance of ControlCallback is not a callback for implementing user functionality itself, but rather provides the common interface for those listed callback classes. Those callbacks share the property that they are called at every node in the branch-and-cut search tree, and allow you to access node-related data. For each branch-and-cut node, those callbacks are called in the following order:

  1. Cplex.UserCutCallback: Once the node problem has been solved and Cplex has added all its cuts, the user cut callback is called. In case new cuts are added to the problem, the node problem is solved again. This is iterated until no more cuts are added to the problem.
  2. Cplex.HeuristicCallback: Once the node has been fully solved (that is including all the cuts that may have been added), the heuristic callback is called in an attempt to generate an integer feasible solution from the current relaxation solution at that node.
  3. Cplex.BranchCallback: Finally, if the relaxation solution at the current node is either integer infeasible or rejected by the Cplex.IncumbentCallback, the problem is split into subproblems. At that point the Cplex.BranchCallback can be used to control how to create the subproblems.

The 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.

Unbounded ray

In the case where the node LP is unbounded, the methods getValue return a vector that corresponds to an unbounded direction. The vector is scaled in such a way that the maximum absolute value of one of its elements is CPX_INFBOUND. Thus, often the vector can be used directly, for example to separate lazy constraints. However, due to the large values, care must be taken to deal with potential numerical errors. If in doubt, rescale the vector, and use it as an unbounded ray rather than as a primal vector.

Inheritance Hierarchy

See Also