Generalized Disjunctive Programming (GDP) provides a way to bridge high-level propositional logic and algebraic constraints. The GDP standard form from the index page <gdp-main-page>
is repeated below.
Original support in Pyomo.GDP focused on the disjuncts and disjunctions, allowing the modelers to group relational expressions in disjuncts, with disjunctions describing logical-OR relationships between the groupings. As a result, we implemented the Disjunct
and Disjunction
objects before BooleanVar
and the rest of the logical expression system. Accordingly, we also describe the disjuncts and disjunctions first below.
Disjuncts represent groupings of relational expressions (e.g. algebraic constraints) summarized by a Boolean indicator variable Y through implication:
Logically, this means that if Yik = True, then the constraints Mikx + Nikz ≤ eik and rik(x, z) ≤ 0 must be satisfied. However, if Yik = False, then the corresponding constraints are ignored. Note that Yik = False does not imply that the corresponding constraints are violated.
Disjunctions describe a logical OR relationship between two or more Disjuncts. The simplest and most common case is a 2-term disjunction:
The disjunction above describes the selection between two units in a process network. Y1 and Y2 are the Boolean variables corresponding to the selection of process units 1 and 2, respectively. The continuous variables x1, x2, x3, x4 describe flow in and out of the first and second units, respectively. If a unit is selected, the nonlinear equality in the corresponding disjunct enforces the input/output relationship in the selected unit. The final equality in each disjunct forces flows for the absent unit to zero.
Boolean variables are decision variables that may take a value of True
or False
. These are most often encountered as the indicator variables of disjuncts. However, they can also be independently defined to represent other problem decisions.
Note
Boolean variables are not intended to participate in algebraic expressions. That is, 3 × True does not make sense; hence, x = 3Y1 does not make sense. Instead, you may have the disjunction
Logical propositions are constraints describing relationships between the Boolean variables in the model.
These logical propositions can include:
Operator | Example | Y1 | Y2 | Result |
---|---|---|---|---|
Negation | ¬Y1 | True False |
False True |
|
Equivalence | Y1 ⇔ Y2 | True True False False |
True False True False |
True False False True |
Conjunction | Y1 ∧ Y2 | True True False False |
True False True False |
True False False False |
Disjunction | Y1 ∨ Y2 | True True False False |
True False True False |
True True True False |
Exclusive OR | Y1 ⊻ Y2 | True True False False |
True False True False |
False True True False |
Implication | Y1 ⇒ Y2 | True True False False |
True False True False |
True False True True |