I am using CVXOPT for linear programming according to the following example: http://abel.ee.ucla.edu/cvxopt/examples/tutorial/lp.html I am pretty sure I express a constraint that
X1 >= 0
But get a negative value for it. How come? I get the "optimal solution found" message
A = matrix( [ [0.0, 0.0, 1.0, 1.0, -0.0, -0.0, -1.0, -1.0, -1.0, 0.0, 0.0],
[0.0, 1.0, 1.0, 0.0, -0.0, -1.0, -1.0, -0.0, 0.0, -1.0, 0.0],
[1.0, 0.0, 0.0, 1.0, -1.0, -0.0, -0.0, -1.0, 0.0, 0.0, -1.0]
]
)
Constraint values (right hand side)
b = matrix( [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0] )
Minimizing function:
c = matrix( [-1.0, -1.0, -1.0] )
Calling:
sol=solvers.lp(c,A,b)
But:
print (sol['x']):
[-4.83e-09]
[ 1.00e+00]
[ 1.00e+00]
-4.83e-09>=0
False
Thanks