Personal tools
You are here: Home Examples Documentation Chapter 8 lp.py
Document Actions

lp.py

The small LP of section 8.3

# The small LP of section 8.3.  

from cvxopt.base import matrix
from cvxopt import solvers
c = matrix([-4., -5.])
G = matrix([[2., 1., -1., 0.], [1., 2., 0., -1.]])
h = matrix([3., 3., 0., 0.])
sol = solvers.lp(c, G, h)
print "\nx = \n\n", sol['x']
 

Powered by Plone CMS, the Open Source Content Management System