MathOptInterface.jl icon indicating copy to clipboard operation
MathOptInterface.jl copied to clipboard

RFC: Add Reified set

Open odow opened this issue 1 year ago • 1 comments

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.

odow avatar Jul 20 '22 02:07 odow

@blegat can you take a look at this?

odow avatar Aug 14 '22 21:08 odow

LGTM - pretty straightforward.

chriscoey avatar Aug 16 '22 16:08 chriscoey

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.

odow avatar Aug 22 '22 04:08 odow

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.

odow avatar Aug 23 '22 02:08 odow