Package cplex :: Module callbacks :: Class MIPInfoCallback
[frames] | no frames]
 

Class MIPInfoCallback


Subclassable class for MIP informational callback classes.

This callback will be used when CPLEX is solving a MIP problem.

Nested Classes
  quality_metric
Constants defining metrics for the quality of the MIP solve.
  cut_type
Arguments to MIPInfoCallback.get_num_cuts().
Instance Methods
 
get_num_cols(self)
Returns the number of variables in the problem.
 
get_num_rows(self)
Returns the number of linear constraints in the problem.
 
get_num_quadratic_constraints(self)
Returns the number of quadratic constraints in the problem.
 
get_num_cuts(self, cut_type)
Returns the number of cuts of type cut_type added so far.
 
get_best_objective_value(self)
Returns the best objective value among unexplored nodes.
 
get_cutoff(self)
Returns the current cutoff value.
 
get_incumbent_objective_value(self)
Returns the objective value of the incumbent solution.
 
get_incumbent_linear_slacks(self, *args)
Returns a set of linear slacks for the incumbent solution.
 
get_incumbent_quadratic_slacks(self, *args)
Returns a set of quadratic slacks for the incumbent solution.
 
get_incumbent_values(self, *args)
Returns the variable values of the incumbent solution.
 
get_MIP_relative_gap(self)
Returns the current relative MIP gap.
 
get_num_iterations(self)
Returns the number of iterations performed so far.
 
get_num_nodes(self)
Returns the number of nodes processed so far.
 
get_num_remaining_nodes(self)
Returns the number of unexplored nodes remaining.
 
has_incumbent(self)
Returns whether or not an incumbent solution has been found.
 
get_float_quality(self, which)
Returns a measure of the quality of the MIP solution as a floating point value.

Inherited from Callback: abort, get_dettime, get_end_dettime, get_end_time, get_start_dettime, get_start_time, get_time

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

get_num_cols(self)

 
Returns the number of variables in the problem.
Overrides: OptimizationCallback.get_num_cols
(inherited documentation)

get_num_rows(self)

 
Returns the number of linear constraints in the problem.
Overrides: OptimizationCallback.get_num_rows
(inherited documentation)

get_num_quadratic_constraints(self)

 
Returns the number of quadratic constraints in the problem.
Overrides: OptimizationCallback.get_num_quadratic_constraints
(inherited documentation)

get_incumbent_linear_slacks(self, *args)

 

Returns a set of linear slacks for the incumbent solution.

Can be called by four forms.

self.get_incumbent_linear_slacks()
return all linear slack values from the incumbent solution.
self.get_incumbent_linear_slacks(i)
i must be a linear constraint name or index. Returns the slack values associated with the linear constraint whose index or name is i.
self.get_incumbent_linear_slacks(s)
s must be a sequence of linear constraint names or indices. Returns the slack values associated with the linear constraints with indices the members of s. Equivalent to [self.get_incumbent_linear_slacks(i) for i in s]
self.get_incumbent_linear_slacks(begin, end)
begin and end must be linear constraint indices with begin <= end or linear constraint names whose indices respect this order. Returns the slack values associated with the linear constraints with indices between begin and end, inclusive of end. Equivalent to self.get_incumbent_linear_slacks(range(begin, end + 1)).

get_incumbent_quadratic_slacks(self, *args)

 

Returns a set of quadratic slacks for the incumbent solution.

Can be called by four forms.

self.get_incumbent_quadratic_slacks()
return all quadratic slack values from the incumbent
solution.
self.get_incumbent_quadratic_slacks(i)
i must be a quadratic constraint name or index. Returns the slack values associated with the quadratic constraint whose index or name is i.
self.get_incumbent_quadratic_slacks(s)
s must be a sequence of quadratic constraint names or indices. Returns the slack values associated with the quadratic constraints with indices the members of s. Equivalent to [self.get_incumbent_quadratic_slacks(i) for i in s]
self.get_incumbent_quadratic_slacks(begin, end)
begin and end must be quadratic constraint indices or quadratic constraint names. Returns the slack values associated with the quadratic constraints with indices between begin and end, inclusive of end. Equivalent to self.get_incumbent_quadratic_slacks(range(begin, end + 1)).

get_incumbent_values(self, *args)

 

Returns the variable values of the incumbent solution.

There are four forms by which get_incumbent_values may be called.

self.get_incumbent_values()
returns the entire incumbent solution
self.get_incumbent_values(i)
i must be a variable index or name. Returns the value of the variable with index i in the incumbent solution.
self.get_incumbent_values(s)
s must be a sequence of variables indices or names. Returns a list of the values of the variables with indices the members of s, in the same order as they appear in s. Equivalent to [self.get_incumbent_values(i) for i in s]
self.get_incumbent_values(begin, end)
begin and end must be variable indices or variable names. Returns a list of the values of the variables with indices between begin and end, inclusive of end. Equivalent to self.get_incumbent_values(range(begin, end + 1))

get_MIP_relative_gap(self)

 

Returns the current relative MIP gap.

Accesses the current relative gap, like the routine CPXgetmiprelgap in the Callable Library. See CPXgetcallbackinfo and CPXgetmiprelgap in the Callable Library Reference Manual for more detail.

get_float_quality(self, which)

 

Returns a measure of the quality of the MIP solution as a floating point value.

The measure of the quality of a solution must be an attribute of self.quality_metric corresponding to a floating point quality metric. Such metrics include:

self.quality_metric.kappa_stable self.quality_metric.kappa_suspicious self.quality_metric.kappa_unstable self.quality_metric.kappa_illposed self.quality_metric.kappa_max self.quality_metric.kappa_attention