@@ -1120,6 +1120,11 @@ double HighsMipSolverData::transformNewIntegerFeasibleSolution(
11201120 }
11211121 }
11221122
1123+ const double transformed_solobj =
1124+ static_cast <double >(static_cast <HighsInt>(mipsolver.orig_model_ ->sense_ ) *
1125+ mipsolver_quad_objective_value -
1126+ mipsolver.model_ ->offset_ );
1127+
11231128 // Possible MIP solution callback
11241129 if (!mipsolver.submip && feasible && mipsolver.callback_ ->user_callback &&
11251130 mipsolver.callback_ ->active [kCallbackMipSolution ]) {
@@ -1130,6 +1135,12 @@ double HighsMipSolverData::transformNewIntegerFeasibleSolution(
11301135 assert (!interrupt);
11311136 }
11321137
1138+ // Catch the case where the repaired solution now has worse objective
1139+ // than the current stored solution
1140+ if (transformed_solobj >= upper_bound && !sol.empty ()) {
1141+ return transformed_solobj;
1142+ }
1143+
11331144 if (possibly_store_as_new_incumbent) {
11341145 // Store the solution as incumbent in the original space if there
11351146 // is no solution or if it is feasible
@@ -1171,11 +1182,9 @@ double HighsMipSolverData::transformNewIntegerFeasibleSolution(
11711182 return kHighsInf ;
11721183 }
11731184 }
1174- // return the objective value in the transformed space
1175- if (mipsolver.orig_model_ ->sense_ == ObjSense::kMaximize )
1176- return -double (mipsolver_quad_objective_value + mipsolver.model_ ->offset_ );
11771185
1178- return double (mipsolver_quad_objective_value - mipsolver.model_ ->offset_ );
1186+ // return the objective value in the transformed space
1187+ return transformed_solobj;
11791188}
11801189
11811190double HighsMipSolverData::percentageInactiveIntegers () const {
0 commit comments