473,499 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Linear Programming on Ubuntu

I am trying to find a wrapper to do linear programming within python.
I am using an ubuntu machine and I have apt-get'd lp_solve, which
works just fine. If someone knows of a wrapper that will work with
that that'd be great.

I also heard that scipy has a wrapper, however, I can't find any
documentation on it, nor can I seem to find it with dir(). If anyone
knows where there is good documentation on this I would love to use
that (the more native to python the better imo).

I have tried many things, including http://lpsolve.sourceforge.net/5.5/Python.htm,
openopt, and cvxopt. I can't seem to find any with enough
documentation to get me off the ground. Some I can't compile, some I
can't even find out how to compile.

If anyone knows of an LP package (preferably with IP as well, like
lp_solve has), that interfaces well with python and has enough
documentation to get a dependency newb like myself off the ground that
would be great.
Sep 17 '08 #1
8 3253
On Sep 16, 8:50*pm, Fett <FettMan...@gmail.comwrote:
I am trying to find a wrapper to do linear programming within python.
I am using an ubuntu machine and I have apt-get'd lp_solve, which
works just fine. If someone knows of a wrapper that will work with
that that'd be great.

I also heard that scipy has a wrapper, however, I can't find any
documentation on it, nor can I seem to find it with dir(). If anyone
knows where there is good documentation on this I would love to use
that (the more native to python the better imo).

I have tried many things, includinghttp://lpsolve.sourceforge.net/5.5/Python.htm,
openopt, and cvxopt. I can't seem to find any with enough
documentation to get me off the ground. Some I can't compile, some I
can't even find out how to compile.

If anyone knows of an LP package (preferably with IP as well, like
lp_solve has), that interfaces well with python and has enough
documentation to get a dependency newb like myself off the ground that
would be great.
Google says:

about 254,000 for linear programming python.

Link 3 is:

http://wiki.python.org/moin/NumericA...ific/Libraries

Scroll down.
Sep 17 '08 #2
Fett wrote:
I am trying to find a wrapper to do linear programming within python.
I am using an ubuntu machine and I have apt-get'd lp_solve, which
works just fine. If someone knows of a wrapper that will work with
that that'd be great.

I also heard that scipy has a wrapper, however, I can't find any
documentation on it, nor can I seem to find it with dir(). If anyone
knows where there is good documentation on this I would love to use
that (the more native to python the better imo).
No, scipy doesn't have such a wrapper, sorry.
I have tried many things, including http://lpsolve.sourceforge.net/5.5/Python.htm,
openopt, and cvxopt. I can't seem to find any with enough
documentation to get me off the ground. Some I can't compile, some I
can't even find out how to compile.

If anyone knows of an LP package (preferably with IP as well, like
lp_solve has), that interfaces well with python and has enough
documentation to get a dependency newb like myself off the ground that
would be great.
PuLP should be fairly easy to build against GLPK or COIN (provided you have them
installed; I'm pretty sure Ubuntu has a GLPK package but I'm not sure about
COIN), but you will have to edit the Makefile for your system:

http://www.jeannot.org/~js/code/index.en.html#PuLP

You can ask on scipy-users about OpenOpt, and hopefully Dmitrey will be able to
help you. If you want to get cvxopt or the Python wrappers in lp_solve itself
working, I suggest asking their mailing lists.

--
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

Sep 17 '08 #3
On Sep 16, 9:00 pm, "Aaron \"Castironpi\" Brady"
<castiro...@gmail.comwrote:
On Sep 16, 8:50 pm, Fett <FettMan...@gmail.comwrote:
I am trying to find a wrapper to do linear programming within python.
I am using an ubuntu machine and I have apt-get'd lp_solve, which
works just fine. If someone knows of a wrapper that will work with
that that'd be great.
I also heard that scipy has a wrapper, however, I can't find any
documentation on it, nor can I seem to find it with dir(). If anyone
knows where there is good documentation on this I would love to use
that (the more native to python the better imo).
I have tried many things, includinghttp://lpsolve.sourceforge.net/5.5/Python.htm,
openopt, and cvxopt. I can't seem to find any with enough
documentation to get me off the ground. Some I can't compile, some I
can't even find out how to compile.
If anyone knows of an LP package (preferably with IP as well, like
lp_solve has), that interfaces well with python and has enough
documentation to get a dependency newb like myself off the ground that
would be great.

Google says:

about 254,000 for linear programming python.

Link 3 is:

http://wiki.python.org/moin/NumericA...ific/Libraries

Scroll down.
Yes, many of those seem to be deprecated, without destinations to
links, most are poorly or not documented at all. The few that are, I
still can't get running. Of those 254, I think I have tried at least
10 pages worth. Still no luck.

# lpsolvpy - Can't get it to compile - dependency problems.
# Lp_solve5 - NO python binding yet. Volunteers needed for python
bindings.
# pycplex - You need to compile the CPX.so module. Change the required
paths to CPLEX, Python and numpy in the Makefile, and type "make". Not
sure what to do here.
# GLPK (GNU Linear Programming Kit) - Hrm... might be something here,
I missed the second link to the python bindings, looked all over the
glpk site for anything about python.
# SciPy -- http://www.scipy.org - supposedly has this, but as I said,
I can't find any mention of it anywhere but on the site you linked.
# pySimplex - (broken link)(broken link)
# Simplex - link is broken, but nothing is mentioned

I'll take a closer look at glpk's python bindings and if there is any
documentation on them, maybe I'll have some luck. btw, I have been
looking for something that works, I have over 5 packages on my desktop
that I have tried to get up and running, but none of them seem to
work. glpk makes 6.
Sep 17 '08 #4
On Sep 16, 9:25*pm, Fett <FettMan...@gmail.comwrote:
On Sep 16, 9:00 pm, "Aaron \"Castironpi\" Brady"

<castiro...@gmail.comwrote:
On Sep 16, 8:50 pm, Fett <FettMan...@gmail.comwrote:
I am trying to find a wrapper to do linear programming within python.
I am using an ubuntu machine and I have apt-get'd lp_solve, which
works just fine. If someone knows of a wrapper that will work with
that that'd be great.
I also heard that scipy has a wrapper, however, I can't find any
documentation on it, nor can I seem to find it with dir(). If anyone
knows where there is good documentation on this I would love to use
that (the more native to python the better imo).
I have tried many things, includinghttp://lpsolve.sourceforge.net/5.5/Python.htm,
openopt, and cvxopt. I can't seem to find any with enough
documentation to get me off the ground. Some I can't compile, some I
can't even find out how to compile.
If anyone knows of an LP package (preferably with IP as well, like
lp_solve has), that interfaces well with python and has enough
documentation to get a dependency newb like myself off the ground that
would be great.
Google says:
about 254,000 for linear programming python.
Link 3 is:
http://wiki.python.org/moin/NumericA...ific/Libraries
Scroll down.

Yes, many of those seem to be deprecated, without destinations to
links, most are poorly or not documented at all. The few that are, I
still can't get running. Of those 254, I think I have tried at least
10 pages worth. Still no luck.

# lpsolvpy - Can't get it to compile - dependency problems.
# Lp_solve5 - NO python binding yet. Volunteers needed for python
bindings.
# pycplex - You need to compile the CPX.so module. Change the required
paths to CPLEX, Python and numpy in the Makefile, and type "make". Not
sure what to do here.
# GLPK (GNU Linear Programming Kit) - Hrm... might be something here,
I missed the second link to the python bindings, looked all over the
glpk site for anything about python.
# SciPy --http://www.scipy.org- supposedly has this, but as I said,
I can't find any mention of it anywhere but on the site you linked.
# pySimplex - (broken link)(broken link)
# Simplex - link is broken, but nothing is mentioned

I'll take a closer look at glpk's python bindings and if there is any
documentation on them, maybe I'll have some luck. btw, I have been
looking for something that works, I have over 5 packages on my desktop
that I have tried to get up and running, but none of them seem to
work. glpk makes 6.
If you can find one working in C, use ctypes to link into Python. We
can help you with that part. It lets you pass primitive types,
structs, arrays, pointers, to C modules and return values. You need
to know the C signatures to set up the Pythonized signatures.
Sep 17 '08 #5
On Sep 16, 9:44 pm, "Aaron \"Castironpi\" Brady"
<castiro...@gmail.comwrote:
On Sep 16, 9:25 pm, Fett <FettMan...@gmail.comwrote:
On Sep 16, 9:00 pm, "Aaron \"Castironpi\" Brady"
<castiro...@gmail.comwrote:
On Sep 16, 8:50 pm, Fett <FettMan...@gmail.comwrote:
I am trying to find a wrapper to do linear programming within python.
I am using an ubuntu machine and I have apt-get'd lp_solve, which
works just fine. If someone knows of a wrapper that will work with
that that'd be great.
I also heard that scipy has a wrapper, however, I can't find any
documentation on it, nor can I seem to find it with dir(). If anyone
knows where there is good documentation on this I would love to use
that (the more native to python the better imo).
I have tried many things, includinghttp://lpsolve.sourceforge.net/5.5/Python.htm,
openopt, and cvxopt. I can't seem to find any with enough
documentation to get me off the ground. Some I can't compile, some I
can't even find out how to compile.
If anyone knows of an LP package (preferably with IP as well, like
lp_solve has), that interfaces well with python and has enough
documentation to get a dependency newb like myself off the ground that
would be great.
Google says:
about 254,000 for linear programming python.
Link 3 is:
>http://wiki.python.org/moin/NumericA...ific/Libraries
Scroll down.
Yes, many of those seem to be deprecated, without destinations to
links, most are poorly or not documented at all. The few that are, I
still can't get running. Of those 254, I think I have tried at least
10 pages worth. Still no luck.
# lpsolvpy - Can't get it to compile - dependency problems.
# Lp_solve5 - NO python binding yet. Volunteers needed for python
bindings.
# pycplex - You need to compile the CPX.so module. Change the required
paths to CPLEX, Python and numpy in the Makefile, and type "make". Not
sure what to do here.
# GLPK (GNU Linear Programming Kit) - Hrm... might be something here,
I missed the second link to the python bindings, looked all over the
glpk site for anything about python.
# SciPy --http://www.scipy.org-supposedly has this, but as I said,
I can't find any mention of it anywhere but on the site you linked.
# pySimplex - (broken link)(broken link)
# Simplex - link is broken, but nothing is mentioned
I'll take a closer look at glpk's python bindings and if there is any
documentation on them, maybe I'll have some luck. btw, I have been
looking for something that works, I have over 5 packages on my desktop
that I have tried to get up and running, but none of them seem to
work. glpk makes 6.

If you can find one working in C, use ctypes to link into Python. We
can help you with that part. It lets you pass primitive types,
structs, arrays, pointers, to C modules and return values. You need
to know the C signatures to set up the Pythonized signatures.
Ok, it seems that I have found one (although without an integer
programming component): upon searching for glpk in the package manager
in ubuntu I found a package called cvxopt, it is a bit clunky
(compared to the niceness of lp_solve), but I think I can figure this
one out. Thanks all who answered.
Sep 17 '08 #6
CVXOPT supports ILP via GLPK or MOSEK. Documentation is in the doc-
strings
for cvxopt.glkp.ilp and cvxopt.mosek.ilp.

The ILP interfaces are not mentioned otherwise in the documentation,
as the main
focus of CVXOPT is convex solvers.

For additional questions on CVXOPT please use the discussion forum:
http://groups.google.com/group/cvxopt

best regards
Joachim

On Sep 17, 5:57*am, Fett <FettMan...@gmail.comwrote:
On Sep 16, 9:44 pm, "Aaron \"Castironpi\" Brady"

<castiro...@gmail.comwrote:
On Sep 16, 9:25 pm, Fett <FettMan...@gmail.comwrote:
On Sep 16, 9:00 pm, "Aaron \"Castironpi\" Brady"
<castiro...@gmail.comwrote:
On Sep 16, 8:50 pm, Fett <FettMan...@gmail.comwrote:
I am trying to find a wrapper to do linear programming within python.
I am using an ubuntu machine and I have apt-get'd lp_solve, which
works just fine. If someone knows of a wrapper that will work with
that that'd be great.
I also heard that scipy has a wrapper, however, I can't find any
documentation on it, nor can I seem to find it with dir(). If anyone
knows where there is good documentation on this I would love to use
that (the more native to python the better imo).
I have tried many things, includinghttp://lpsolve.sourceforge.net/5.5/Python.htm,
openopt, andcvxopt. I can't seem to find any with enough
documentation to get me off the ground. Some I can't compile, some I
can't even find out how to compile.
If anyone knows of an LP package (preferably with IP as well, like
lp_solve has), that interfaces well with python and has enough
documentation to get a dependency newb like myself off the groundthat
would be great.
Google says:
about 254,000 for linear programming python.
Link 3 is:
http://wiki.python.org/moin/NumericA...ific/Libraries
Scroll down.
Yes, many of those seem to be deprecated, without destinations to
links, most are poorly or not documented at all. The few that are, I
still can't get running. Of those 254, I think I have tried at least
10 pages worth. Still no luck.
# lpsolvpy - Can't get it to compile - dependency problems.
# Lp_solve5 - NO python binding yet. Volunteers needed for python
bindings.
# pycplex - You need to compile the CPX.so module. Change the required
paths to CPLEX, Python and numpy in the Makefile, and type "make". Not
sure what to do here.
# GLPK (GNU Linear Programming Kit) - Hrm... might be something here,
I missed the second link to the python bindings, looked all over the
glpk site for anything about python.
# SciPy --http://www.scipy.org-supposedlyhas this, but as I said,
I can't find any mention of it anywhere but on the site you linked.
# pySimplex - (broken link)(broken link)
# Simplex - link is broken, but nothing is mentioned
I'll take a closer look at glpk's python bindings and if there is any
documentation on them, maybe I'll have some luck. btw, I have been
looking for something that works, I have over 5 packages on my desktop
that I have tried to get up and running, but none of them seem to
work. glpk makes 6.
If you can find one working in C, use ctypes to link into Python. *We
can help you with that part. *It lets you pass primitive types,
structs, arrays, pointers, to C modules and return values. *You need
to know the C signatures to set up the Pythonized signatures.

Ok, it seems that I have found one (although without an integer
programming component): upon searching for glpk in the package manager
in ubuntu I found a package calledcvxopt, it is a bit clunky
(compared to the niceness of lp_solve), but I think I can figure this
one out. Thanks all who answered.
Sep 17 '08 #7
http://wiki.python.org/moin/NumericA...ific/Libraries

Scroll down.

Yes, many of those seem to be deprecated, without destinations to
links, most are poorly or not documented at all. The few that are, I
still can't get running. Of those 254, I think I have tried at least
10 pages worth. Still no luck.

# lpsolvpy - Can't get it to compile - dependency problems.
# Lp_solve5 - NO python binding yet. Volunteers needed for python
bindings.
# pycplex - You need to compile the CPX.so module. Change the required
paths to CPLEX, Python and numpy in the Makefile, and type "make". Not
sure what to do here.
# GLPK (GNU Linear Programming Kit) - Hrm... might be something here,
I missed the second link to the python bindings, looked all over the
glpk site for anything about python.
# SciPy -- http://www.scipy.org - supposedly has this, but as I said,
I can't find any mention of it anywhere but on the site you linked.
# pySimplex - (broken link)(broken link)
# Simplex - link is broken, but nothing is mentioned

I'll take a closer look at glpk's python bindings and if there is any
documentation on them, maybe I'll have some luck. btw, I have been
looking for something that works, I have over 5 packages on my desktop
that I have tried to get up and running, but none of them seem to
work. glpk makes 6.
You are right that this is an unsatisfying experience. Fortunately,
the referred site is a wiki. Why don't you edit it and delete the
broken
links or add the package that did the job for you to the list, so that
others do not need to go through the same hassle.

- harold -
Sep 17 '08 #8
On Tue, 16 Sep 2008 19:25:58 -0700 (PDT)
Fett <Fe********@gmail.comwrote:
# SciPy -- http://www.scipy.org - supposedly has this, but as I said,
I can't find any mention of it anywhere but on the site you linked.
I found OpenOpt on the site:
http://scipy.org/scipy/scikits/wiki/MILP

I downloaded the svn version and installed it on my Debian box.
There were some error messages while installing. However, the example
seems to work anyways. I am using the solver glpk from the
package python-glpk.

I hope that this works on your Ubuntu system as well.
Sep 17 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
5900
by: Hung Jung Lu | last post by:
Hi, I know people have talked about it before, but I am still really confused from reading the old messages. When I talk about code blocks, I am not talking about Lisp/Ruby/Perl, so I am not...
8
2465
by: Martin Maney | last post by:
Apologies if this isn't news here - I've been too busy this last week or so for even skimming the traffic here, in part because I've been messing around with Ubuntu's preview release on a spare...
12
3299
by: Claudio Grondi | last post by:
I have just discovered the existance of Puppy Linux which is a complete operating system with a suite of GUI apps, only about 50 - 60M booting directly off the CDROM ( http://www.puppylinux.org...
15
2192
by: UrsusMaximus | last post by:
While preparing a Python411 podcast about classes and OOP, my mind wondered far afield. I found myself constructing an extended metaphor or analogy between the way programs are organized and...
3
5990
by: jivelasquezt | last post by:
Hi all, I'm new to this group so I don't know if this question has been posted before, but does anyone knows about linear/integer programming routines in Python that are available on the web,...
0
1195
by: wesley chun | last post by:
Need to get up-to-speed with Python as quickly as possible? Come join me, Wesley Chun, author of Prentice-Hall's bestseller "Core Python Programming," for another comprehensive intro course plus a...
9
3046
by: Todd Whiteman | last post by:
I've put together a tutorial that shows off how to build a GUI application using XULRunner (same architectural components as Firefox uses) that can be used in conjunction with the Python...
0
1104
by: wesley chun | last post by:
*** FINAL REMINDER also, the course begins on monday immediately following the *free* CodeCamp conference http://siliconvalley-codecamp.com (click Program => Sessions to see all the talks)... 5...
20
2421
by: Mr.SpOOn | last post by:
Hi, I need a structure to represent a set of integers. I also need to perform on this set some basic set operations, such as adding or removing elements, joining with other sets and checking for...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7229
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5485
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4921
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
311
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.