Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 1813 #1841

Merged
merged 2 commits into from
Jul 10, 2024
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
29 changes: 28 additions & 1 deletion src/mip/HighsMipSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ void HighsMipSolver::run() {
mipdata_ = decltype(mipdata_)(new HighsMipSolverData(*this));
mipdata_->init();
mipdata_->runPresolve(options_mip_->presolve_reduction_limit);
if (!submip)
highsLogUser(options_mip_->log_options, HighsLogType::kInfo,
"MIP-Timing: After %6.4fs - completed mipdata_->runPresolve\n",
timer_.read(timer_.solve_clock));
// Identify whether time limit has been reached (in presolve)
if (modelstatus_ == HighsModelStatus::kNotset &&
timer_.read(timer_.solve_clock) >= options_mip_->time_limit)
Expand All @@ -134,10 +138,33 @@ void HighsMipSolver::run() {
return;
}

if (!submip)
highsLogUser(options_mip_->log_options, HighsLogType::kInfo,
"MIP-Timing: After %6.4fs - reached mipdata_->runSetup()\n",
timer_.read(timer_.solve_clock));
mipdata_->runSetup();
if (!submip)
highsLogUser(options_mip_->log_options, HighsLogType::kInfo,
"MIP-Timing: After %6.4fs - completed mipdata_->runSetup()\n",
timer_.read(timer_.solve_clock));
restart:
if (modelstatus_ == HighsModelStatus::kNotset) {
// Check limits have not been reached before evaluating root node
if (mipdata_->checkLimits()) {
cleanupSolve();
return;
}
if (!submip)
highsLogUser(
options_mip_->log_options, HighsLogType::kInfo,
"MIP-Timing: After %6.4fs - reached mipdata_->evaluateRootNode()\n",
timer_.read(timer_.solve_clock));
mipdata_->evaluateRootNode();
if (!submip)
highsLogUser(
options_mip_->log_options, HighsLogType::kInfo,
"MIP-Timing: After %6.4fs - completed mipdata_->evaluateRootNode()\n",
timer_.read(timer_.solve_clock));
// age 5 times to remove stored but never violated cuts after root
// separation
mipdata_->cutpool.performAging();
Expand All @@ -146,7 +173,7 @@ void HighsMipSolver::run() {
mipdata_->cutpool.performAging();
mipdata_->cutpool.performAging();
}
if (mipdata_->nodequeue.empty()) {
if (mipdata_->nodequeue.empty() || mipdata_->checkLimits()) {
cleanupSolve();
return;
}
Expand Down
2 changes: 2 additions & 0 deletions src/mip/HighsMipSolverData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1870,6 +1870,8 @@ bool HighsMipSolverData::checkLimits(int64_t nodeOffset) const {
return true;
}

// const double time = mipsolver.timer_.read(mipsolver.timer_.solve_clock);
// printf("checkLimits: time = %g\n", time);
if (mipsolver.timer_.read(mipsolver.timer_.solve_clock) >=
options.time_limit) {
if (mipsolver.modelstatus_ == HighsModelStatus::kNotset) {
Expand Down
Loading