Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions cpp/src/dual_simplex/branch_and_bound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,8 @@ node_status_t branch_and_bound_t<i_t, f_t>::solve_node(search_tree_t<i_t, f_t>&
{
f_t abs_fathom_tol = settings_.absolute_mip_gap_tol / 10;

std::vector<variable_status_t>& leaf_vstatus = node_ptr->vstatus;
lp_solution_t<i_t, f_t> leaf_solution(leaf_problem.num_rows, leaf_problem.num_cols);
std::vector<variable_status_t>& leaf_vstatus = node_ptr->vstatus;
assert(leaf_vstatus.size() == leaf_problem.num_cols);

std::vector<bool> bounds_changed(leaf_problem.num_cols, false);
Expand All @@ -572,7 +572,6 @@ node_status_t branch_and_bound_t<i_t, f_t>::solve_node(search_tree_t<i_t, f_t>&
// two vectors at each node and potentially cause memory issues
node_ptr->get_variable_bounds(leaf_problem.lower, leaf_problem.upper, bounds_changed);

std::vector<f_t> leaf_edge_norms = edge_norms_; // = node.steepest_edge_norms;
simplex_solver_settings_t lp_settings = settings_;
lp_settings.set_log(false);
lp_settings.cut_off = upper_bound + settings_.dual_tol;
Expand All @@ -587,8 +586,9 @@ node_status_t branch_and_bound_t<i_t, f_t>::solve_node(search_tree_t<i_t, f_t>&
dual::status_t lp_status = dual::status_t::DUAL_UNBOUNDED;

if (feasible) {
i_t node_iter = 0;
f_t lp_start_time = tic();
i_t node_iter = 0;
f_t lp_start_time = tic();
std::vector<f_t> leaf_edge_norms = edge_norms_; // = node.steepest_edge_norms;

lp_status = dual_phase2(2,
0,
Expand Down Expand Up @@ -778,7 +778,7 @@ void branch_and_bound_t<i_t, f_t>::exploration_ramp_up(search_tree_t<i_t, f_t>*
}

template <typename i_t, typename f_t>
void branch_and_bound_t<i_t, f_t>::explore_subtree(i_t id,
void branch_and_bound_t<i_t, f_t>::explore_subtree(i_t task_id,
search_tree_t<i_t, f_t>& search_tree,
mip_node_t<i_t, f_t>* start_node,
lp_problem_t<i_t, f_t>& leaf_problem,
Expand All @@ -788,7 +788,7 @@ void branch_and_bound_t<i_t, f_t>::explore_subtree(i_t id,
stack.push_front(start_node);

while (stack.size() > 0 && status_ == mip_exploration_status_t::RUNNING) {
if (id == 0) { repair_heuristic_solutions(); }
if (task_id == 0) { repair_heuristic_solutions(); }

mip_node_t<i_t, f_t>* node_ptr = stack.front();
stack.pop_front();
Expand All @@ -804,10 +804,10 @@ void branch_and_bound_t<i_t, f_t>::explore_subtree(i_t id,
// - The current node and its siblings uses the lower bound of the parent before solving the LP
// relaxation
// - The lower bound of the parent is lower or equal to its children
assert(id < local_lower_bounds_.size());
local_lower_bounds_[id] = lower_bound;
i_t nodes_explored = (++stats_.nodes_explored);
i_t nodes_unexplored = (--stats_.nodes_unexplored);
assert(task_id < local_lower_bounds_.size());
local_lower_bounds_[task_id] = lower_bound;
i_t nodes_explored = (++stats_.nodes_explored);
i_t nodes_unexplored = (--stats_.nodes_unexplored);
stats_.nodes_since_last_log++;

if (lower_bound > upper_bound || rel_gap < settings_.relative_mip_gap_tol) {
Expand All @@ -818,7 +818,7 @@ void branch_and_bound_t<i_t, f_t>::explore_subtree(i_t id,

f_t now = toc(stats_.start_time);

if (id == 0) {
if (task_id == 0) {
f_t time_since_last_log = stats_.last_log == 0 ? 1.0 : toc(stats_.last_log);

if (((stats_.nodes_since_last_log >= 1000 || abs_gap < 10 * settings_.absolute_mip_gap_tol) &&
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/dual_simplex/branch_and_bound.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class branch_and_bound_t {
i_t initial_heap_size);

// Explore the search tree using the best-first search with plunging strategy.
void explore_subtree(i_t id,
void explore_subtree(i_t task_id,
search_tree_t<i_t, f_t>& search_tree,
mip_node_t<i_t, f_t>* start_node,
lp_problem_t<i_t, f_t>& leaf_problem,
Expand Down