-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
MAINT: Refactor _linprog.py
and _linprog_ip.py
to remove duplicate behaviour.
#8942
Comments
The ideas are great IMO and such refactoring should definitely be done before any new solver methods are added. However, I think that fixing #5400, #7237, #8174 are higher priority than refactoring. The bugs have really limited the simplex solver's utility, so I think they need to be addressed before refactoring and extensions like the presolver will be beneficial. After those are out of the way though, I do think we should come back to this. It sounds like @sschnug plans contribute a wrapper for HiGHS (see #8575), so there should be some coordination with that effort. Some questions about that before refactoring the existing methods independently:
Even if SciPy will get a fast, revised-simplex solver someday, it would be nice to have a more reliable simplex solver in the meantime, and there may be some benefit to having an all-python simplex solver after that. Would you be interested in taking a closer look at those, @Kai-Striega? |
I agree that fixing the bugs should take priority. From what I can see many of the errors are cause by numerical or conditioning issues within the simplex method. Some possible causes to look at:
|
If you see some code restructuring as the best way to resolve bugs or if you think it will help you find the bugs, go for it. Just thought that restructuring with the primary purpose being cleaner code or improving simplex performance (without fixing bugs) was premature. |
Closed with PR #9145 |
Agreed that this is closed. |
Problem
_linprog.py
solves linear programming problems, originally via the simplex method. An implementation of the interior-point method was later added via_linprog_ip.py
using the original_linprog.py
as the top-level interface. The simplex and interior-point implementations duplicate similar behaviour and arguments especially to:Further
_linprog_ip.py
implements the_presolve(...)
and_postprocess(...)
, which may also improve the simplex method.Proposed changes
I'm proposing to refactor
_linprog.py
and_linprog_ip.py
into three new files_linprog.py
,_linprog_ip.py
and_linprog_simplex.py
_linprog.py
to be the top level linear programming interface and handle behaviour common to all linear programming methods:_linprog_ip.py
and_linprog_simplex.py
to implement the specific methods.Benefits
_linprog_simplex(...)
by reusing_clean_inputs(...)
and_get_Abc(...)
from the interior point method.Would this be worth refactoring or are there any other suggestions? @rgommers @mdhaber
The text was updated successfully, but these errors were encountered: