Skip to content

Commit 9d6291b

Browse files
committed
Add missing milp changes
1 parent 74be9c7 commit 9d6291b

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

highs/mip/HighsMipWorker.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ double HighsMipWorker::transformNewIntegerFeasibleSolution(
237237
}
238238
}
239239

240+
const double transformed_solobj =
241+
static_cast<double>(static_cast<HighsInt>(mipsolver_.orig_model_->sense_) *
242+
mipsolver_quad_objective_value -
243+
mipsolver_.model_->offset_);
244+
240245
// todo:
241246
// Possible MIP solution callback
242247
// if (!mipsolver.submip && feasible && mipsolver.callback_->user_callback &&
@@ -249,6 +254,12 @@ double HighsMipWorker::transformNewIntegerFeasibleSolution(
249254
// assert(!interrupt);
250255
// }
251256

257+
// Catch the case where the repaired solution now has worse objective
258+
// than the current stored solution
259+
if (transformed_solobj >= upper_bound && !sol.empty()) {
260+
return transformed_solobj;
261+
}
262+
252263
if (possibly_store_as_new_incumbent) {
253264
// Store the solution as incumbent in the original space if there
254265
// is no solution or if it is feasible
@@ -294,8 +305,5 @@ double HighsMipWorker::transformNewIntegerFeasibleSolution(
294305
}
295306
}
296307
// return the objective value in the transformed space
297-
if (mipsolver_.orig_model_->sense_ == ObjSense::kMaximize)
298-
return -double(mipsolver_quad_objective_value + mipsolver_.model_->offset_);
299-
300-
return double(mipsolver_quad_objective_value - mipsolver_.model_->offset_);
308+
return transformed_solobj;
301309
}

highs/mip/HighsSearch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ HighsInt HighsSearch::selectBranchingCandidate(int64_t maxSbIters,
678678
if (orbitalFixing)
679679
nodestack.back().stabilizerOrbits->orbitalFixing(localdom);
680680
else
681-
getSymmetries();
681+
getSymmetries().propagateOrbitopes(localdom);
682682
}
683683

684684
inferences += localdom.getDomainChangeStack().size();

0 commit comments

Comments
 (0)