Skip to content

Commit 00acf9d

Browse files
committed
Always print clique strengthening message when it runs
Print a status message whether clique strengthening found changes or not, so the user knows it executed. Also track extended/dominated counts and timing in the applyLpMethod path.
1 parent de63402 commit 00acf9d

1 file changed

Lines changed: 24 additions & 5 deletions

File tree

src/CbcSolver.cpp

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,10 +1123,24 @@ int CbcSolver::applyLpMethod()
11231123
// then does a quick raw LP warm-start inside the function. The full
11241124
// configured LP solve happens in step 5 below.
11251125
if (clqstrMode_ == "before") {
1126+
double clqTime = CoinWallclockTime();
1127+
int clqExtended = 0, clqDominated = 0;
11261128
buildConflictGraphAndStrengthenCliques(solver, model_.messageHandler(),
1127-
clqstrMode_, 2, model_, mipStart_);
1129+
clqstrMode_, 2, model_, mipStart_, &clqExtended, &clqDominated);
1130+
clqTime = CoinWallclockTime() - clqTime;
11281131
statistics_.cgraph_time += solver->getCGraphBuildTime();
11291132
statistics_.cgraph_density = solver->getCGraphDensity();
1133+
statistics_.clqstr_extended = clqExtended;
1134+
statistics_.clqstr_dominated = clqDominated;
1135+
statistics_.clqstr_time = clqTime;
1136+
const int logLevel = model_.messageHandler()->logLevel();
1137+
if (logLevel >= 1) {
1138+
if (clqExtended || clqDominated)
1139+
printf(" Clique strengthening: %d extended, %d dominated (%.2fs)\n",
1140+
clqExtended, clqDominated, clqTime);
1141+
else
1142+
printf(" Clique strengthening: no changes (%.2fs)\n", clqTime);
1143+
}
11301144
}
11311145

11321146
// ─── 3. Model-level LP settings ──────────────────────────────────────────
@@ -5053,11 +5067,16 @@ int CbcSolver::solveInitialLp(
50535067
statistics.clqstr_extended = clqExtended;
50545068
statistics.clqstr_dominated = clqDominated;
50555069
statistics.clqstr_time = clqTime;
5056-
if (cbcLogLevel >= 1 && (clqExtended || clqDominated)) {
5070+
if (cbcLogLevel >= 1) {
50575071
char buf[256];
5058-
std::snprintf(buf, sizeof(buf),
5059-
" Clique strengthening: %d extended, %d dominated (%.2fs)",
5060-
clqExtended, clqDominated, clqTime);
5072+
if (clqExtended || clqDominated) {
5073+
std::snprintf(buf, sizeof(buf),
5074+
" Clique strengthening: %d extended, %d dominated (%.2fs)",
5075+
clqExtended, clqDominated, clqTime);
5076+
} else {
5077+
std::snprintf(buf, sizeof(buf),
5078+
" Clique strengthening: no changes (%.2fs)", clqTime);
5079+
}
50615080
printGeneralMessage(model_, buf);
50625081
}
50635082
}

0 commit comments

Comments
 (0)