Skip to content
Open
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
20 changes: 9 additions & 11 deletions cpp/src/branch_and_bound/branch_and_bound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,6 @@ struct deterministic_bfs_policy_t
branch_direction_t dir) override
{
switch (status) {
case node_status_t::INFEASIBLE: this->worker.record_infeasible(node); break;
case node_status_t::FATHOMED: this->worker.record_fathomed(node, node->lower_bound); break;
case node_status_t::INTEGER_FEASIBLE:
this->worker.record_integer_solution(node, node->lower_bound);
Expand Down Expand Up @@ -1384,15 +1383,14 @@ std::pair<node_status_t, branch_direction_t> branch_and_bound_t<i_t, f_t>::updat
worker->recompute_bounds = true;

if (lp_status == dual_status_t::DUAL_UNBOUNDED) {
node_ptr->lower_bound = inf;
policy.graphviz(search_tree, node_ptr, "infeasible", 0.0);
search_tree.update(node_ptr, node_status_t::INFEASIBLE);
status = node_status_t::INFEASIBLE;
node_ptr->lower_bound = upper_bound;
policy.graphviz(search_tree, node_ptr, "infeasible", upper_bound);
search_tree.update(node_ptr, node_status_t::FATHOMED);
status = node_status_t::FATHOMED;

} else if (lp_status == dual_status_t::CUTOFF) {
f_t leaf_obj = compute_objective(leaf_problem, leaf_solution.x);
node_ptr->lower_bound = upper_bound;
policy.graphviz(search_tree, node_ptr, "cut off", leaf_obj);
policy.graphviz(search_tree, node_ptr, "cut off", upper_bound);
search_tree.update(node_ptr, node_status_t::FATHOMED);
status = node_status_t::FATHOMED;

Expand Down Expand Up @@ -5274,13 +5272,13 @@ node_status_t branch_and_bound_t<i_t, f_t>::solve_node_deterministic(
#endif

if (!feasible) {
node_ptr->lower_bound = std::numeric_limits<f_t>::infinity();
search_tree.update(node_ptr, node_status_t::INFEASIBLE);
worker.record_infeasible(node_ptr);
node_ptr->lower_bound = worker.local_upper_bound;
search_tree.update(node_ptr, node_status_t::FATHOMED);
worker.record_fathomed(node_ptr, worker.local_upper_bound);
Comment thread
nguidotti marked this conversation as resolved.
--exploration_stats_.nodes_unexplored;
++exploration_stats_.nodes_explored;
worker.recompute_bounds_and_basis = true;
return node_status_t::INFEASIBLE;
return node_status_t::FATHOMED;
}

// Solve LP relaxation
Expand Down
9 changes: 0 additions & 9 deletions cpp/src/branch_and_bound/deterministic_workers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,6 @@ class deterministic_bfs_worker_t
++total_nodes_pruned;
}

void record_infeasible(mip_node_t<i_t, f_t>* node)
{
record_event(
bb_event_t<i_t, f_t>::make_infeasible(this->clock, this->worker_id, node->creation_seq));
++nodes_processed_this_horizon;
++this->total_nodes_processed;
++total_nodes_infeasible;
}

void record_numerical(mip_node_t<i_t, f_t>* node)
{
record_event(
Expand Down
9 changes: 4 additions & 5 deletions cpp/src/branch_and_bound/mip_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ namespace cuopt::mathematical_optimization::mip {
enum class node_status_t : int {
PENDING = 0, // Node is still in the tree, waiting to be solved
INTEGER_FEASIBLE = 1, // Node has an integer feasible solution
INFEASIBLE = 2, // Node is infeasible
FATHOMED = 3, // Node objective is greater than the upper bound
HAS_CHILDREN = 4, // Node has children to explore
NUMERICAL = 5 // Encountered numerical issue when solving the LP relaxation
FATHOMED = 2, // Node is infeasible or has objective is greater than the upper bound
HAS_CHILDREN = 3, // Node has children to explore
NUMERICAL = 4 // Encountered numerical issue when solving the LP relaxation
};

inline bool inactive_status(node_status_t status)
{
return (status == node_status_t::FATHOMED || status == node_status_t::INTEGER_FEASIBLE ||
status == node_status_t::INFEASIBLE || status == node_status_t::NUMERICAL);
status == node_status_t::NUMERICAL);
}

template <typename i_t, typename f_t>
Expand Down
Loading