[SciPy-user] Need Help: Linear Programming

51 views
Skip to first unread message

Aditya Sethi

unread,
Dec 22, 2008, 12:10:09 AM12/22/08
to scipy...@scipy.org
Hi SciPy community:

I have recently started using SciPy and NumPy and have absolutely fallen in love with the vast libraries. It has made my job much easier using Interpolation and Linear Algrebra from the SciPy modules. Hopefully in the future, I can contribute to the SciPy community.

I have been stuck in finding a linear programming solver via the Simplex method or any other widely used method. I searched further and found OpenOpt in SciKits but am reluctant to use this as it is not under the control of the SciPy community.

But my friend assures me that sine SciPy has a lot more complex Non-linear programming solvers, there must be something for Linear Programming in there but I am not able to find it.

Any help will be greatly appreciated.

Thanks for your help..
Aditya Sethi

Robert Kern

unread,
Dec 22, 2008, 12:14:11 AM12/22/08
to SciPy Users List
On Sun, Dec 21, 2008 at 23:10, Aditya Sethi <ady....@gmail.com> wrote:
> Hi SciPy community:
>
> I have recently started using SciPy and NumPy and have absolutely fallen in
> love with the vast libraries. It has made my job much easier using
> Interpolation and Linear Algrebra from the SciPy modules. Hopefully in the
> future, I can contribute to the SciPy community.
>
> I have been stuck in finding a linear programming solver via the Simplex
> method or any other widely used method. I searched further and found OpenOpt
> in SciKits but am reluctant to use this as it is not under the control of
> the SciPy community.

You shouldn't be reluctant. It's a fine piece of software in its own
right. I don't think it actually has an LP solver inside it, though; I
believe it uses external solvers.

> But my friend assures me that sine SciPy has a lot more complex Non-linear
> programming solvers, there must be something for Linear Programming in there
> but I am not able to find it.

No, we have no LP solvers in scipy.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
_______________________________________________
SciPy-user mailing list
SciPy...@scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user

Hoyt Koepke

unread,
Dec 22, 2008, 12:29:14 AM12/22/08
to SciPy Users List
Hello Aditya,

If all you need is an LP solver, I have had a lot of luck with
lp_solve 5.5 (http://lpsolve.sourceforge.net/5.5/).. It's a mature
package that I use heavily in my research and it works very, very
well. It has a python wrapper, which isn't bad and is quite full
featured. For what I'm doing, though, I've written a (simpler) cython
interface that works directly with numpy arrays and is great to use in
conjunction with numpy/scipy. The documentation is currently rather
sparse, but if you're interested I'll work on that a bit and send it
to you. Note that it's LGPL, not BSD like numpy/scipy.

-- Hoyt

On Sun, Dec 21, 2008 at 9:10 PM, Aditya Sethi <ady.se


But my friend assures me that sine SciPy has a lot more complex
Non-linear programming solvers, there must be something for Linear
Programming in there but I am not able to find it.

> _______________________________________________
> SciPy-user mailing list
> SciPy...@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
>

--

++++++++++++++++++++++++++++++++++++++++++++++++
+ Hoyt Koepke
+ University of Washington Department of Statistics
+ http://www.stat.washington.edu/~hoytak/
+ hoy...@gmail.com
++++++++++++++++++++++++++++++++++++++++++

Robert Kern

unread,
Dec 22, 2008, 12:31:41 AM12/22/08
to SciPy Users List
On Sun, Dec 21, 2008 at 23:29, Hoyt Koepke <hoy...@cs.ubc.ca> wrote:
> Hello Aditya,
>
> If all you need is an LP solver, I have had a lot of luck with
> lp_solve 5.5 (http://lpsolve.sourceforge.net/5.5/).. It's a mature
> package that I use heavily in my research and it works very, very
> well. It has a python wrapper, which isn't bad and is quite full
> featured. For what I'm doing, though, I've written a (simpler) cython
> interface that works directly with numpy arrays and is great to use in
> conjunction with numpy/scipy. The documentation is currently rather
> sparse, but if you're interested I'll work on that a bit and send it
> to you. Note that it's LGPL, not BSD like numpy/scipy.

I'd love to see your Cython wrapper. Is it public somewhere?

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco

Aditya Sethi

unread,
Dec 22, 2008, 12:37:48 AM12/22/08
to SciPy Users List
I would try using lp_solve 5.5 and get back to you with the results.
And I would definitely love to see the cython wrapper myself.
Thanks for the prompt reply.

Aditya Sethi

unread,
Dec 22, 2008, 12:43:53 AM12/22/08
to SciPy Users List
Thanks Robert for the prompt reply.
I would use the LP Solver Hoyt mentioned and try the options in OpenOpt.
But it surprises me that there are a number of non-linear optimization solvers, but no LP Solvers. How come?
I am new to SciPy and hope you don't mind my questions which might seem naive to someone who has been involved in the development of SciPy.

Robert Kern

unread,
Dec 22, 2008, 12:51:16 AM12/22/08
to SciPy Users List
On Sun, Dec 21, 2008 at 23:43, Aditya Sethi <ady....@gmail.com> wrote:
> Thanks Robert for the prompt reply.
> I would use the LP Solver Hoyt mentioned and try the options in OpenOpt.
> But it surprises me that there are a number of non-linear optimization
> solvers, but no LP Solvers. How come?

LP solvers are much harder to write. Well, "good" implementations of
an LP solver are more complicated than "good" implementations of a
standard nonlinear local optimizer. The comparison isn't really
apples-to-apples, though. A good LP solver can have much higher
dimensionality than a good nonlinear optimizer will deal with. But
because of this, a typical LP *problem* will also have many more
dimensions, too.

nicky van foreest

unread,
Dec 22, 2008, 5:48:43 PM12/22/08
to SciPy Users List
Hi,

I use pulp.py as an interface to produce a file that can be read by
XPRESS (a commercial package) to solve my LP problems. Pulp can also
produce output for GLPK (which if free), CPLex, and, perhaps, symphony
(which is also free), but I did not try the latter. Pulp is, at least
for my purposes, really useful. it allows me to specify the cost
function and the constraint in an efficient and readable way.

bye

Nicky

2008/12/22 Robert Kern <rober...@gmail.com>:

Aditya Sethi

unread,
Dec 22, 2008, 11:31:21 PM12/22/08
to SciPy Users List
Hi Nick

I will try pulp.py. Sounds like it does what I need to do. I am currently using cvxopt and its working.
In addition I will be looking at Horst's cython files.
Thanks for your reply!! I will check out the differences bw pulp and cvxopt.

Aditya

nicky van foreest

unread,
Dec 23, 2008, 9:15:32 AM12/23/08
to SciPy Users List
Hi Aditya,

Please keep me informed. I had pulp working within a few minutes, even
though I am not a good python programmer. Hopefully it works for you
too.

bye

Nicky

2008/12/23 Aditya Sethi <ady....@gmail.com>:

Reply all
Reply to author
Forward
0 new messages