Skip to content

supports_constraint can be wrong #2867

Closed

Description

@odow

x-ref #2865 (comment)

Check this out:

julia> import Ipopt; import MathOptInterface as MOI

julia> model = MOI.instantiate(Ipopt.Optimizer; with_bridge_type=Float64)
MOIB.LazyBridgeOptimizer{IpoptMOIExt.Optimizer}
├ Variable bridges: none
├ Constraint bridges: none
├ Objective bridges: none
└ model: IpoptMOIExt.Optimizer
  ├ ObjectiveSense: FEASIBILITY_SENSE
  ├ ObjectiveFunctionType: MOI.ScalarAffineFunction{Float64}
  ├ NumberOfVariables: 0
  └ NumberOfConstraints: 0

julia> MOI.supports_constraint(
           model,
           MOI.VectorOfVariables,
           MOI.Indicator{MOI.ACTIVATE_ON_ONE,MOI.EqualTo{Float64}},
       )
true

This is wrong, because it assumes that the variable will be binary, which is not part of the constraint.

Activity

  1. odow commented on Oct 8, 2025

    @odow
    MemberAuthor

    Maybe the IndicatorToMILPBridge should return true iff the model supports ZeroOne.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions