Skip to content

Commit e51eff2

Browse files
committed
Run trivial heuristics before FJ
1 parent 4dd628d commit e51eff2

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

highs/mip/HighsMipSolver.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,19 @@ void HighsMipSolver::run() {
148148
mipdata_->queryExternalSolution(
149149
solution_objective_, kExternalMipSolutionQueryOriginAfterSetup);
150150

151+
// Apply the trivial heuristics
152+
analysis_.mipTimerStart(kMipClockTrivialHeuristics);
153+
HighsModelStatus returned_model_status = mipdata_->trivialHeuristics();
154+
analysis_.mipTimerStop(kMipClockTrivialHeuristics);
155+
if (modelstatus_ == HighsModelStatus::kNotset &&
156+
returned_model_status == HighsModelStatus::kInfeasible) {
157+
// trivialHeuristics can spot trivial infeasibility, so act on it
158+
modelstatus_ = returned_model_status;
159+
cleanupSolve();
160+
return;
161+
}
162+
// Apply the feasibility jump heuristic (if enabled)
151163
if (options_mip_->mip_heuristic_run_feasibility_jump) {
152-
// Apply the feasibility jump before evaluating the root node
153164
analysis_.mipTimerStart(kMipClockFeasibilityJump);
154165
HighsModelStatus returned_model_status = mipdata_->feasibilityJump();
155166
analysis_.mipTimerStop(kMipClockFeasibilityJump);
@@ -161,17 +172,7 @@ void HighsMipSolver::run() {
161172
return;
162173
}
163174
}
164-
// Apply the trivial heuristics
165-
analysis_.mipTimerStart(kMipClockTrivialHeuristics);
166-
HighsModelStatus returned_model_status = mipdata_->trivialHeuristics();
167-
analysis_.mipTimerStop(kMipClockTrivialHeuristics);
168-
if (modelstatus_ == HighsModelStatus::kNotset &&
169-
returned_model_status == HighsModelStatus::kInfeasible) {
170-
// trivialHeuristics can spot trivial infeasibility, so act on it
171-
modelstatus_ = returned_model_status;
172-
cleanupSolve();
173-
return;
174-
}
175+
// End of pre-root-node heuristics
175176
if (analysis_.analyse_mip_time && !submip)
176177
if (analysis_.analyse_mip_time & !submip)
177178
highsLogUser(options_mip_->log_options, HighsLogType::kInfo,

0 commit comments

Comments
 (0)