#include <BB_lp.hpp>
Inheritance diagram for BB_lp:
Public Member Functions | |
virtual void | unpack_module_data (BCP_buffer &buf) |
Unpack data sent from the tree manager. | |
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, const int changeType, 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, bool force_branch=false) |
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. | |
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. |
Definition at line 23 of file BB_lp.hpp.
void BB_lp::unpack_module_data | ( | BCP_buffer & | buf | ) | [virtual] |
Unpack data sent from the tree manager.
Reimplemented from BCP_lp_user.
Definition at line 27 of file BB_lp.cpp.
References EPS, BB_prob::EPSILON, p_desc, and BCP_buffer::unpack().
OsiSolverInterface * BB_lp::initialize_solver_interface | ( | ) | [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.
Definition at line 48 of file BB_lp.cpp.
References BCP_lp_user::get_user_data(), in_strong, and MY_user_data::is_processed.
void BB_lp::modify_lp_parameters | ( | OsiSolverInterface * | lp, | |
const int | changeType, | |||
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.
Definition at line 72 of file BB_lp.cpp.
References in_strong.
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.
Definition at line 95 of file BB_lp.cpp.
References algo_cuts, BCP_DBL_MAX, BB_prob::colnum, BCP_vec< T >::empty(), EPS, BCP_lp_user::getLpProblemPointer(), in_strong, BB_prob::indexed, k, BCP_lp_prob::lp_solver, p_desc, BCP_vec< T >::push_back(), BB_prob::rlb_indexed, BB_prob::rub_indexed, BCP_lp_user::test_feasibility(), violated_cuts, BCP_lp_result::x(), and x.
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.
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.
Definition at line 196 of file BB_lp.cpp.
References algo_cuts, BCP_vec< T >::clear(), p_desc, BCP_vec< T >::push_back(), BB_prob::rlb_indexed, BB_prob::rub_indexed, BCP_vec< T >::size(), and violated_cuts.
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.
Definition at line 228 of file BB_lp.cpp.
References BB_prob::colnum, BB_prob::core, EPS, BB_prob::indexed, k, p_desc, BB_prob::rlb_core, BB_prob::rub_core, BCP_lp_result::x(), and x.
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.
Definition at line 343 of file BB_lp.cpp.
References BB_prob::indexed, p_desc, BCP_vec< T >::push_back(), BB_prob::rlb_indexed, BB_prob::rub_indexed, and BCP_vec< T >::size().
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, | |||
bool | force_branch = false | |||
) | [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.
Definition at line 379 of file BB_lp.cpp.
References BCP_lp_user::append_branching_vars(), BCP_DoBranch, BCP_DoNotBranch, BB_prob::colnum, BCP_lp_user::current_level(), EPS, p_desc, BCP_vec< T >::push_back(), BCP_lp_user::select_branching_candidates(), BCP_vec< T >::size(), BCP_lp_result::x(), and x.
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.
Definition at line 451 of file BB_lp.cpp.
References BCP_presolved_lp_brobj::candidate(), real_user_data::card_set_zero, BCP_lp_branching_object::child_num, EPS, BCP_lp_branching_object::forced_var_bd, BCP_lp_branching_object::forced_var_pos, BCP_lp_user::get_user_data(), MY_user_data::p_rud, and BCP_presolved_lp_brobj::user_data().
BB_prob* BB_lp::p_desc [private] |
Pointer on the description of the problem.
Definition at line 26 of file BB_lp.hpp.
Referenced by cuts_to_rows(), generate_cuts_in_lp(), generate_heuristic_solution(), select_branching_candidates(), test_feasibility(), and unpack_module_data().
MY_user_data* BB_lp::p_ud [private] |
int BB_lp::in_strong [private] |
in_strong = 1 if and only if in strong branching phase
Definition at line 32 of file BB_lp.hpp.
Referenced by initialize_new_search_tree_node(), modify_lp_parameters(), and test_feasibility().
double BB_lp::EPS [private] |
Hold the value of EPSILON of class BB_prob.
Definition at line 35 of file BB_lp.hpp.
Referenced by generate_heuristic_solution(), select_branching_candidates(), set_user_data_for_children(), test_feasibility(), and unpack_module_data().
BCP_vec<BCP_cut*> BB_lp::algo_cuts [private] |
Hold pointers on generated algorithmic cuts.
Definition at line 38 of file BB_lp.hpp.
Referenced by generate_cuts_in_lp(), and test_feasibility().
std::vector<int> BB_lp::violated_cuts [private] |
Hold indices of violated indexed cuts.
Definition at line 41 of file BB_lp.hpp.
Referenced by generate_cuts_in_lp(), and test_feasibility().