Skip to content

supports AbstractConstraintAttribute broken for bridges #1572

@odow

Description

@odow

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions