Skip to content

Comments

Extension of dual fixing for single equations#2869

Open
fwesselm wants to merge 28 commits intoERGO-Code:latestfrom
fwesselm:dualFixingExtension3
Open

Extension of dual fixing for single equations#2869
fwesselm wants to merge 28 commits intoERGO-Code:latestfrom
fwesselm:dualFixingExtension3

Conversation

@fwesselm
Copy link
Collaborator

  • Following a discussion in Potential overhead reduction for dual fixing #2773, I am proposing to extend HPresolve::dualFixing to handle single equations (as described by Achterberg et al., Presolve Reductions in Mixed Integer Programming, see section 6.1).
  • My test runs showed that the extension is not very effective (ratios of shifted geometric means of running times and numbers of nodes are very close to 1.0). However, the extension is relatively cheap, so I would be in favor of adding it anyway.
  • I also modified HPresolve::enumerateSolutions to compute the overlap coefficient when comparing two sets of binary variables.

@fwesselm fwesselm requested a review from Opt-Mucca February 24, 2026 12:30
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 98.98990% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.39%. Comparing base (1df4aa5) to head (35c5bf6).
⚠️ Report is 18 commits behind head on latest.

Files with missing lines Patch % Lines
highs/presolve/HPresolve.cpp 98.98% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #2869      +/-   ##
==========================================
+ Coverage   80.35%   80.39%   +0.04%     
==========================================
  Files         348      348              
  Lines       86522    86675     +153     
==========================================
+ Hits        69527    69685     +158     
+ Misses      16995    16990       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@Opt-Mucca Opt-Mucca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good! I've got the one open question and if that's simply me being paranoid then this should be good to merge.

bool backtrack = domain.infeasible();
if (!backtrack) {
backtrack = solutionFound(numVars);
backtrack = findBranchVar(numVars) < 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice spot on duplicate code!

// Programming, INFORMS Journal on Computing 32(2):473-506.
HPRESOLVE_CHECKED_CALL(handleSingleEquation(equationRow));
if (colDeleted[col]) return Result::kOk;
} else if (mipsolver != nullptr && model->col_lower_[col] != -kHighsInf &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick sanity check: Is there a solution path where the single equation would not fix any cols, e.g. due to infinite activities, and we are now skipping the substitution that we could have done in the original code?

Copy link
Collaborator Author

@fwesselm fwesselm Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To substitute the variable, we need to find a binary variable that, when set to zero, makes the row redundant. As far as I understand, setting a single binary variable to zero will not make an equation redundant. Therefore, to answer your question, the code should fail in finding a substitution in an equation anyway.

@Opt-Mucca
Copy link
Collaborator

FYI (in case notifications for non-direct tags are turned off) @ZhaoWeiWang0319

@fwesselm
Copy link
Collaborator Author

Code looks good! I've got the one open question and if that's simply me being paranoid then this should be good to merge.

Thank you, @Opt-Mucca!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants