Skip to content

Commit 66a5be3

Browse files
committed
Improve decision for which bound changes to immediately apply
1 parent 0c7b7e4 commit 66a5be3

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

highs/mip/HighsImplications.cpp

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -831,22 +831,33 @@ void HighsImplications::cleanupVub(HighsInt col, HighsInt vubCol,
831831
}
832832

833833
void HighsImplications::applyImplications(HighsDomain& domain,
834-
const HighsInt col, const bool val) {
834+
const HighsInt col,
835+
const HighsInt val) {
835836
assert(domain.isFixed(col));
836837

837-
auto checkImplication = [&](HighsDomainChange& domchg) -> bool {
838+
auto checkImplication = [&](const HighsDomainChange& domchg) -> bool {
838839
assert(!domain.infeasible());
839840
if (domain.isFixed(domchg.column)) return false;
841+
const bool isint =
842+
domain.variableType(domchg.column) != HighsVarType::kContinuous;
843+
// Directly change bounds on all integer columns. Only change continuous
844+
// columns that fix the column, as changing their domains risks
845+
// suppressing further bound changes found in propagation, e.g.,
846+
// change [0, 100] -> [0, 50], propagation could tighten to [0, 48], but
847+
// such a tightening would not be applied due to min boundRange improvement.
840848
if (domchg.boundtype == HighsBoundType::kLower) {
841-
if (domchg.boundval >= domain.col_upper_[domchg.column]) {
842-
// TODO: Long term: Should there be an implication reason?
843-
HighsDomainChange domchgcpy = domchg;
844-
domain.changeBound(domchgcpy, HighsDomain::Reason::unspecified());
849+
if ((!isint && domchg.boundval >
850+
domain.col_upper_[domchg.column] - domain.feastol()) ||
851+
(isint && domchg.boundval >
852+
domain.col_lower_[domchg.column] + domain.feastol())) {
853+
domain.changeBound(domchg, HighsDomain::Reason::cliqueTable(col, val));
845854
}
846855
} else {
847-
if (domchg.boundval <= domain.col_lower_[domchg.column]) {
848-
HighsDomainChange domchgcpy = domchg;
849-
domain.changeBound(domchgcpy, HighsDomain::Reason::unspecified());
856+
if ((!isint && domchg.boundval <
857+
domain.col_lower_[domchg.column] + domain.feastol()) ||
858+
(isint && domchg.boundval <
859+
domain.col_upper_[domchg.column] - domain.feastol())) {
860+
domain.changeBound(domchg, HighsDomain::Reason::cliqueTable(col, val));
850861
}
851862
}
852863
return domain.infeasible();

highs/mip/HighsImplications.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class HighsImplications {
180180
HighsImplications::VarBound& vub, double ub, bool& redundant,
181181
bool& infeasible, bool allowBoundChanges = true) const;
182182

183-
void applyImplications(HighsDomain& domain, HighsInt col, bool val);
183+
void applyImplications(HighsDomain& domain, HighsInt col, HighsInt val);
184184
};
185185

186186
#endif

0 commit comments

Comments
 (0)