-
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
Support cardinality clauses within more complex logic #116
Comments
@dovallev does this mean that
|
@hdavid16 here is a simple illustrative use case: |
@pulsipher this is an interesting application because you are suggesting using cardinality constraints in a conditional fashion. The current modeling paradigm in GDP is that cardinality constraints are global and are always
|
Exactly right.
Yep, I agree. This is what pyomo.gdp does. To me, the key question is what is the "best" way to reformulate cardinality operators behind the scenes? Once we know how we'd like to reformulate it, adding the cardinality operators as a feature addition should be a relatively straightforward PR. I am interested in this for a paper we are trying to wrap up and use DisjunctiveProgramming instead of pyomo.gdp. |
Hello @hdavid16 I think an easy way to support this (at least initially) is to allow modeling with binary variables inside disjunctions. In that way, the following formulation: could be formulated as: In the previous small example, the relation between From a philosophical point of view, I understand that there is almost no need of having binaries inside disjunctions, as logic can be represented in Boolean algebra. Still there are a few examples in MIP where binaries are not used as indicators. More importantly, GDP is a rich modeling framework and there is no need for constraining it. It should be the modeler's decision to use Boolean or binary when they consider appropriate (no?). |
@pulsipher and I have discussed a way to support conditional cardinality constraints in the package by reformulating them always with big M, since it is likely not the best idea to start lifting binaries with a Hull reformulation. That way, you can still reformulate your model with Hull without lifting binaries for this more advanced 1st order logic. We just need to find some clones to add this to the package 😆. The current hack is just to add the reformulation directly to the model for these cardinality constraints. |
It would be useful to support expressions of the type:
Where Y and Z are Boolean variables associated to unrelated disjuncts. This is expression would be currently supported in Pyomo.GDP as:
@m.LogicalConstraint()
def foo(m):
return equivalent(land(atleast(1, m.Y[:].indicator_var), atleast(1, m.Z[:].indicator_var)), m.W)
The text was updated successfully, but these errors were encountered: