ilog.cplex
Class IloCplex.MIPCallback

java.lang.Object
  |
  +--ilog.cplex.IloCplex.Callback
        |
        +--ilog.cplex.IloCplex.MIPCallback
Direct Known Subclasses:
IloCplex.ControlCallback, IloCplex.DisjunctiveCutCallback, IloCplex.FlowMIRCutCallback, IloCplex.FractionalCutCallback, IloCplex.IncumbentCallback, IloCplex.NodeCallback, IloCplex.ProbingCallback, IloCplex.SolveCallback

public abstract static class IloCplex.MIPCallback
extends IloCplex.Callback

The class for callbacks when IloCplex is solving a MIP. MIP callbacks are executed at every node during the solution of an MIP. This class provides a common query and application programming interface (API) for these classes:

An instance of the class MIPCallbackI represents a user-written callback in an application that uses an instance of IloCplex to solve a mixed integer program (MIP). IloCplex calls the user-written callback prior to solving each node in branch and cut search. This class offers methods for accessing an incumbent solution, an incumbent node, and an incumbent objective value from a user-written callback. It also offers methods for accessing priority orders and statistical information such as the number of cuts. Methods are also available to query the number of generated cuts for each type of cut CPLEX generates. See the ILOG CPLEX User’s Manual for more information on cuts.

The methods of this class are protected for use in deriving a user-written callback class and in implementing the main member function there.

If an attempt is made to access information not available to an instance of this class, an exception is thrown. For example, if there is no incumbent, the methods that query incumbents will throw an exception.

See Also:
IloCplex.Callback

Constructor Summary
protected IloCplex.MIPCallback()
           
 
Method Summary
protected  double getBestObjValue()
          Gets the objective value of the best active node in the current branch and cut tree.
protected  double getCutoff()
          Gets the object value cutoff.
protected  IloCplex.BranchDirection getDirection(IloNumVar var)
          Gets the branch direction.
protected  double getIncumbentObjValue()
          Gets the current best integer solution objective value.
protected  double getIncumbentValue(IloNumVar var)
          The value of var for current best integer solution.
protected  double[] getIncumbentValues(IloNumVar[] vars)
          Gets an array of variable values for the incumbent solution.
protected  double[] getIncumbentValues(IloNumVar[] vars, int start, int num)
          Gets a set of variable values for the incumbent solution.
protected  int getNcliques()
          Gets the number of clique cuts.
protected  int getNcovers()
          Gets the number of cover cuts.
protected  int getNdisjunctiveCuts()
          Gets the number of disjunctive cuts.
protected  int getNflowCovers()
          Gets the number of flow cover cuts.
protected  int getNflowPaths()
          Gets the number of flow path cuts.
protected  int getNfractionalCuts()
          Gets the number of fractional cuts.
protected  int getNGUBcovers()
          Gets the number of GUB cover cuts.
protected  int getNimpliedBounds()
          Gets the number of implied bounds cuts.
protected  int getNiterations()
          Gets the number of LP node iterations.
protected  int getNMIRs()
          Gets the number of MIR cuts.
protected  int getNnodes()
          Gets the nodes processed so far.
protected  int getNremainingNodes()
          Gets the nodes remaining to be processed.
protected  int getPriority(IloNumVar var)
          Gets the branch priority.
protected  boolean isIntegerFeasible()
          Returns true if an incumbent solution has been found.
 
Methods inherited from class ilog.cplex.IloCplex.Callback
abort, main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IloCplex.MIPCallback

protected IloCplex.MIPCallback()
Method Detail

getBestObjValue

protected double getBestObjValue()
Gets the objective value of the best active node in the current branch and cut tree. In the case of a minimization problem, for example, the best objective value is the lowest objective value of all active nodes. This value is thus a lower bound for the objective value of all feasible solutions of the MIP being solved.
Returns:
The objective value of the best active node.

getCutoff

protected double getCutoff()
Gets the object value cutoff. Gets the cutoff for the objective value when solving nodes during branch and cut search. This value is typically computed from the objective value of an incumbent solution and the optimality gap. In the case of a minimization problem, for example, if the objective value of a node exceeds the cutoff value, the node will be pruned without need to solve the node LP to optimality.
Returns:
The objective value cutoff.

getIncumbentObjValue

protected double getIncumbentObjValue()
Gets the current best integer solution objective value. This method returns the objective value for the current incumbent solution (that is, the best integer solution found so far).
Returns:
The objective value for the current incumbent solution.

getIncumbentValue

protected double getIncumbentValue(IloNumVar var)
The value of var for current best integer solution. This method returns the value of variable var in the current incumbent solution (that is, the best integer solution found so far).
Parameters:
var - The variable for which to query the incument solution value.
Returns:
The value of variable var in the current incumbent solution.

getIncumbentValues

protected double[] getIncumbentValues(IloNumVar[] vars)
Gets an array of variable values for the incumbent solution. This method returns the incumbent solution values for an array of variables.
Parameters:
vars - The array of variables for which to query the incumbent solution values.
Returns:
The incumbent solution values for variables listed in var. The solution for variable var[j] is returned in element j of the returned array.

getIncumbentValues

protected double[] getIncumbentValues(IloNumVar[] vars,
                                      int start,
                                      int num)
Gets a set of variable values for the incumbent solution. This method returns the incumbent solution values for a set of variables.
Parameters:
vars - An array containing the variables for which to query the incumbent solution values.
start - The index of the first variable in vars for which to return the incumbent solution value.
num - The number of variables in vars for which to return the incumbent solution values.
Returns:
The incumbent solution values for variables listed in var. The solution for variable var[j+start] is returned in element j of the returned array.

isIntegerFeasible

protected boolean isIntegerFeasible()
Returns true if an incumbent solution has been found.
Returns:
true if an incumbent solution has been found.

getNnodes

protected int getNnodes()
Gets the nodes processed so far. Gets the number of nodes processed so far in the active branch and cut search.
Returns:
The number of nodes processed so far.

getNremainingNodes

protected int getNremainingNodes()
Gets the nodes remaining to be processed. Gets the number of nodes remaining to be processed, or the number of active nodes in the tree.
Returns:
The number of nodes remaining to be processed.

getNiterations

protected int getNiterations()
Gets the number of LP node iterations. Gets the total number of iterations for solving node LPs during the current optimization.
Returns:
The total number of iterations for solving node LPs.

getNcliques

protected int getNcliques()
Gets the number of clique cuts. Gets the number of clique cuts that have been added to the node LP.
Returns:
The number of clique cuts.

getNcovers

protected int getNcovers()
Gets the number of cover cuts. Gets the number of cover cuts that have been added to the node LP.
Returns:
The number of cover cuts.

getNflowCovers

protected int getNflowCovers()
Gets the number of flow cover cuts. Gets the number of flow cover cuts that have been added to the node LP.
Returns:
The number of flow cover cuts.

getNflowPaths

protected int getNflowPaths()
Gets the number of flow path cuts. Gets the number of flow path cuts that have been added to the node LP.
Returns:
The number of flow path cuts.

getNGUBcovers

protected int getNGUBcovers()
Gets the number of GUB cover cuts. Gets the number of GUB cover cuts that have been added to the node LP.
Returns:
The number of GUB cover cuts.

getNfractionalCuts

protected int getNfractionalCuts()
Gets the number of fractional cuts. Gets the number of fractional cuts that have been added to the node LP.
Returns:
The number of fractional cuts.

getNdisjunctiveCuts

protected int getNdisjunctiveCuts()
Gets the number of disjunctive cuts. Gets the number of disjunctive cuts that have been added to the node LP.
Returns:
The number of disjunctive cuts.

getNMIRs

protected int getNMIRs()
Gets the number of MIR cuts. Gets the number of mixed integer rounding (MIR) cuts that have been added to the node LP.
Returns:
The number of MIR cuts.

getNimpliedBounds

protected int getNimpliedBounds()
Gets the number of implied bounds cuts. Gets the number of implied bounds cuts that have been added to the node LP.
Returns:
The number of implied bounds cuts.

getDirection

protected IloCplex.BranchDirection getDirection(IloNumVar var)
                                         throws IloException
Gets the branch direction. Gets the branch direction for variable var
Parameters:
var - The variable for which the branch direction is queried.
Returns:
The branch direction for variable var.

getPriority

protected int getPriority(IloNumVar var)
                   throws IloException
Gets the branch priority. Gets the branch priority for variable var.
Parameters:
var - The variable for which the branch priority is queried
Returns:
The branch priority for variable var