| 829 | } |
| 830 | |
| 831 | void HighsMipSolverData::runSetup() { |
| 832 | const HighsLp& model = *mipsolver.model_; |
| 833 | |
| 834 | // Indicate that the first LP has not been solved |
| 835 | this->getLp().setSolvedFirstLp(false); |
| 836 | |
| 837 | last_disptime = -kHighsInf; |
| 838 | disptime = 0; |
| 839 | |
| 840 | // Transform the reference of the objective limit and lower/upper |
| 841 | // bounds from the original model to the current model, undoing the |
| 842 | // transformation done before restart so that the offset change due |
| 843 | // to presolve is incorporated. Bound changes are transitory, so no |
| 844 | // real gap change, and no update to P-D integral is necessary |
| 845 | upper_limit -= mipsolver.model_->offset_; |
| 846 | optimality_limit -= mipsolver.model_->offset_; |
| 847 | |
| 848 | lower_bound -= mipsolver.model_->offset_; |
| 849 | upper_bound -= mipsolver.model_->offset_; |
| 850 | |
| 851 | if (mipsolver.solution_objective_ != kHighsInf) { |
| 852 | // Assigning new incumbent |
| 853 | incumbent = postSolveStack.getReducedPrimalSolution(mipsolver.solution_); |
| 854 | // return the objective value in the transformed space |
| 855 | double solobj = |
| 856 | mipsolver.solution_objective_ * (int)mipsolver.orig_model_->sense_ - |
| 857 | mipsolver.model_->offset_; |
| 858 | bool feasible = mipsolver.bound_violation_ <= |
| 859 | mipsolver.options_mip_->mip_feasibility_tolerance && |
| 860 | mipsolver.integrality_violation_ <= |
| 861 | mipsolver.options_mip_->mip_feasibility_tolerance && |
| 862 | mipsolver.row_violation_ <= |
| 863 | mipsolver.options_mip_->mip_feasibility_tolerance; |
| 864 | if (numRestarts == 0) { |
| 865 | highsLogUser(mipsolver.options_mip_->log_options, HighsLogType::kInfo, |
| 866 | "\nMIP start solution is %s, objective value is %.12g\n", |
| 867 | feasible ? "feasible" : "infeasible", |
| 868 | mipsolver.solution_objective_); |
| 869 | } |
| 870 | if (feasible && solobj < upper_bound) { |
| 871 | double prev_upper_bound = upper_bound; |
| 872 | |
| 873 | upper_bound = solobj; |
| 874 | |
| 875 | bool bound_change = upper_bound != prev_upper_bound; |
| 876 | if (!mipsolver.submip && bound_change) |
| 877 | updatePrimalDualIntegral(lower_bound, lower_bound, prev_upper_bound, |
| 878 | upper_bound); |
| 879 | |
| 880 | double new_upper_limit = computeNewUpperLimit(solobj, 0.0, 0.0); |
| 881 | |
| 882 | saveReportMipSolution(new_upper_limit); |
| 883 | if (new_upper_limit < upper_limit) { |
| 884 | upper_limit = new_upper_limit; |
| 885 | optimality_limit = |
| 886 | computeNewUpperLimit(solobj, mipsolver.options_mip_->mip_abs_gap, |
| 887 | mipsolver.options_mip_->mip_rel_gap); |
| 888 | nodequeue.setOptimalityLimit(optimality_limit); |
no test coverage detected