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

Wrong objective bound in MIP with constant term #102

Closed
bfpc opened this issue Jul 7, 2019 · 0 comments · Fixed by #101
Closed

Wrong objective bound in MIP with constant term #102

bfpc opened this issue Jul 7, 2019 · 0 comments · Fixed by #101

Comments

@bfpc
Copy link

bfpc commented Jul 7, 2019

Consider the model

using JuMP
m = Model();
@variable(m, x >= 0, Int);
@objective(m, Min, x + 3);

The expected result would be "3.0, 3.0", but instead we get "6.0, 3.0"

using GLPK
JuMP.set_optimizer(m, with_optimizer(GLPK.Optimizer))
JuMP.optimize!(m)
println("GLPK  : ", JuMP.objective_bound(m), " ", JuMP.objective_value(m))

To problem seems to come from adding the constant term in the function LQOI.get_objective_bound(model::Optimizer), in MOI_wrapper.jl - maybe that was needed some time ago, but not anymore, as can be seen from the results below.

using LinQuadOptInterface
const LQOI = LinQuadOptInterface;

glpk_model = m.moi_backend.optimizer.model;
LQOI.get_objective_value(glpk_model)
LQOI.get_objective_bound(glpk_model)
LQOI.get_constant_objective(glpk_model)

GLPK.mip_status(glpk_model.inner) == GLPK.OPT
GLPK.mip_obj_val(glpk_model.inner)
glpk_model.objective_bound

I tested also Gurobi.jl, which indeed returns "3.0, 3.0"

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

Successfully merging a pull request may close this issue.

2 participants