Package cplex :: Module callbacks :: Class NodeCallback
 

Class NodeCallback


Subclassable class for node callback classes.

This callback will be used before CPLEX enters a node, and can select a different node to be entered instead.

Instance Methods
 
get_branch_variable(self, which_node)
Returns the index of the variable used to branch at node which_node.
 
get_depth(self, which_node)
Returns the depth in the search tree of node which_node.
 
get_current_node_depth(self)
Returns the depth of the current node in the search tree.
 
get_estimated_objective_value(self, which_node)
Returns the estimated objective function value at node which_node.
 
get_infeasibility_sum(self, which_node)
Returns the sum of infeasibilities at node which_node.
 
get_num_infeasibilities(self, which_node)
Returns the number of infeasibilities at node which_node.
 
get_node_data(self, which_node)
Returns the handle set by the user for node which_node.
 
set_node_data(self, which_node, data)
Set the user handle for the specified node.
 
get_node_ID(self, which_node)
Returns a one-tuple containing the sequence number of node which_node.
 
get_node_number(self, which_node)
Returns the index number of node which_node.
 
get_objective_value(self, which_node)
Returns the objective function value for node which_node.
 
select_node(self, which_node)
Tells Cplex to enter node which_node next.

Inherited from MIPCallback: 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

Inherited from MIPInfoCallback: cut_type, quality_metric

Method Details

get_branch_variable(self, which_node)

 

Returns the index of the variable used to branch at node which_node.

which_node may either be an integer specifying the index number of the desired node, or a 1-tuple whose entry is an integer specifying the sequence number of the desired node.

get_depth(self, which_node)

 

Returns the depth in the search tree of node which_node.

which_node may either be an integer specifying the index number of the desired node, or a 1-tuple whose entry is an integer specifying the sequence number of the desired node.

get_current_node_depth(self)

 

Returns the depth of the current node in the search tree.

This method always raises an exception since the node callback is not invoked in the context of any node.

Overrides: MIPCallback.get_current_node_depth

get_estimated_objective_value(self, which_node)

 

Returns the estimated objective function value at node which_node.

which_node may either be an integer specifying the index number of the desired node, or a 1-tuple whose entry is an integer specifying the sequence number of the desired node.

get_infeasibility_sum(self, which_node)

 

Returns the sum of infeasibilities at node which_node.

which_node may either be an integer specifying the index number of the desired node, or a 1-tuple whose entry is an integer specifying the sequence number of the desired node.

get_num_infeasibilities(self, which_node)

 

Returns the number of infeasibilities at node which_node.

which_node may either be an integer specifying the index number of the desired node, or a 1-tuple whose entry is an integer specifying the sequence number of the desired node.

get_node_data(self, which_node)

 

Returns the handle set by the user for node which_node.

Returns None if no handle was set when the node was created.

which_node may either be an integer specifying the index number of the desired node, or a 1-tuple whose entry is an integer specifying the sequence number of the desired node.

set_node_data(self, which_node, data)

 

Set the user handle for the specified node.

Returns the user handle previously set for that node (or None if no handle was set).

get_node_ID(self, which_node)

 

Returns a one-tuple containing the sequence number of node which_node.

which_node must be an integer specifying the index number of the desired node.

get_node_number(self, which_node)

 

Returns the index number of node which_node.

which_node must be a 1-tuple whose entry is an integer specifying the sequence number of the desired node.

get_objective_value(self, which_node)

 

Returns the objective function value for node which_node.

which_node may either be an integer specifying the index number of the desired node, or a 1-tuple whose entry is an integer specifying the sequence number of the desired node.

select_node(self, which_node)

 

Tells Cplex to enter node which_node next.

which_node may either be an integer specifying the index number of the desired node, or a 1-tuple whose entry is an integer specifying the sequence number of the desired node.