Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual infeasibility returned for feasible problem with box constraints #90

Open
migarstka opened this issue Aug 30, 2019 · 0 comments
Open
Labels
bug Something isn't working

Comments

@migarstka
Copy link
Member

migarstka commented Aug 30, 2019

I stumbled upon this problem from the MathOptInterface testset

 maximize x + y
 s.t.  2 <= x + y <= 12
          x,  y >= 0

When solved with a box constraint, COSMO returns dual infeasible, which is wrong.

using COSMO, SparseArrays, LinearAlgebra

q = [-1; -1.]
P = spzeros(2, 2)

# x,  y >= 0
nn_constraint = COSMO.Constraint(Matrix(1.0I, 2, 2), zeros(2), COSMO.Nonnegatives)

# 2 <= x + y <= 12
box_constraint = COSMO.Constraint([1. 1], zeros(1), COSMO.Box([2.], [12.]))

cs = [nn_constraint; box_constraint]
settings = COSMO.Settings(verbose=true, eps_abs = 1e-5, eps_rel = 1e-5, check_termination = 25, check_infeasibility = 25)

model = COSMO.Model()
assemble!(model, P, q, cs, settings = settings)
res = COSMO.optimize!(model);

However, when implemented with one-sided constraints COSMO solves the problem.

nn_instead_of_box = COSMO.Constraint([1. 1.; -1. -1], [2; 12], COSMO.Nonnegatives)
cs = [nn_constraint; nn_instead_of_box]

model = COSMO.Model()
assemble!(model, P, q, cs, settings = settings)
res = COSMO.optimize!(model);

I think this is probably an issue with in_pol_recc() for COSMO.Box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant