Fix dual flip after postsolve - #3248
Merged
Merged
Conversation
added 3 commits
August 31, 2026 15:37
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## latest #3248 +/- ##
==========================================
+ Coverage 73.16% 73.24% +0.07%
==========================================
Files 430 445 +15
Lines 103967 108107 +4140
Branches 16719 17325 +606
==========================================
+ Hits 76067 79182 +3115
- Misses 27624 28649 +1025
Partials 276 276 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fwesselm
approved these changes
Sep 1, 2026
| REQUIRE( | ||
| doubleEqual(solution.row_dual[iRow], h.getSolution().row_dual[iRow])); | ||
|
|
||
| REQUIRE(h.getModelStatus() == HighsModelStatus::kOptimal); |
Collaborator
There was a problem hiding this comment.
Is this duplicate check needed?
| return HighsPostsolveStatus::kNoPrimalSolutionError; | ||
| const bool have_dual_solution = | ||
| presolve_.data_.recovered_solution_.dual_valid; | ||
| const HighsInt report_3040_col = -578; |
Collaborator
There was a problem hiding this comment.
Not related to this branch, but should we keep this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When solving a maximization, the costs are flipped before presolve, so that presolve can assume minimization. However, after postsolve, the method to flip duals (
PresolveComponent::negateReducedLpColDuals()) was incorrect, and didn't flip row duals. This is only exposed after primal-dual postsolve, since the dual (and primal) values are recomputed after primal-dual-basis postsolve.There are other errors within primal-dual postsolve, but it's hard to work on them with this error!
Also corrected "successfull" to "successful" in
highs/ipm/hipo/ipm/Solver.cpp@filikatChecklist
latestbranch