Skip to content

Commit

Permalink
Changes to monitor and possibly fix P-D update error after 999==333
Browse files Browse the repository at this point in the history
  • Loading branch information
jajhall committed Oct 31, 2024
1 parent 16200c2 commit 6575e2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
2 changes: 2 additions & 0 deletions src/mip/HighsMipSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ void HighsMipSolver::run() {
mipdata_->cutpool.performAging();
mipdata_->cutpool.performAging();
}
printf("HighsMipSolver::run() bounds are [%g, %g]: nodequeue.empty() = %d; checkLimits() = %d\n", mipdata_->lower_bound, mipdata_->upper_bound, mipdata_->nodequeue.empty(), mipdata_->checkLimits());
if (mipdata_->nodequeue.empty() || mipdata_->checkLimits()) {
printf("HighsMipSolver::run() calling cleanupSolve();\n");
cleanupSolve();
return;
}
Expand Down
28 changes: 6 additions & 22 deletions src/mip/HighsMipSolverData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,8 +1033,12 @@ void HighsMipSolverData::performRestart() {
upper_limit += mipsolver.model_->offset_;
optimality_limit += mipsolver.model_->offset_;

double prev_lower_bound = lower_bound;
double prev_upper_bound = upper_bound;
upper_bound += mipsolver.model_->offset_;
lower_bound += mipsolver.model_->offset_;
printf(" HighsMipSolverData::performRestart() 0: lower bound changed from %g to %g using offset = %g \n", prev_lower_bound, lower_bound, mipsolver.model_->offset_);
printf(" HighsMipSolverData::performRestart() 0: upper bound changed from %g to %g using offset = %g \n", prev_upper_bound, upper_bound, mipsolver.model_->offset_);

// remove the current incumbent. Any incumbent is already transformed into the
// original space and kept there
Expand Down Expand Up @@ -1081,32 +1085,10 @@ void HighsMipSolverData::performRestart() {
upper_bound -= mipsolver.model_->offset_;
}

double prev_lower_bound = lower_bound;

lower_bound = upper_bound;

if (!mipsolver.submip) {
printf(
"HighsMipSolverData::performRestart() After mipsolver.modelstatus_ "
"!= HighsModelStatus::kNotset\n");
assert(333 == 999);
}
bool bound_change = lower_bound != prev_lower_bound;
if (!mipsolver.submip && bound_change)
updatePrimaDualIntegral(prev_lower_bound, lower_bound, upper_bound,
upper_bound);

if (mipsolver.solution_objective_ != kHighsInf &&
mipsolver.modelstatus_ == HighsModelStatus::kInfeasible)
mipsolver.modelstatus_ = HighsModelStatus::kOptimal;
if (!mipsolver.submip) {
printf(
"HighsMipSolverData::performRestart() On exit lower_bound is "
"%16.10g\n",
lower_bound);
updatePrimaDualIntegral(lower_bound, lower_bound, upper_bound,
upper_bound);
}
return;
}
// Bounds are currently in the original space since presolve will have
Expand Down Expand Up @@ -1697,6 +1679,7 @@ void HighsMipSolverData::evaluateRootNode() {
fixingRate);
tg.taskWait();
performRestart();
printf("HighsMipSolverData::evaluateRootNode() return 0 from performRestart();\n");
++numRestartsRoot;
if (mipsolver.modelstatus_ == HighsModelStatus::kNotset) goto restart;

Expand Down Expand Up @@ -1928,6 +1911,7 @@ void HighsMipSolverData::evaluateRootNode() {
if (stall != -1) maxSepaRounds = std::min(maxSepaRounds, nseparounds);
tg.taskWait();
performRestart();
printf("HighsMipSolverData::evaluateRootNode() return 1 from performRestart() bounds are [%g, %g]\n", lower_bound, upper_bound);
++numRestartsRoot;
if (mipsolver.modelstatus_ == HighsModelStatus::kNotset) goto restart;

Expand Down

0 comments on commit 6575e2e

Please sign in to comment.