Do Not Merge Yet: Add MOI Disjunction Set Reformulation#71
Do Not Merge Yet: Add MOI Disjunction Set Reformulation#71pulsipher wants to merge 4 commits intoinfiniteopt:masterfrom
Conversation
|
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}}
endwe 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
endNow 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}}}
endThis 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
MOIDisjunctionreformulation method which transforms disjunctions in vector constraints that useDisjunctionSet. This enables us to pass disjunctions directly down to the MOI level.