I’m trying to build a SOS1 constraint using JuMP MOI (with Gurobi, CPLEX, Mosek).
m = Model(with_optimizer(Mosek.Optimizer))
@variable(m, x[1:3])
@constraint(m, x in MOI.SOS1([1, 2, 3]))
But it gives me an error saying:
ERROR: LoadError: Constraints of type MathOptInterface.VectorOfVariables-in-MathOptInterface.SOS1{Int64} are not supported by the solver and there are no bridges that can reformulate it into supported constraints.
Stacktrace:
[1] moi_add_constraint(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}}, ::MathOptInterface.VectorOfVariables, ::MathOptInterface.SOS1{Int64}) at /Users/jipkim/.julia/packages/JuMP/jnmGG/src/constraints.jl:371
[2] add_constraint(::Model, ::VectorConstraint{VariableRef,MathOptInterface.SOS1{Int64},VectorShape}, ::String) at /Users/jipkim/.julia/packages/JuMP/jnmGG/src/constraints.jl:385
[3] top-level scope at /Users/jipkim/.julia/packages/JuMP/jnmGG/src/macros.jl:621
in expression starting at /Users/jipkim/Dropbox/Julia/Bilevel/SOStest.jl:7
Can anybody point me out how to handle this?