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

Re-Solving Model after (equivalently) reformulating Objective leads to different objective value #142

Open
phK3 opened this issue Jan 10, 2025 · 0 comments

Comments

@phK3
Copy link

phK3 commented Jan 10, 2025

To reproduce the error:

using JuMP, MosekTools, SCS

# setup the model and constraints
model = Model(Mosek.Optimizer)

@variable(model, P[1:5,1:5], PSD)

@constraint(model, diag(P[2:3, 2:3]) .- (-1. .+ 1) .* P[1,2:3] .+ (-1.) .* 1. .<= 0)
@constraint(model, P[1,1] .== 1.)

W = [1. 1; 1 -1]
@constraint(model, P[1,4:5] .>= 0.0)
@constraint(model, P[1,4:5] .>= W*P[1,2:3])
@constraint(model, diag(P[4:5,4:5] .- W*P[2:3,4:5]) .== 0);

# solve the original objective
c = [1.14, -4.5]
@objective(model, Max, c'*P[1,4:5])
optimize!(model)
objective_value(model)  # returns ~2.28

# reformulate objective
@variable(model, y[1:2])
@constraint(model, y .== P[1,4:5])

@objective(model, Max, c'*y)
optimize!(model)
objective_value(model)  # returns ~4.55 !!!

When using model = Model(SCS.Optimizer) instead, the objective value is ~2.28 both times.

I'm using Julia 1.11.1, JuMP v1.23.6, MosekTools v0.15.4 and SCS v2.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant