Package cplex :: Module callbacks :: Class UserCutCallback
 

Class UserCutCallback


Subclassable class for lazy constraint callback classes.

This callback will be used within the cut loop that CPLEX calls at each node of the branch and cut algorithm. It will be called once after CPLEX has ended its own cut generation loop so that the user can specify additional cuts to be added to the cut pool.

Instance Methods
 
add(self, cut, sense, rhs, use=0)
Adds a linear cut to to the current subproblem.
 
add_local(self, cut, sense, rhs)
Adds a linear local cut to the current subproblem.
 
is_after_cut_loop(self)
Returns True if called after the cut loop, False otherwise.
 
abort_cut_loop(self)
Terminate the cut loop and proceed with branching.

Inherited from ControlCallback: get_SOS_feasibilities, get_feasibilities, get_linear_slacks, get_lower_bounds, get_node_ID, get_node_data, get_objective_value, get_pseudo_costs, get_quadratic_slacks, get_upper_bounds, get_values, set_node_data

Inherited from MIPCallback: get_current_node_depth, get_objective_coefficients

Inherited from MIPInfoCallback: get_MIP_relative_gap, get_best_objective_value, get_cutoff, get_float_quality, get_incumbent_linear_slacks, get_incumbent_objective_value, get_incumbent_quadratic_slacks, get_incumbent_values, get_num_cols, get_num_cuts, get_num_iterations, get_num_nodes, get_num_quadratic_constraints, get_num_remaining_nodes, get_num_rows, get_thread_num, has_incumbent

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

Class Variables
  use_cut = UseCut()
See UseCut()

Inherited from ControlCallback: feasibility_status

Inherited from MIPInfoCallback: cut_type, quality_metric

Method Details

add(self, cut, sense, rhs, use=0)

 

Adds a linear cut to to the current subproblem.

cut must be either a SparsePair instance or a list of two lists, the first of which specifies variables, the second of which specifies the values of the cut.

sense must be a single-character string; ("L", "G", "E")

rhs is a float, specifying the righthand side of the cut.

use indicates under what circumstances the cut should be used. It can take the following values

self.use_cut.force (default) : force CPLEX to use the cut self.use_cut.purge : allow CPLEX to purge the cut self.use_cut.filter : treat as cuts CPLEX creates

add_local(self, cut, sense, rhs)

 

Adds a linear local cut to the current subproblem.

A local cut is a cut that is only valid at the current node and the subtree rooted by the current node. It does not need to be globally valid.

cut must be either a SparsePair instance or a list of two lists, the first of which specifies variables, the second of which specifies the values of the cut.

sense must be a single-character string; ("L", "G", "E")

rhs is a float, specifying the righthand side of the cut.