Pure-Python implementation of linear programming simplex method #218

wants to merge 2 commits into


None yet
5 participants

pv commented May 19, 2012

Rescued and polished up a bit from http://projects.scipy.org/scipy/ticket/1252

There are some comments on the Trac --- Dmitrey criticizes the performance, and then there's a second comment on the algorithm failing on deficit rank matrices. So, I'm not sure exactly what to do with this, but here's at least a PR.

A pure Python implementation of the simplex method (LP, NOT Nelder-Mead)

While slower than compiled implementations such as GLPK, the submitted code is easy to integrate in Scipy and comes under a MIT license. It uses the two-phase simplex method to find the array x that minimizes dot(c,x) subject to dot(A,x) = b.


pv commented May 20, 2012

One comment at least: the name of the function should not be lp_solve, but something more specific.

+# -----------------------------------------------------------------------------
+from numpy import *

dlax May 24, 2012


import numpy (as np) ?


rgommers commented Sep 22, 2013

Given the comments it looks like this can't be merged as is. So shall we close it for now?

Whether we want this algorithm at all is a bit unclear. Maybe only if someone writes a set of linear programming routines (sparse.csgraph style)?


pv commented Sep 22, 2013

I think this sort of solvers belong to scipy.optimize as it's a well-defined optimization problem.

What would be needed here is an expert to take a look; I'm not able to judge at the moment whether this is good enough to be included as it is.

@pv pv closed this Sep 22, 2013


rgommers commented Sep 22, 2013

I agree in principle, what I meant is that this is a fairly large topic with a number of basic algorithms (see wikipedia page for example), so it may not make sense to have just one algorithm that does linear programming.

Tritlo commented Jan 21, 2014

I'm probably not qualified at all to be talking about this, and I don't know how the scipy admission process it, but I'm currently taking a university course on linear programming, and the Simplex algorithm is the one that is used the most (and is the basis for a many of the other algorithms). I don't know, but is it not better to have a algorithm instead of none?

To quote Wikipedia on the subject:
"The current opinion is that the efficiency of good implementations of simplex-based methods and interior point methods are similar for routine applications of linear programming".


pv commented Jan 22, 2014

In this case there are also open questions about the correctness of the implementation, as it appears to fail for some problems --- see gh-1779. With nobody working on this (I simply do not have the time to do everything), the PR was closed.

If you want to take a look, further comments would be useful.

argriffing pushed a commit to argriffing/scipy that referenced this pull request May 2, 2014


argriffing commented May 2, 2014

There are some comments on the Trac --- Dmitrey criticizes the performance,
and then there's a second comment on the algorithm failing on deficit rank matrices.

I can't seem to find these comments. Could someone please paste them into a github comment here if possible? I tried looking at http://projects.scipy.org/scipy/ticket/1252 but this link seems to just redirect to the scipy github issues page.

Edit: Never mind, I see that Dmitrey's comment is #1779 (comment) and the second comment is #1779 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment