Open pulsipher opened 10 months ago
Can you illustrate what you mean with having logical expressions as the arguments? Is this to avoid defining a Boolean variable for the logical expression and using that Boolean in the cardinality constraint?
Can you illustrate what you mean with having logical expressions as the arguments? Is this to avoid defining a Boolean variable for the logical expression and using that Boolean in the cardinality constraint?
Yes, this could potentially avoid adding unnecessary Boolean variables. Instead of
model = GDPModel()
@variable(model, y[1:2], Logical)
@variable(model, w, Logical)
@constraint(model, w == y[1] ⟹ y[2] := true)
@constraint(model, [w, y[1]] in AtMost(1))
we could do
model = GDPModel()
@variable(model, y[1:2], Logical)
@constraint(model, [y[1] ⟹ y[2], y[1]] in AtMost(1))
Of course, I know reformulating this might lead to extra Boolean variables anyways, but this is certainty a lot more convenient/concise for the user.
Currently, we only cardinality constraints on logical variables. It would be nice to allow arguments to be logical expressions as well.