Skip to content

Commit 5d5b7b1

Browse files
authored
Merge pull request #2627 from fwesselm/singletonColStuffingDebugLog
Add debug logging
2 parents 40c3747 + bad72eb commit 5d5b7b1

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

highs/presolve/HPresolve.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ HPresolve::Result HPresolve::dominatedColumns(
11571157

11581158
// count number of fixed columns and modified bounds
11591159
HighsInt numFixedCols = 0;
1160-
HighsInt numBoundsModified = 0;
1160+
HighsInt numModifiedBounds = 0;
11611161

11621162
for (HighsInt j = 0; j < model->num_col_; ++j) {
11631163
// skip deleted columns
@@ -1257,7 +1257,7 @@ HPresolve::Result HPresolve::dominatedColumns(
12571257
if (lowerBound == model->col_upper_[col])
12581258
HPRESOLVE_CHECKED_CALL(fixCol(col, HighsInt{1}));
12591259
else if (model->integrality_[col] != HighsVarType::kContinuous) {
1260-
numBoundsModified++;
1260+
numModifiedBounds++;
12611261
changeColLower(col, lowerBound);
12621262
}
12631263
}
@@ -1267,7 +1267,7 @@ HPresolve::Result HPresolve::dominatedColumns(
12671267
if (upperBound == model->col_lower_[col])
12681268
HPRESOLVE_CHECKED_CALL(fixCol(col, HighsInt{-1}));
12691269
else if (model->integrality_[col] != HighsVarType::kContinuous) {
1270-
numBoundsModified++;
1270+
numModifiedBounds++;
12711271
changeColUpper(col, upperBound);
12721272
}
12731273
}
@@ -1398,11 +1398,11 @@ HPresolve::Result HPresolve::dominatedColumns(
13981398
mipsolver->mipdata_->cliquetable.numCliques(j, 1) > 0));
13991399
}
14001400

1401-
if (numFixedCols > 0 || numBoundsModified > 0)
1401+
if (numFixedCols > 0 || numModifiedBounds > 0)
14021402
highsLogDev(options->log_options, HighsLogType::kInfo,
14031403
"Fixed %d dominated columns and strengthened %d bounds\n",
14041404
static_cast<int>(numFixedCols),
1405-
static_cast<int>(numBoundsModified));
1405+
static_cast<int>(numModifiedBounds));
14061406

14071407
return Result::kOk;
14081408
}
@@ -4674,6 +4674,10 @@ HPresolve::Result HPresolve::singletonColStuffing(
46744674
// singleton column stuffing
46754675
// see Gamrath, G., Koch, T., Martin, A. et al., Progress in presolving
46764676
// for mixed integer programming, Math. Prog. Comp. 7, 367–398 (2015).
4677+
4678+
// count number of fixed columns
4679+
HighsInt numFixedCols = 0;
4680+
46774681
auto isContSingleton = [&](HighsInt col) {
46784682
return (!colDeleted[col] && colsize[col] == 1 &&
46794683
model->integrality_[col] != HighsVarType::kInteger &&
@@ -4765,12 +4769,14 @@ HPresolve::Result HPresolve::singletonColStuffing(
47654769
// check if variable can be fixed
47664770
if (sumUpperFinite &&
47674771
delta <= direction * rhs - sumUpper + primal_feastol) {
4772+
numFixedCols++;
47684773
if (multiplier < 0)
47694774
HPRESOLVE_CHECKED_CALL(fixColToLower(postsolve_stack, j));
47704775
else
47714776
HPRESOLVE_CHECKED_CALL(fixColToUpper(postsolve_stack, j));
47724777
} else if (sumLowerFinite &&
47734778
direction * rhs <= sumLower + primal_feastol) {
4779+
numFixedCols++;
47744780
if (multiplier < 0)
47754781
HPRESOLVE_CHECKED_CALL(fixColToUpper(postsolve_stack, j));
47764782
else
@@ -4797,6 +4803,11 @@ HPresolve::Result HPresolve::singletonColStuffing(
47974803
HPRESOLVE_CHECKED_CALL(checkRow(row, model->row_upper_[row], HighsInt{1}));
47984804
HPRESOLVE_CHECKED_CALL(checkRow(row, model->row_lower_[row], HighsInt{-1}));
47994805

4806+
if (numFixedCols > 0)
4807+
highsLogDev(options->log_options, HighsLogType::kInfo,
4808+
"Singleton column stuffing fixed %d columns",
4809+
static_cast<int>(numFixedCols));
4810+
48004811
return Result::kOk;
48014812
}
48024813

0 commit comments

Comments
 (0)