Skip to content

Commit b3406f0

Browse files
authored
Merge pull request #2464 from ERGO-Code/fix-2439
Fix 2439 and 2455
2 parents 887dc08 + d661cb6 commit b3406f0

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

highs/mip/HighsDomain.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3215,7 +3215,10 @@ bool HighsDomain::ConflictSet::explainInfeasibility() {
32153215
HighsInt ninfmin;
32163216
HighsCDouble minAct;
32173217
globaldom.computeMinActivity(0, len, inds, vals, ninfmin, minAct);
3218-
assert(ninfmin == 0);
3218+
// This case should only happen when a globally unbounded column is
3219+
// bounded in the local domain, e.g., by a branching choice in some
3220+
// heuristic.
3221+
if (ninfmin > 0) return false;
32193222

32203223
return explainInfeasibilityLeq(inds, vals, len, rhs, double(minAct));
32213224
}

highs/mip/HighsMipSolverData.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

11811190
double HighsMipSolverData::percentageInactiveIntegers() const {

0 commit comments

Comments
 (0)