From 6575e2e47a33fb532cf18b257267ed4da2ecc6fb Mon Sep 17 00:00:00 2001 From: jajhall Date: Thu, 31 Oct 2024 12:49:25 +0000 Subject: [PATCH] Changes to monitor and possibly fix P-D update error after 999==333 --- src/mip/HighsMipSolver.cpp | 2 ++ src/mip/HighsMipSolverData.cpp | 28 ++++++---------------------- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/mip/HighsMipSolver.cpp b/src/mip/HighsMipSolver.cpp index 507387d82f..a5b5936e1a 100644 --- a/src/mip/HighsMipSolver.cpp +++ b/src/mip/HighsMipSolver.cpp @@ -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; } diff --git a/src/mip/HighsMipSolverData.cpp b/src/mip/HighsMipSolverData.cpp index 4de7b2a358..d6c9186dc2 100644 --- a/src/mip/HighsMipSolverData.cpp +++ b/src/mip/HighsMipSolverData.cpp @@ -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 @@ -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 @@ -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; @@ -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;