Support P-Split Reformulation for (affine and quadratic constraints only)#124
Conversation
…roken lines and 80 character limit
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #124 +/- ##
=========================================
Coverage ? 99.64%
=========================================
Files ? 14
Lines ? 1419
Branches ? 0
=========================================
Hits ? 1414
Misses ? 5
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@dnguyen227, is this ready for review? |
|
Yes please review. |
pulsipher
left a comment
There was a problem hiding this comment.
I left some initial comments for improvement. One fundamental observation though is that P-Split just applies Hull to each partitioned subset. With this in mind Pyomo simply applies their Hull transformation after getting the partitions: https://github.com/Pyomo/pyomo/blob/main/pyomo/gdp/plugins/between_steps.py. I think we should do same, that way we aren't unnecessarily repeating the Hull code. Moreover, the existing Hull codebase is already battletested.
pulsipher
left a comment
There was a problem hiding this comment.
This is looking pretty good, just a few suggestions for improvement.
Fix formatting of the default_M field description.
This PR adds the P-Split reformulation technique. The technique is called with a vector of partitions:
For example for two partitions (p=2):
model = GDPModel()
...
@variable(model, x[1:4], Disjunct(...))
...
partition = [ [x[1] , x[2]], [x[3] , x[4]]] #one partition contains x1,x2 and the other contains x3,x4
optimize!(model, gdp_method = PSplit(partition))
In src/psplit.jl are extensions for reformulate_disjunct_constraint as well as new functions for building partitioned expressions.