Skip to content

Commit 5b23554

Browse files
committed
fixed incorrect reporting of an infeasible solution due to timeout
1 parent 8a00e93 commit 5b23554

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

cpp/src/dual_simplex/branch_and_bound.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,13 @@ mip_status_t branch_and_bound_t<i_t, f_t>::set_final_solution(mip_solution_t<i_t
485485
}
486486
}
487487

488-
if (stats_.nodes_explored > 0 && stats_.nodes_unexplored == 0 && upper_bound == inf) {
489-
settings_.log.printf("Integer infeasible.\n");
490-
mip_status = mip_status_t::INFEASIBLE;
491-
if (settings_.heuristic_preemption_callback != nullptr) {
492-
settings_.heuristic_preemption_callback();
488+
if (status_ == mip_exploration_status_t::COMPLETED) {
489+
if (stats_.nodes_explored > 0 && stats_.nodes_unexplored == 0 && upper_bound == inf) {
490+
settings_.log.printf("Integer infeasible.\n");
491+
mip_status = mip_status_t::INFEASIBLE;
492+
if (settings_.heuristic_preemption_callback != nullptr) {
493+
settings_.heuristic_preemption_callback();
494+
}
493495
}
494496
}
495497

0 commit comments

Comments
 (0)