-
Notifications
You must be signed in to change notification settings - Fork 559
Get correct highs iteration count depending on method #3754
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
Conversation
Can you add a test that exercises one (or a couple) different solvers? |
solver = Highs() | ||
results = solver.solve(m) | ||
self.assertTrue(results.solution_status == SolutionStatus.optimal) | ||
self.assertTrue(results.iteration_count >= 0) |
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.
Shouldn't the iteration count be strictly greater than 0 in this case?
Okay, I was playing with the tests and changed the MIP demo to this: def test_mip_demo(self):
# Build MIP
from pyomo.core.tests.examples.pmedian_concrete import create_model
M = create_model()
solver = Highs()
results = solver.solve(M)
self.assertEqual(results.solution_status, SolutionStatus.optimal)
self.assertTrue(results.iteration_count > 0) Lo-and-behold, this causes an assertion error:
|
@mrmundt discovered an issue so this PR needs more work and will need a new review
Co-authored-by: John Siirola <[email protected]>
* Issue remains: on MIP, mip_node_count and another count will both be non-negative * In tests, turn presolve off so iteration_count > 0 * Minor fix to iteration_count selection and assert logic
I suggest the problem raised by @mrmundt should be addressed by removing mip_node_count from the list of considered counts. It's a count of nodes, not solver iterations in the sense of the other methods. If we want to report the MIP node count, perhaps there would be a separate field in the results class. Since during MIP solve the other counts are populated corresponding to the method used within nodes (by default simplex) the count selection logic holds. |
This PR opened up a whole side discussion. Talking with @bknueven (who happened to be sitting next to me), I think we came to the conclusion that we should argue for removing |
@AlexGisi - We talked about this in the dev call today, and it's going to require a mini-rework of all the different solvers to address iteration counts. I'm going to close this PR but will incorporate the changes from it into the new PR that we open to address the "bigger problem." |
Fixes and Summary/Motivation # .
In the highs solver interface, instead of always reporting the simplex iteration count, we should get the iteration count of the method that was used. See #3753.
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: