Class for operations at the node level. More...
#include <BB_lp.hpp>
Public Member Functions | |
virtual OsiSolverInterface * | initialize_solver_interface () |
Called only once at the beginning, from the root node. | |
virtual void | initialize_new_search_tree_node (const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const BCP_vec< BCP_obj_status > &var_status, const BCP_vec< BCP_obj_status > &cut_status, BCP_vec< int > &var_changed_pos, BCP_vec< double > &var_new_bd, BCP_vec< int > &cut_changed_pos, BCP_vec< double > &cut_new_bd) |
Initialize data members at the start of processing a new subproblem. | |
virtual void | modify_lp_parameters (OsiSolverInterface *lp, bool in_strong_branching) |
Modify the parameters of the LP solver. | |
virtual BCP_solution * | test_feasibility (const BCP_lp_result &lp_result, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts) |
Test feasibility of the LP solution. | |
virtual void | logical_fixing (const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const BCP_vec< BCP_obj_status > &var_status, const BCP_vec< BCP_obj_status > &cut_status, const int var_bound_changes_since_logical_fixing, BCP_vec< int > &changed_pos, BCP_vec< double > &new_bd) |
Perform fixing of variables. | |
virtual void | generate_cuts_in_lp (const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_cut * > &new_cuts, BCP_vec< BCP_row * > &new_rows) |
Cut generation. | |
virtual BCP_solution * | generate_heuristic_solution (const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts) |
Simple rounding heuristic. | |
virtual void | cuts_to_rows (const BCP_vec< BCP_var * > &vars, BCP_vec< BCP_cut * > &cuts, BCP_vec< BCP_row * > &rows, const BCP_lp_result &lpres, BCP_object_origin origin, bool allow_multiple) |
Describes how to get a row of the matrix from the representation of the cut. | |
virtual BCP_branching_decision | select_branching_candidates (const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const BCP_lp_var_pool &local_var_pool, const BCP_lp_cut_pool &local_cut_pool, BCP_vec< BCP_lp_branching_object * > &cands) |
Called at the end of each iteration. | |
virtual void | set_user_data_for_children (BCP_presolved_lp_brobj *best, const int selected) |
Set up the user data for the children according to the chosen branching object. | |
Constructors and destructors | |
BB_lp () | |
Default constructor. | |
virtual | ~BB_lp () |
Destructor. | |
Packing and unpacking methods | |
virtual void | unpack_module_data (BCP_buffer &buf) |
Unpack data sent from the tree manager. | |
virtual void | pack_cut_algo (const BCP_cut_algo *cut, BCP_buffer &buf) |
Pack algorithmic cuts. | |
virtual BCP_cut_algo * | unpack_cut_algo (BCP_buffer &buf) |
Unpack algorithmic cuts. | |
virtual void | pack_user_data (const BCP_user_data *ud, BCP_buffer &buf) |
Pack user data. | |
virtual MY_user_data * | unpack_user_data (BCP_buffer &buf) |
Unpack user data. | |
Private Attributes | |
BB_prob * | p_desc |
Pointer on the description of the problem. | |
MY_user_data * | p_ud |
Pointer on the description of the user data. | |
int | in_strong |
in_strong = 1 if and only if in strong branching phase | |
double | EPS |
Hold the value of EPSILON of class BB_prob. | |
BCP_vec< BCP_cut * > | algo_cuts |
Hold pointers on generated algorithmic cuts. | |
std::vector< int > | violated_cuts |
Hold indices of violated indexed cuts. |
Class for operations at the node level.
Definition at line 23 of file BB_lp.hpp.
virtual void BB_lp::unpack_module_data | ( | BCP_buffer & | buf | ) | [virtual] |
Unpack data sent from the tree manager.
Reimplemented from BCP_lp_user.
virtual void BB_lp::pack_cut_algo | ( | const BCP_cut_algo * | cut, | |
BCP_buffer & | buf | |||
) | [virtual] |
Pack algorithmic cuts.
Reimplemented from BCP_lp_user.
virtual BCP_cut_algo* BB_lp::unpack_cut_algo | ( | BCP_buffer & | buf | ) | [virtual] |
Unpack algorithmic cuts.
Reimplemented from BCP_lp_user.
virtual void BB_lp::pack_user_data | ( | const BCP_user_data * | ud, | |
BCP_buffer & | buf | |||
) | [virtual] |
Pack user data.
Reimplemented from BCP_lp_user.
virtual MY_user_data* BB_lp::unpack_user_data | ( | BCP_buffer & | buf | ) | [virtual] |
Unpack user data.
Reimplemented from BCP_lp_user.
virtual OsiSolverInterface* BB_lp::initialize_solver_interface | ( | ) | [virtual] |
Called only once at the beginning, from the root node.
Reimplemented from BCP_lp_user.
virtual void BB_lp::initialize_new_search_tree_node | ( | const BCP_vec< BCP_var * > & | vars, | |
const BCP_vec< BCP_cut * > & | cuts, | |||
const BCP_vec< BCP_obj_status > & | var_status, | |||
const BCP_vec< BCP_obj_status > & | cut_status, | |||
BCP_vec< int > & | var_changed_pos, | |||
BCP_vec< double > & | var_new_bd, | |||
BCP_vec< int > & | cut_changed_pos, | |||
BCP_vec< double > & | cut_new_bd | |||
) | [virtual] |
Initialize data members at the start of processing a new subproblem.
Reimplemented from BCP_lp_user.
virtual void BB_lp::modify_lp_parameters | ( | OsiSolverInterface * | lp, | |
bool | in_strong_branching | |||
) | [virtual] |
Modify the parameters of the LP solver.
Called at the beginning of the optimization of a node when the node LP is not yet solved.
Reimplemented from BCP_lp_user.
virtual BCP_solution* BB_lp::test_feasibility | ( | const BCP_lp_result & | lp_result, | |
const BCP_vec< BCP_var * > & | vars, | |||
const BCP_vec< BCP_cut * > & | cuts | |||
) | [virtual] |
Test feasibility of the LP solution.
Called after each node LP has been solved. Called even if the node LP was infeasible Called also during strong branching
Reimplemented from BCP_lp_user.
virtual void BB_lp::logical_fixing | ( | const BCP_lp_result & | lpres, | |
const BCP_vec< BCP_var * > & | vars, | |||
const BCP_vec< BCP_cut * > & | cuts, | |||
const BCP_vec< BCP_obj_status > & | var_status, | |||
const BCP_vec< BCP_obj_status > & | cut_status, | |||
const int | var_bound_changes_since_logical_fixing, | |||
BCP_vec< int > & | changed_pos, | |||
BCP_vec< double > & | new_bd | |||
) | [virtual] |
Perform fixing of variables.
Called at each iteration, after test_feasibility, if the node is not fathomable
Reimplemented from BCP_lp_user.
virtual void BB_lp::generate_cuts_in_lp | ( | const BCP_lp_result & | lpres, | |
const BCP_vec< BCP_var * > & | vars, | |||
const BCP_vec< BCP_cut * > & | cuts, | |||
BCP_vec< BCP_cut * > & | new_cuts, | |||
BCP_vec< BCP_row * > & | new_rows | |||
) | [virtual] |
Cut generation.
Send to BCP the cuts generated in test_feasibility. Use this function to generate standard cuts (Knapsack covers, Lift-and-Project, odd holes, ...).
Reimplemented from BCP_lp_user.
virtual BCP_solution* BB_lp::generate_heuristic_solution | ( | const BCP_lp_result & | lpres, | |
const BCP_vec< BCP_var * > & | vars, | |||
const BCP_vec< BCP_cut * > & | cuts | |||
) | [virtual] |
Simple rounding heuristic.
Reimplemented from BCP_lp_user.
virtual void BB_lp::cuts_to_rows | ( | const BCP_vec< BCP_var * > & | vars, | |
BCP_vec< BCP_cut * > & | cuts, | |||
BCP_vec< BCP_row * > & | rows, | |||
const BCP_lp_result & | lpres, | |||
BCP_object_origin | origin, | |||
bool | allow_multiple | |||
) | [virtual] |
Describes how to get a row of the matrix from the representation of the cut.
Required method when indexed or algorithmic cuts are used.
Reimplemented from BCP_lp_user.
virtual BCP_branching_decision BB_lp::select_branching_candidates | ( | const BCP_lp_result & | lpres, | |
const BCP_vec< BCP_var * > & | vars, | |||
const BCP_vec< BCP_cut * > & | cuts, | |||
const BCP_lp_var_pool & | local_var_pool, | |||
const BCP_lp_cut_pool & | local_cut_pool, | |||
BCP_vec< BCP_lp_branching_object * > & | cands | |||
) | [virtual] |
Called at the end of each iteration.
Possible return values are: BCP_DoNotBranch_Fathomed : The node should be fathomed without branching; BCP_DoNotBranch : BCP should continue to work on this node; BCP_DoBranch : Branching must be done. In this case the method returns the branching object candidates in one of the arguments.
Reimplemented from BCP_lp_user.
virtual void BB_lp::set_user_data_for_children | ( | BCP_presolved_lp_brobj * | best, | |
const int | selected | |||
) | [virtual] |
Set up the user data for the children according to the chosen branching object.
Reimplemented from BCP_lp_user.
BB_prob* BB_lp::p_desc [private] |
MY_user_data* BB_lp::p_ud [private] |
int BB_lp::in_strong [private] |
double BB_lp::EPS [private] |
BCP_vec<BCP_cut*> BB_lp::algo_cuts [private] |
std::vector<int> BB_lp::violated_cuts [private] |