Announcing CVExp: A library for making linear programming easier
David Baird
dhbaird at gmail.com
Wed Feb 18 01:13:00 EST 2009
Here is the PyPI page:
http://pypi.python.org/pypi/cvexp/0.1
And here is the homepage:
http://www.aclevername.com/projects/cvexp/
CVExp currently supports solving linear, integer linear, and quadratic
optimization problems via lpsolve55, GLPK, and CVXOPT. There are
packages readily available in Debian and Ubuntu for python-glpk and
python-cvxopt, so installation is easy on these platforms:
apt-get install python-setuptools # for easy_install
apt-get install python-glpk python-cvxopt
easy_install cvexp
Here is a quick example of using CVExp+GLPK to solve a problem:
from cvexp.builders import var
from cvexp.builders import integer
from cvexp.builders import minimize
from cvexp.translate_glpk import solve
X = var('X') # the 'X' name is optional
Y = var('Y') # ...and so is 'Y'
sol = solve((
Y + 0.1 == X,
Y >= 9.8 - X,
integer(Y),
minimize(Y),
), out_filename='problem.out') # out_filename is optional
print 'X =', sol[X] # >>> 5.1
print 'Y =', sol[Y] # >>> 5
More information about the Python-list
mailing list