I am trying to use the new way of SOS2 constraints (MOI.SOS2) but since I have a 3-dimensional variable (the last dimension should be part of the SOS2 set), existing examples are not sufficient. Any hints how to expand? Using the following code does not work
P = 10
Q = 5
for p = 1:P
@constraint(m, test[p] in MOI.SOS2(collect(1:Q)))
and results in the error: ERROR: In
@constraint(m, test[p] in MOI.SOS2(collect(1:Q))): unable to add the constraint because we don’t recognize test[1,1] as a valid JuMP function.
I would have expected that since in the example x[1:3] is referred to as x in the SOS2-constraint this would have been sufficient. I would not like to step into more inconvenient modeling approaches but think this should be straightforward and supported by MOI!
Thankful for all solutions!