-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bridge] implement special case for x != y in CountDistinctToMILPBridge #2416
Conversation
I don't know why you can't see the coverage: https://app.codecov.io/github/JuMP-dev/MathOptInterface.jl/pull/2416 |
@odow FWIW, thank you for looking into this! |
Can you provide a reformulation that would let us write this as a MILP (excluding indicator constraints) without knowing the bounds? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speaking of proofs, can you show the proof?
Are bounds inclusive or exclusive?
This doesn't quite proof for me: https://godbolt.org/z/3nEEdr1hj https://alive2.llvm.org/ce/z/tUeBwc
https://godbolt.org/z/Mc87q4cjf https://alive2.llvm.org/ce/z/otmnsE
I don't understand the relevance of the links. We're looking for a MILP reformulation of
where |
Link 1 shows the true variant of the constraint ( |
Ugh. I can't read or type. I typed |
Back when writing that comment, i didn't quite noticed that this was using yet another reformulation, It would be nice to either see either an exhaustive (correctness) test for this, or a non-manual proof. |
This hints at a much larger issue. We don't have any tools to check the correctness of JuMP models, and it is very easy (as just demonstrated) to make small mistakes. I'll open a JuMP issue. |
Closes #2405
This PR implements a much stronger reformulation for the special case of
[2, x ,y] in CountDistinct
which is created by[x, y] in AllDifferent(2)
, a.k.a.x != y
.