Skip to content

Presolve rules off - #3334

Merged
jajhall merged 22 commits into
latestfrom
presolve-rules-off
Sep 30, 2026
Merged

jajhall merged 22 commits into
latestfrom
presolve-rules-off

Conversation

@jajhall

@jajhall jajhall commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Description

The mechanism for setting presolve rules off has been simplified and clarified, with flags HPresolve::requires_basis_postsolve_ and HPresolve::requires_primal_dual_postsolve_ set internally, rather than the messy (user-settable!) option lp_presolve_requires_basis_postsolve that is now redundant (with its documentation line annotated as such.

When a basis postsolve is required, the sparsify rule is switched off, and when a primal-dual postsolve is required, the weakly-dominated column rule is switched off.

Although requires_primal_dual_postsolve_ is currently not used, it's expected to be useful as revision of presolve in the context of primal-dual postsolve continues.

The unnecessary ENABLE_SPARSIFY_FOR_LP macro has been removed, as it was only used temporarily when sparsify was being debugged

HPresolveInitialSweep has been cleaned up in the context of enabling each of the five rules that it uses to be switched off independently. This may be necessary for @filikat. The data member model_ has been renamed lp_ because (since presolve was written) the HighsModel class has been introduced. So, although it means a lot of trivial code changes, it's clearer.

Checklist

  • I have read the contributing guidelines
  • This PR targets the latest branch
  • Tests are passing
  • Documentation was updated where relevant
  • This PR is not primarily AI-generated (per the AI contributions policy in CONTRIBUTING.md)

@jajhall
jajhall requested a review from fwesselm September 29, 2026 00:07
@jajhall jajhall self-assigned this Sep 29, 2026
@jajhall jajhall added Enhancement New feature or request Presolve labels Sep 29, 2026
@filikat

filikat commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

I'm not sure if I'm reading this correctly.
If run_crossover=choose then requireBasicSolution returns true, but it's quite likely that crossover won't be run and primal-dual postsolve will be used.

@jajhall

jajhall commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

I'm not sure if I'm reading this correctly. If run_crossover=choose then requireBasicSolution returns true, but it's quite likely that crossover won't be run and primal-dual postsolve will be used.

Well spotted!

…n HPresolve cannot be definitive as both may be true. Rename requireBasicSolution accordingly
@jajhall

jajhall commented Sep 29, 2026 •

Copy link
Copy Markdown
Member Author

May have to perform either basis or primal-dual postsolve (according to whether crossover is run when run_crossover is "choose") so flags in HPresolve cannot be definitive as both may be true so are renamed may_require_basis_postsolve_ and may_require_primal_dual_postsolve_. Renamed requireBasicSolution accordingly as mayRequireBasisPostsolve and introduced mayRequirePrimalDualPostsolve

@fwesselm fwesselm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, @jajhall.

Comment thread highs/presolve/HPresolve.cpp Resolved
Comment thread check/TestPresolve.cpp Resolved
@jajhall
jajhall merged commit d2009d7 into latest Sep 30, 2026
550 of 556 checks passed
@jajhall
jajhall deleted the presolve-rules-off branch September 30, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Presolve

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants