Skip to content

CVXOPT solver equations handling #18572

@ptigwe

Description

@ptigwe
mannequin

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions