Skip to content

Commit 7ca70f0

Browse files
committed
Add relative min eff. Stricter row size lims
1 parent 3e0df3c commit 7ca70f0

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

highs/mip/HighsCutGeneration.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ bool HighsCutGeneration::generateCut(HighsTransformedLp& transLp,
13981398
// try to generate a cut
13991399
if (!tryGenerateCut(
14001400
inds_, vals_, hasUnboundedInts, hasGeneralInts, hasContinuous,
1401-
std::max(flowCoverEfficacy - (10 * feastol), 10 * feastol),
1401+
std::max(0.9 * flowCoverEfficacy, 10 * feastol),
14021402
onlyInitialCMIRScale)) {
14031403
cmirSuccess = false;
14041404
goto postprocess;
@@ -1597,6 +1597,9 @@ bool HighsCutGeneration::preprocessSNFRelaxation() {
15971597
// 4. Don't consider any inequality with too many non-zeros
15981598
// 5. Don't consider any inequality with too few continuous cols
15991599

1600+
HighsInt maxLen = 100 + 0.05 * (lpRelaxation.numCols());
1601+
if (rowlen > maxLen) return false;
1602+
16001603
HighsInt numZeros = 0;
16011604
HighsInt numContCols = 0;
16021605
double maxact = -feastol;
@@ -1655,9 +1658,6 @@ bool HighsCutGeneration::preprocessSNFRelaxation() {
16551658
}
16561659
}
16571660

1658-
HighsInt maxLen = 100 + 0.15 * (lpRelaxation.numCols());
1659-
if (rowlen - numZeros > maxLen) return false;
1660-
16611661
if (numZeros != 0) {
16621662
// remove zeros in place
16631663
for (HighsInt i = rowlen - 1; i >= 0; --i) {
@@ -1689,10 +1689,8 @@ bool HighsCutGeneration::computeFlowCover() {
16891689
if (abs(snfr.vubCoef[i]) < feastol) {
16901690
snfr.flowCoverStatus[i] = -1;
16911691
nNonFlowCover++;
1692-
continue;
1693-
}
1694-
// x_i is fractional -> becomes an item in knapsack (decides if in cover)
1695-
if (fractionality(snfr.binSolval[i]) > feastol) {
1692+
} else if (fractionality(snfr.binSolval[i]) > feastol) {
1693+
// x_i is fractional -> becomes an item in knapsack (decides if in cover)
16961694
items[nitems] = i;
16971695
nitems++;
16981696
if (snfr.coef[i] == 1) {
@@ -1736,8 +1734,6 @@ bool HighsCutGeneration::computeFlowCover() {
17361734
double knapsackWeight = 0;
17371735
std::vector<double> weights(nitems);
17381736
std::vector<double> profitweightratios(nitems);
1739-
std::vector<HighsInt> perm(nitems);
1740-
std::iota(perm.begin(), perm.end(), 0);
17411737
for (HighsInt i = 0; i < nitems; ++i) {
17421738
weights[i] = snfr.vubCoef[items[i]];
17431739
if (snfr.coef[items[i]] == 1) {
@@ -1746,6 +1742,8 @@ bool HighsCutGeneration::computeFlowCover() {
17461742
profitweightratios[i] = snfr.binSolval[items[i]] / weights[i];
17471743
}
17481744
}
1745+
std::vector<HighsInt> perm(nitems);
1746+
std::iota(perm.begin(), perm.end(), 0);
17491747
pdqsort_branchless(perm.begin(), perm.end(),
17501748
[&](const HighsInt a, const HighsInt b) {
17511749
return profitweightratios[a] > profitweightratios[b];

highs/mip/HighsTransformedLp.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,11 @@ bool HighsTransformedLp::transformSNFRelaxation(
764764
double lb = getLb(col);
765765
double ub = getUb(col);
766766

767+
if (lb == -kHighsInf || ub == kHighsInf) {
768+
vectorsum.clear();
769+
return false;
770+
}
771+
767772
if (ub - lb < mip.options_mip_->small_matrix_value) {
768773
rhs -= std::min(lb, ub) * vals[i];
769774
tmpSnfrRhs -= std::min(lb, ub) * vals[i];
@@ -777,11 +782,6 @@ bool HighsTransformedLp::transformSNFRelaxation(
777782
continue;
778783
}
779784

780-
if (lb == -kHighsInf || ub == kHighsInf) {
781-
vectorsum.clear();
782-
return false;
783-
}
784-
785785
// the code below uses the difference between the column upper and lower
786786
// bounds as the upper bound for the slack from the variable upper bound
787787
// constraint (upper[j] = ub - lb) and thus assumes that the variable upper

0 commit comments

Comments
 (0)