-
Notifications
You must be signed in to change notification settings - Fork 3
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
Do Not Merge Yet: Add MOI Disjunction Set Reformulation #71
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: David Bernal <[email protected]>
As an update, it seems MOI bridges will likely not work with disjunctions. The problem is that each disjunct can contain an arbitrary number of constraints of any type (including other disjunctions). For a bridge to work, MOI needs to be able to infer want reformulation constraints will be constructed based on the set type. With: struct DisjunctionSet{S <: _MOI.AbstractSet} <: _MOI.AbstractVectorSet
dimension::Int
disjunct_indices::Vector{Int}
constraint_sets::Vector{Vector{S}}
end we will most often end up with something like struct DisjunctionSet{T <: Tuple} <: _MOI.AbstractVectorSet
dimension::Int
disjunct_indices::Vector{Int}
constraint_sets::T # flatten everything into a tuple
end Now So, in the end, it is possible to represent disjunctions in MOI, but bridges won't be practical to implement. However, solvers (e.g., ToQUBO.jl) can still support |
After talking offline with @hdavid16, another option to is add a canonicalized disjunction set where all the constraints are converted to inequalities first: struct DisjunctionSet{T <: Real} <: _MOI.AbstractVectorSet
dimension::Int
disjunct_indices::Vector{Int}
constraint_sets::Vector{Vector{MOI.LessThan{T}}}
end This would require more processing upfront, change the structure, and potentially exclude some constraint types (e.g., cones), but this would be easy to implement a bridge for. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #71 +/- ##
==========================================
- Coverage 98.91% 96.19% -2.72%
==========================================
Files 10 11 +1
Lines 921 947 +26
==========================================
Hits 911 911
- Misses 10 36 +26
☔ View full report in Codecov by Sentry. |
@bernalde and @pedromxavier I think this PR gives you the MOI representation that you need. Namely, the addition of |
It looks good to me. I'd be curious to see the tests to see how to interact with the new code. |
Should there be a |
Any suggestions on what the input and output would be precisely? |
|
This adds the
MOIDisjunction
reformulation method which transforms disjunctions in vector constraints that useDisjunctionSet
. This enables us to pass disjunctions directly down to the MOI level.