-
-
Notifications
You must be signed in to change notification settings - Fork 654
Open
Description
The CVXOPT
solver doesn't seem to be able to handle equations with ==
properly. For instance, the following example:
p = MixedIntegerLinearProgram(solver='CVXOPT', maximization=False)
x = p.new_variable(nonnegative=True)
y = p.new_variable(nonnegative=False)
p.add_constraint( 2 * x[0] + x[1] - y[0] <= 0)
p.add_constraint(x[0] + 3 * x[1] - y[0] <= 0)
p.add_constraint(x[0] + x[1] == 1)
p.set_objective(y[0])
p.solve()
p.get_values(x)
{0: 0.26990679350380004, 1: 0.1691067035243196}
The final result shouldn't be a feasible solution considering that x_0 + x_1 == 1
should hold. However substituting the final constraint for
p.add_constraint(1<=x[0] + x[1] <= 1)
works fine.
CC: @dimpase @nathanncohen @ingolfured
Component: linear programming
Keywords: CVXOPT
Issue created by migration from https://trac.sagemath.org/ticket/18572