Skip to content

Commit

Permalink
Do not call RENS/RINS when domain in already infeasible
Browse files Browse the repository at this point in the history
  • Loading branch information
fwesselm committed Mar 3, 2025
1 parent 957c7ea commit fb1da53
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/mip/HighsMipSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,19 @@ void HighsMipSolver::run() {
analysis_.mipTimerStop(kMipClockRandomizedRounding0);
}

if (mipdata_->incumbent.empty()) {
analysis_.mipTimerStart(kMipClockRens);
mipdata_->heuristics.RENS(
mipdata_->lp.getLpSolver().getSolution().col_value);
analysis_.mipTimerStop(kMipClockRens);
} else {
analysis_.mipTimerStart(kMipClockRins);
mipdata_->heuristics.RINS(
mipdata_->lp.getLpSolver().getSolution().col_value);
analysis_.mipTimerStop(kMipClockRins);
// previous heuristic may have detected infeasibility
if (!mipdata_->domain.infeasible()) {
if (mipdata_->incumbent.empty()) {
analysis_.mipTimerStart(kMipClockRens);
mipdata_->heuristics.RENS(
mipdata_->lp.getLpSolver().getSolution().col_value);
analysis_.mipTimerStop(kMipClockRens);
} else {
analysis_.mipTimerStart(kMipClockRins);
mipdata_->heuristics.RINS(
mipdata_->lp.getLpSolver().getSolution().col_value);
analysis_.mipTimerStop(kMipClockRins);
}
}

mipdata_->heuristics.flushStatistics();
Expand Down
3 changes: 3 additions & 0 deletions src/mip/HighsSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ HighsSearch::HighsSearch(HighsMipSolver& mipsolver, HighsPseudocost& pseudocost)
countTreeWeight = true;
childselrule = mipsolver.submip ? ChildSelectionRule::kHybridInferenceCost
: ChildSelectionRule::kRootSol;
// the infeasibility flag is overwritten and lost when setDomainChangeStack is
// called. therefore, assume that localdom is not infeasible here.
assert(!this->localdom.infeasible());
this->localdom.setDomainChangeStack(std::vector<HighsDomainChange>());
}

Expand Down

0 comments on commit fb1da53

Please sign in to comment.