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

Fix when solver doesn't support objective #61

Closed
odow opened this issue Apr 11, 2023 · 5 comments
Closed

Fix when solver doesn't support objective #61

odow opened this issue Apr 11, 2023 · 5 comments

Comments

@odow
Copy link
Member

odow commented Apr 11, 2023

This example fails because HiGHS doesn't support VariableIndex objectives

using JuMP
import MultiObjectiveAlgorithms as MOA
import HiGHS
model = Model(() -> MOA.Optimizer(HiGHS.Optimizer))
set_silent(model)
set_attribute(model, MOA.Algorithm(), MOA.KirlikSayin())
@variable(model, x >= 0, Int)
@variable(model, y >= 0, Int)
@constraint(model, x + y >= 1)
@objective(model, Min, [x, y])
optimize!(model)
@odow
Copy link
Member Author

odow commented Apr 11, 2023

We're missing a bridge: jump-dev/MathOptInterface.jl#2139

@odow
Copy link
Member Author

odow commented Apr 12, 2023

#62 patched a fix. The real fix is to depend on the MOI bridge to do change the objective before it reaches MOA.

@mzy2240
Copy link

mzy2240 commented Apr 14, 2023

Might be a dumb question but do we support syntax like this?

@objective(model, Min, x)
@objective(model, Min, y)
optimize!(model)

@odow
Copy link
Member Author

odow commented Apr 15, 2023

Might be a dumb question but do we support syntax like this?

No. Calling @objective a second time replaces the current objective.

@odow
Copy link
Member Author

odow commented Apr 19, 2023

Closed by #63

@odow odow closed this as completed Apr 19, 2023
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

2 participants