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

supports AbstractConstraintAttribute broken for bridges #1572

Closed
odow opened this issue Sep 2, 2021 · 5 comments
Closed

supports AbstractConstraintAttribute broken for bridges #1572

odow opened this issue Sep 2, 2021 · 5 comments
Assignees
Labels
Submodule: Bridges About the Bridges submodule Type: Bug

Comments

@odow
Copy link
Member

odow commented Sep 2, 2021

HiGHS doesn't support ConstraintDualStart, so any bridged constraint shouldn't either. But yet:

julia> model = MOI.Bridges.full_bridge_optimizer(HiGHS.Optimizer(), Float64)
MOIB.LazyBridgeOptimizer{HiGHS.Optimizer}
with 0 variable bridges
with 0 constraint bridges
with 0 objective bridges
with inner model A HiGHS model with 0 columns and 0 rows.

julia> MOI.supports(model, MOI.ConstraintDualStart(), MOI.ConstraintIndex{MOI.VectorOfVariables,MOI.Nonnegatives})
true

julia> MOI.supports(model.model, MOI.ConstraintDualStart(), MOI.ConstraintIndex{MOI.VectorOfVariables,MOI.Nonnegatives})
false

Here's the offending code:

function MOI.supports(
b::AbstractBridgeOptimizer,
attr::MOI.AbstractConstraintAttribute,
IndexType::Type{MOI.ConstraintIndex{F,S}},
) where {F,S}
return reduce_bridged(
b,
F,
S,
true,
() -> MOI.supports(b.model, attr, IndexType),
ok -> ok && MOI.supports(b, attr, Variable.concrete_bridge_type(b, S)),
ok ->
ok &&
MOI.supports(b, attr, Constraint.concrete_bridge_type(b, F, S)),
)
end

It ends up calling

function MOI.supports(
::MOI.ModelLike,
::Union{MOI.ConstraintPrimalStart,MOI.ConstraintDualStart},
::Type{<:ScalarizeBridge},
)
return true
end

which is only true if the inner optimizer also supports it.

@odow odow added Submodule: Bridges About the Bridges submodule Type: Bug labels Sep 2, 2021
@blegat
Copy link
Member

blegat commented Sep 2, 2021

Here is the fix for a similar problem with the slack bridge #1383

@blegat blegat self-assigned this Sep 2, 2021
@odow
Copy link
Member Author

odow commented Sep 2, 2021

Yeah is it sufficient to just look at the inner optimizer? If so, why is #1383 still a draft?

@blegat
Copy link
Member

blegat commented Sep 2, 2021

Because it needs tests ^^

@odow
Copy link
Member Author

odow commented Sep 6, 2021

Closing because this is now fixed. The IndicatorSOS1Bridge PR is different.

@odow odow closed this as completed Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Submodule: Bridges About the Bridges submodule Type: Bug
Development

No branches or pull requests

2 participants