Announcing CVExp: A library for making linear programming easier

Discussion in 'Python' started by David Baird, Feb 18, 2009.

  1. David Baird

    David Baird Guest

    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
    David Baird, Feb 18, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. asj
    Replies:
    0
    Views:
    361
  2. Replies:
    1
    Views:
    1,092
    Roedy Green
    Nov 15, 2005
  3. Mark Hahn
    Replies:
    22
    Views:
    641
    Carlos Ribeiro
    Sep 9, 2004
  4. Kenneth McDonald
    Replies:
    1
    Views:
    281
    Skip Montanaro
    Jan 31, 2005
  5. ToddLMorgan
    Replies:
    17
    Views:
    467
    Lawrence D'Oliveiro
    Apr 27, 2006
Loading...

Share This Page