question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ENH: linprog in SciPy 1.2+ discussion

See original GitHub issue

scipy.optimize.linprog method='simplex' is in much better shape after several bug fixes and adopting the pre/postprocessing routines originally written for interior-point (closed #5400, #6139, #6690, #7044, #7237, #8174, and #8662 via PRs #8909, #8958, #9081, #9096, #9145 - thanks @kai-striega!). Essentially all known linprog bugs have been fixed. Consequently, it’s time for some enhancements!

To kick things off, I’ve submitted PR #9263 to add method = 'revised simplex'. The refactoring in #9145 paved the way for all linprog methods to share pre/postprocessing code, making it very easy to work this new method into the framework.

The fun is far from over, however. I opened this issue to record improvement ideas.

  • use SuiteSparse in method = 'interior-point'when available
  • allow user-specified linear solver (see gh-11201) (not important anymore; HiGHS linear solver is Fine)
  • add sparse matrix support for method = 'revised simplex' (gh-12043 adds sparse simplex w/ HiGHS)
  • for method='revised simplex', improve routine for driving artificial variables out of the basis by calculating only the required entries of the B^-1 A matrix, and update the basis matrix factorization rather than re-calculating from scratch (gh-12043 adds improved simplex)
  • add an option to method = 'revised simplex' to perform the (revised) dual simplex method (and potentially include a heuristic for choosing between the two variants) (gh-12043 adds dual simplex)
  • implement the Forest-Tomlin update for method='revised simplex' basis matrix factorization (gh-12043 has simplex with more efficient basis matrix updates)
  • add a crossover routine (find basic feasible solution given a solution on the optimal face) for method = 'interior-point' (gh-12043 adds interior point with crossover)
  • Add a basis-crashing routine for ‘method=revised simplex (solvers added by gh-12043 will have basis crashing evetually)
  • include more sophisticated pivoting rules for method = 'revised simplex' (gh-12043 adds simplex with several pivoting rules)
  • allow user to provide initial primal- or dual-feasible solution to method = 'revised simplex'
  • add meaningful information about the dual of the original problem, especially for sensitivity analysis, to OptimizeResult produced for all methods (see gh-8836, gh-11848) (added marginals in gh-13893; still want ranging)
  • add meaningful information about the standard form problem to OptimizeResult - along with details about the relationship between the standard form problem and the original problem (I don’t think this is important anymore.)
  • add a routine for finding ALL basic optimal solutions to a given problem
  • add functionality to aid in sensitivity analysis and updates to the linear programming problem (e.g. adding a constraint or changing a cost). For instance, the OptimizeResult object returned by linprog could include a copy of the standard form problem, solution vector, and any other information (basis, dual variables, etc.) to allow for a warm or hot start
  • add tool for reading MPS files (I have code with nearly full functionality that could be cleaned up)
  • add callback support for method = 'interior-point'/'revised simplex'
  • improve the presolve routines: (HiGHS presolve is fine) - additional presolve techniques (see gh-9783), iterative resolve, sparse pivot-based redundancy removal, heuristics for pivot-based redundancy removal basis crashing, faster algorithm for redundancy removal (this would help), improve SVD method by removing multiple rows at a time when possible
  • add automatic scaling routine (see gh-10495)
  • add most Netlib benchmarks (see gh-10762)
  • add redundancy removal benchmarks (see gh-10762)
  • add support for integer constraints (I already have a fair amount of work done here that has been waiting for a reliable simplex solver, but there is quite a bit more to be done) (PR imminent)
  • batch linear programming (#11195)

Please let me know if you are interested in any of these ideas and I’d be happy to share additional information.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:26 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
mdhabercommented, Jan 8, 2022

Done. The important remaining items, colidated here for concision:

  • add tool for reading MPS files (see gh-14593)
  • add support for integer constraints (see mckib2/scipy#28, mckib2/scipy#31. SciPy PRs imminent.)
  • add more advanced interface for exploring the problem and changes to the problem (see gh-14455. If HiGHS makes this sort of thing possible, we’ll eventually add it.)
1reaction
mdhabercommented, Jul 14, 2019

Nice to meet you today, @melissawm!

Read more comments on GitHub >

github_iconTop Results From Across the Web

scipy.optimize.linprog — SciPy v1.2.3 Reference Guide
Minimize a linear objective function subject to linear equality and inequality constraints. Linear Programming is intended to solve the ...
Read more >
SciPy 1.0.0 Release Notes — SciPy v1.9.3 Manual
From initial discussions to efforts coding and packaging to documentation efforts ... #7123: ENH: added “interior-point” method for scipy.optimize.linprog.
Read more >
SciPy 1.9.0 Release Notes — SciPy v1.9.3 Manual
linprog is now 'highs' , not 'interior-point' (which is now deprecated), so callback functions and some options are no longer supported with the...
Read more >
SciPy 1.7.0 Release Notes — SciPy v1.9.3 Manual
When linprog is used with method 'highs' , 'highs-ipm' , or 'highs-ds' , the result object now ... #7437: ENH: add skewed Cauchy...
Read more >
SciPy 0.18.0 Release Notes — SciPy v1.9.3 Manual
This release requires Python 2.7 or 3.4-3.5 and NumPy 1.7.1 or greater. Highlights of this release include: A new ODE solver for two-point...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found