MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / applyConflictGraphSubstitutions

Method applyConflictGraphSubstitutions

highs/presolve/HPresolve.cpp:2488–2541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2486}
2487
2488HPresolve::Result HPresolve::applyConflictGraphSubstitutions(
2489 HighsPostsolveStack& postsolve_stack, HighsInt& numDelCol) {
2490 HighsCliqueTable& cliquetable = mipsolver->mipdata_->cliquetable;
2491 HighsImplications& implications = mipsolver->mipdata_->implications;
2492 for (const auto& substitution : implications.substitutions) {
2493 if (colDeleted[substitution.substcol] || colDeleted[substitution.staycol])
2494 continue;
2495
2496 ++numDelCol;
2497
2498 postsolve_stack.doubletonEquation(
2499 -1, substitution.substcol, substitution.staycol, 1.0,
2500 -substitution.scale, substitution.offset,
2501 model->col_lower_[substitution.substcol],
2502 model->col_upper_[substitution.substcol], 0.0, false, false,
2503 HighsPostsolveStack::RowType::kEq, HighsEmptySlice());
2504 markColDeleted(substitution.substcol);
2505 substitute(substitution.substcol, substitution.staycol, substitution.offset,
2506 substitution.scale);
2507 HPRESOLVE_CHECKED_CALL(checkLimits(postsolve_stack));
2508 }
2509
2510 implications.substitutions.clear();
2511
2512 for (HighsCliqueTable::Substitution subst : cliquetable.getSubstitutions()) {
2513 if (colDeleted[subst.substcol] || colDeleted[subst.replace.col]) continue;
2514
2515 double scale;
2516 double offset;
2517
2518 ++numDelCol;
2519
2520 if (subst.replace.val == 0) {
2521 scale = -1.0;
2522 offset = 1.0;
2523 } else {
2524 scale = 1.0;
2525 offset = 0.0;
2526 }
2527
2528 postsolve_stack.doubletonEquation(
2529 -1, subst.substcol, subst.replace.col, 1.0, -scale, offset,
2530 model->col_lower_[subst.substcol], model->col_upper_[subst.substcol],
2531 0.0, false, false, HighsPostsolveStack::RowType::kEq,
2532 HighsEmptySlice());
2533 markColDeleted(subst.substcol);
2534 substitute(subst.substcol, subst.replace.col, offset, scale);
2535 HPRESOLVE_CHECKED_CALL(checkLimits(postsolve_stack));
2536 }
2537
2538 cliquetable.getSubstitutions().clear();
2539
2540 return Result::kOk;
2541}
2542
2543void HPresolve::getRowPositions(HighsInt row,
2544 std::vector<HighsInt>& myrowpositions) const {

Callers

nothing calls this directly

Calls 3

HighsEmptySliceClass · 0.85
doubletonEquationMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected