Hello,
Is there a way to query if a solver supports indicator constraints? I’d like to write a function that produces a model that uses indicator constraints if they are supported and reverts to a big-M constraints if not given an optimizer.
Thanks.
Hey, welcome!
Check:
https://jump.dev/MathOptInterface.jl/stable/reference/constraints/#MathOptInterface.supports_constraint
If you try from JuMP, with SCIP solver, you can do:
using JuMP, SCIP
const MOI = MathOptInterface
model = Model(SCIP.Optimizer)
MOI.supports_constraint(
backend(model),
MOI.VectorAffineFunction{Float64},
MOI.IndicatorSet{
MOI.ACTIVATE_ON_ONE,
MOI.LessThan{Float64}})
2 Likes