Skip to content

Commit 69f9016

Browse files
committed
Skip scaling if already scaled. Add comments
1 parent 44f3fae commit 69f9016

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

highs/mip/HighsCutGeneration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1641,7 +1641,7 @@ bool HighsCutGeneration::preprocessSNFRelaxation() {
16411641
}
16421642

16431643
if (numContCols == 0) return false;
1644-
scale(maxAbsVal);
1644+
if (maxAbsVal > 1 + feastol || maxAbsVal < 0.5 - feastol) scale(maxAbsVal);
16451645

16461646
for (HighsInt i = 0; i != rowlen; ++i) {
16471647
HighsInt col = inds[i];

highs/mip/HighsTableauSeparator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ void HighsTableauSeparator::separateLpSolution(HighsLpRelaxation& lpRelaxation,
229229
baseRowInds.size());
230230

231231
double rhs = 0;
232-
cutGen.generateCut(transLp, baseRowInds, baseRowVals, rhs, false, cutpool.getNumCuts() - numCuts >= 20);
232+
cutGen.generateCut(transLp, baseRowInds, baseRowVals, rhs, false, false);
233233
if (mip.mipdata_->domain.infeasible()) break;
234234

235235
lpAggregator.getCurrentAggregation(baseRowInds, baseRowVals, true);
236236
rhs = 0;
237-
cutGen.generateCut(transLp, baseRowInds, baseRowVals, rhs, false, cutpool.getNumCuts() - numCuts >= 20);
237+
cutGen.generateCut(transLp, baseRowInds, baseRowVals, rhs, false, false);
238238
if (mip.mipdata_->domain.infeasible()) break;
239239

240240
lpAggregator.clear();

highs/mip/HighsTransformedLp.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,8 @@ bool HighsTransformedLp::transformSNFRelaxation(
902902
tmpSnfrRhs -= aggrconstant;
903903
break;
904904
case BoundType::kVariableLb:
905-
// vlb: l'_j x_j + d_j <= y_j. c_j is the coefficient of x_j in row
905+
// vlb: l'_j x_j + d_j <= y_j. c_j coef of x_j in row
906+
// if compl: -l'_j x_j + (l'_j + d_j) <= y_j. -c_j coef of x_j in row
906907
// Case (1) -> a_j > 0, y'_j -> N- Case (2) -> a_j < 0, y'_j ->N+
907908
// (1) y'_j = -(a_j(y_j - d_j) + c_j * x_j),
908909
// 0 <= y'_j <= -(a_j l'_j + c_j)x_j
@@ -932,11 +933,12 @@ bool HighsTransformedLp::transformSNFRelaxation(
932933
}
933934
tmpSnfrRhs -=
934935
aggrconstant +
935-
(complementvlb && inclbincolvlb ? vectorsum.getValue(vbcol) : 0);
936+
(complementvlb && inclbincolvlb ? -bincoef : 0);
936937
if (inclbincolvlb) vectorsum.values[vbcol] = 0;
937938
break;
938939
case BoundType::kVariableUb:
939-
// vub: y_j <= u'_j x_j + d_j. c_j is the coefficient of x_j in row
940+
// vub: y_j <= u'_j x_j + d_j. c_j coef of x_j in row
941+
// if compl: y_j <= -u'_j x_j + (u'_j + d_j). -c_j coef of x_j in row
940942
// Case (1) -> a_j > 0, y'_j -> N+ Case (2) -> a_j < 0, y'_j ->N-
941943
// (1) y'_j = a_j(y_j - d_j) + c_j * x_j),
942944
// 0 <= y'_j <= (a_j u'_j + c_j)x_j
@@ -966,7 +968,7 @@ bool HighsTransformedLp::transformSNFRelaxation(
966968
}
967969
tmpSnfrRhs -=
968970
aggrconstant +
969-
(complementvub && inclbincolvub ? vectorsum.getValue(vbcol) : 0);
971+
(complementvub && inclbincolvub ? -bincoef : 0);
970972
if (inclbincolvub) vectorsum.values[vbcol] = 0;
971973
break;
972974
}

0 commit comments

Comments
 (0)