# Query optimizer support for indicator constraints

**URL:** <https://discourse.julialang.org/t/query-optimizer-support-for-indicator-constraints/66244>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [August 12, 2021, 2:50am UTC](https://discourse.julialang.org/t/query-optimizer-support-for-indicator-constraints/66244 "2021-08-12T02:50:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SupplyChef](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/supplychef/32/28082_2.png) [@SupplyChef](https://discourse.julialang.org/u/SupplyChef)\
**Post date:** [August 12, 2021, 2:50am UTC](https://discourse.julialang.org/t/query-optimizer-support-for-indicator-constraints/66244/1 "2021-08-12T02:50:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![joaquimg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joaquimg/32/223_2.png) [@joaquimg](https://discourse.julialang.org/u/joaquimg)\
**Post date:** [August 12, 2021, 3:39am UTC](https://discourse.julialang.org/t/query-optimizer-support-for-indicator-constraints/66244/2 "2021-08-12T03:39:30Z")

</div>

Hey, welcome!

Check:  
[https://jump.dev/MathOptInterface.jl/stable/reference/constraints/#MathOptInterface.supports\_constraint](https://jump.dev/MathOptInterface.jl/stable/reference/constraints/#MathOptInterface.supports_constraint)

If you try from JuMP, with SCIP solver, you can do:

```julia
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}})

```
