Skip to content

Commit 4412a3d

Browse files
committed
Skip lifting if viol does not increase
1 parent b840f88 commit 4412a3d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

highs/mip/HighsCutGeneration.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,16 @@ bool HighsCutGeneration::separateLiftedFlowCover() {
576576
}
577577
ld.t++;
578578

579+
const HighsSolution& lpSolution = lpRelaxation.getLpSolver().getSolution();
580+
auto getLpSolution = [&](const HighsInt col) {
581+
HighsInt numCols = lpRelaxation.numCols();
582+
if (col < numCols) {
583+
return lpSolution.col_value[col];
584+
} else {
585+
return lpSolution.row_value[col - numCols];
586+
}
587+
};
588+
579589
auto getAlphaBeta = [&](double vubcoef) {
580590
HighsInt alpha;
581591
HighsCDouble beta{};
@@ -696,6 +706,14 @@ bool HighsCutGeneration::separateLiftedFlowCover() {
696706
assert(alphabeta.first == 0 || alphabeta.first == 1);
697707
if (alphabeta.first == 1) {
698708
assert(alphabeta.second > 0);
709+
// Do not lift the column if doing so decreases the violation
710+
double viol = snfr.aggrConstant[i];
711+
if (snfr.origContCols[i] != -1 && snfr.aggrContCoef[i] != 0) {
712+
viol += snfr.aggrContCoef[i] * getLpSolution(snfr.origContCols[i]);
713+
}
714+
viol += (snfr.aggrBinCoef[i] - static_cast<double>(alphabeta.second)) *
715+
(snfr.binSolval[i]);
716+
if (viol <= 0) continue;
699717
if (snfr.origContCols[i] != -1 && snfr.aggrContCoef[i] != 0) {
700718
vals[rowlen] = snfr.aggrContCoef[i];
701719
inds[rowlen] = snfr.origContCols[i];

0 commit comments

Comments
 (0)