4 #include "CoinTime.hpp"
21 const bool from_repricing =
false;
27 bool varset_changed =
true;
28 bool cutset_changed =
true;
31 double nodeStart = CoinCpuTime();
35 "LP: **** Processing NODE %i on LEVEL %i (from TM) ****\n",
47 "LP: *** Starting iteration %i ***\n",
51 time0 = CoinCpuTime();
55 const int changeType = (varset_changed ? 2:0) + (cutset_changed ? 1:0);
60 sprintf(fname,
"matrix-%i.%i.%i",
77 p.
user->
print(
true,
"LP: Matrix size: %i vars x %i cuts\n",
80 p.
user->
print(
true,
"LP: Solution value: %.4f / %i , %i \n",
92 time0 = CoinCpuTime();
107 LP: Terminating and fathoming due to proven high cost.\n",
118 "LP: Primal feasibility lost.\n");
122 varset_changed =
true;
128 p.
user->
print(
true,
"LP: ############ Unexpected termcode: %i\n",
142 varset_changed =
false;
203 const int cuts_to_add_cnt =
206 const int vars_to_add_cnt =
209 time0 = CoinCpuTime();
219 for (
int i = 0; i < size; ++i) {
220 if (gsol->
_vars[i]->bcpind() == 0 &&
231 LP: Terminating and fathoming due to proven high cost (good heur soln!).\n",
240 if (verb_cut && ! verb_var) {
241 p.
user->
print(
true,
"LP: In iteration %i BCP generated",
243 p.
user->
print(
true,
" %i cuts before calling branch()\n",
245 }
else if (! verb_cut && verb_var) {
246 p.
user->
print(
true,
"LP: In iteration %i BCP generated",
248 p.
user->
print(
true,
" %i vars before calling branch()\n",
250 }
else if (verb_cut && verb_var) {
251 p.
user->
print(
true,
"LP: In iteration %i BCP generated",
253 p.
user->
print(
true,
" %i cuts , %i vars before calling branch()\n",
254 cuts_to_add_cnt, vars_to_add_cnt);
257 if (cuts_to_add_cnt == 0 && vars_to_add_cnt == 0 &&
269 "BCP_lp: Time spent in this node: %15.4f seconds\n",
270 CoinCpuTime() - nodeStart);
277 "BCP_lp: Time spent in this node: %15.4f seconds\n",
278 CoinCpuTime() - nodeStart);
279 nodeStart = CoinCpuTime();
282 "LP: **** Processing NODE %i on LEVEL %i (dived) ****\n",
288 varset_changed =
true;
289 cutset_changed =
true;
300 "LP: In iteration %i BCP added %i cuts.\n",
303 "LP: In iteration %i BCP added %i vars.\n",
306 "LP: In iteration %i BCP added %i cuts, %i vars.\n",
308 varset_changed = (added_vars > 0);
309 cutset_changed = (added_cuts > 0);
BCP_message_tag
This enumerative constant describes the message tags different processes of BCP understand.
virtual void send(const int target, const BCP_message_tag tag)=0
Send an empty message (message tag only) to the process given by the frist argument.
BCP_lp_node * node
Description he current search tree node.
void print(const bool ifprint, const char *format,...) const
A method to print a message with the process id.
No branching happend, continue to work on the same node.
Print the number of cuts generated during this iteration (since the LP was resolved last time)...
BCP_vec< BCP_var * > _vars
Vector of variables that are at nonzero level in the solution.
void clear()
Delete every entry.
char param(BCP_lp_par::chr_params key) const
int BCP_lp_next_var_index(BCP_lp_prob &p)
Print the number of variables generated during this iteration.
int BCP_lp_generate_vars(BCP_lp_prob &p, bool first_in_loop, const bool from_repricing)
bool BCP_lp_fathom(BCP_lp_prob &p, const bool from_repricing)
void BCP_lp_process_result(BCP_lp_prob &p, const BCP_lp_result &lpres)
BCP_branching_result BCP_lp_branch(BCP_lp_prob &p)
void BCP_lp_test_feasibility(BCP_lp_prob &p, const BCP_lp_result &lpres)
Print the size of the problem matrix and the LP solution value after resolving the LP...
Indicates whether message passing is serial (all processes are on the same processor) or not...
Turn on the user hook "display_lp_solution".
Print the "Starting iteration x" line.
int BCP_lp_add_from_local_var_pool(BCP_lp_prob &p)
void BCP_lp_perform_fathom(BCP_lp_prob &p, const char *msg, BCP_message_tag msgtag)
double BCP_lp_compute_lower_bound(BCP_lp_prob &p, const BCP_lp_result &lpres)
Print the number of variables added from the local variable pool in the curent iteration.
The Variable Pool is queried for columns that improve the formulation after the first LP realxation i...
BCP_lp_user * user
A class that holds the methods about how to pack things.
void BCP_lp_adjust_row_effectiveness(BCP_lp_prob &p)
The node is fathomed, the LP process should wait for a new node.
BCP_message_tag BCP_lp_pack_for_vg(BCP_lp_prob &p)
OsiSolverInterface * lp_solver
A class that holds the methods about how to pack things.
BCP_lp_result * lp_result
virtual BCP_solution * generate_heuristic_solution(const BCP_lp_result &lpres, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts)
Try to generate a heuristic solution (or return one generated during cut/variable generation...
int BCP_lp_generate_cuts(BCP_lp_prob &p, bool first_in_loop, const bool from_repricing)
BCP_vec< double > lb_at_cutgen
bool BCP_lp_fix_vars(BCP_lp_prob &p)
Branching happened, one of the children is kept and that's what the LP process will continue to work ...
For each tree node print out how much time was spent on it.
void insert(iterator position, const void *first, const size_t num)
Insert num entries starting from memory location first into the vector from position pos...
The lower bound corresponding to the node is above the upper bound.
bool over_ub(double lb) const
int BCP_lp_add_from_local_cut_pool(BCP_lp_prob &p)
void BCP_lp_purge_slack_pool(BCP_lp_prob &p)
Print information related to fathoming.
Currently there isn't any error handling in BCP.
virtual void display_lp_solution(const BCP_lp_result &lp_result, const BCP_vec< BCP_var * > &vars, const BCP_vec< BCP_cut * > &cuts, const bool final_lp_solution)
Display the result of most recent LP optimization.
void BCP_lp_prepare_for_new_node(BCP_lp_prob &p)
void BCP_lp_check_ub(BCP_lp_prob &p)
size_t size() const
Return the current number of entries.
iterator end()
Return an iterator to the end of the object.
BCP_message_tag BCP_lp_pack_for_cg(BCP_lp_prob &p)
Turn on the user hook "display_lp_solution" for the last LP relaxation solved at a search tree node...
void get_results(OsiSolverInterface &lp_solver)
Get the result from the LP solver.
void BCP_lp_main_loop(BCP_lp_prob &p)
The Cut Pool is queried for violated valid inequalities after the first LP relaxation is solved and t...
BCP_message_environment * msg_env
A class that holds the methods about how to pack things.
Print the "Processing NODE x on LEVEL y" line.
This class holds the results after solving an LP relaxation.
This class holds a MIP feasible primal solution.
void send_feasible_solution(const BCP_solution *sol)
virtual void modify_lp_parameters(OsiSolverInterface *lp, const int changeType, bool in_strong_branching)
Modify parameters of the LP solver before optimization.
void BCP_lp_delete_cols_and_rows(BCP_lp_prob &p, BCP_lp_branching_object *can, const int added_colnum, const int added_rownum, const bool from_fathom, const bool force_delete)
Print the number of cuts added from the local cut pool in the current iteration.
This is the abstract base class for a solution to a Mixed Integer Programming problem.