MathOptInterface.jl
MathOptInterface.jl copied to clipboard
RFC: Add Reified set
Closes #1805
I've implemented these in MiniZinc: https://github.com/jump-dev/MiniZinc.jl/pull/13, but I don't know if we should add to MOI.
They're a little harder to write MILP bridges for, and unlike Indicator, there isn't a range of solvers supporting a small number of constraint types (like Indicator{GreaterThan}
and Indicator{LessThan}
). Instead, it's pretty arbitrary what sets you can wrap in a Reified
.
@blegat can you take a look at this?
LGTM - pretty straightforward.
Okay. I've added a bridge from Reified{AllDifferent}
to Reified{CountDistinct}
and one from Reified{CountDistinct}
to MILP. I've also added a test for Reified{AlDifferent}
and verified that HiGHS passes the test with the new bridges.
I think that shows an avenue to making the MILP bridges work, even if the reformulations are a little more work.
I think I'm pretty happy with this, so I'll leave open for a few days if anyone wants to comment, otherwise I'll merge.