-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort indices while removing constraints to fix #3127 #3281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty reasonable. Thank you!
Two really minor updates to the test and I think this can be merged.
@jsiirola Thank you for the help! Changes are done and it should be good to go now. |
@mrmundt sorry for the delay, the black reformatting is done. You can kick off the workflow again. |
@kutlay - FYI, the pypy job will fail, but it's not your fault. |
We're waiting for Jenkins to run on this before merging. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3281 +/- ##
==========================================
+ Coverage 86.46% 88.46% +1.99%
==========================================
Files 801 867 +66
Lines 96758 98214 +1456
==========================================
+ Hits 83661 86883 +3222
+ Misses 13097 11331 -1766
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Fixes #3127
Summary/Motivation:
Issue 3127 showed that HiGHs solution was different when the same variable was fixed and unfixed. A solution should not change after fixing and unfixing the same variable. The issue showed the hint that HiGHs solver was expecting the deleted row indices to be sorted. This fix sorts the indices before sending it to the solver.
Unfortunately, HiGHs code doesn't explain why the indices supplied to deleteRows need to be sorted: https://github.com/ERGO-Code/HiGHS/blob/13363c9f1252b015cf6527132eb9cf8f4b5bf020/src/lp_data/Highs.cpp#L2871-L2883
However, the error message indicates that they need to be sorted, so I can't think of any problems sorting the indices in pyomo other than slight degradation in performance because of sorting.
Changes proposed in this PR:
Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: