-
Notifications
You must be signed in to change notification settings - Fork 87
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
[Bridges] add {SOS1,SOS2,Indicator}ToMILPBridge #2318
Conversation
So this is pretty breaking (to tests, not in practice) because it opens up IndicatorToSOS1 bridge. So I think we need to add an IndicatorToMILPBridge to fix it. |
Found a few bugs in jump-dev/HiGHS.jl#187, jump-dev/HiGHS.jl#188. |
Failures are:
|
It's pretty cool that stuff like this works now: using JuMP, HiGHS
xp = 0.0:0.1:pi
yp = sin.(xp)
n = length(xp)
model = Model(HiGHS.Optimizer)
@variable(model, 0 <= x <= π)
@variable(model, -1 <= y <= 1)
@variable(model, 0 <= λ[1:n] <= 1)
@variable(model, z, Bin)
@constraint(model, λ in SOS2())
@constraint(model, sum(λ) == 1)
@constraint(model, xp' * λ == x)
@constraint(model, yp' * λ == y)
@constraint(model, z --> {x <= 0.45})
@constraint(model, !z --> {x == y})
@objective(model, Max, x)
optimize!(model) This will let us use |
Yes, it's also helpful for teaching since then you can add complexity incrementally. The students can use indicator constraints without having learned the big-M formulation as requirement. |
Part of #2316
I'll need to run the solver-tests, because this should let HiGHS support SOS constraints, but it will probably also start supporting Indicator because of IndicatorToSOS, except that IndicatorToSOS introduces an unbounded variable in the SOS.
https://github.com/jump-dev/MathOptInterface.jl/actions/runs/6620504066