You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ Logical variables are JuMP `AbstractVariable`s with two fields: `fix_value` and
59
59
60
60
Two types of logical constraints are supported:
61
61
62
-
1.`Selector` or cardinality constraints: A subset of Logical variables is passed and `Exactly`, `AtMost`, or `AtLeast``n` of these is allowed to be `True`. These constraints are specified with the `func` $\in$ `set` notation in `MathOptInterface` in a `@constraint` JuMP macro. It is not assumed that disjunctions have an `Exactly(1)` constraint enforced on their disjuncts upon creation. This constraint must be explicitly specified.
62
+
1.`Selector` or cardinality constraints: A subset of Logical variables is passed and `Exactly`, `AtMost`, or `AtLeast``n` of these is allowed to be `true`. These constraints are specified with the `func` $\in$ `set` notation in `MathOptInterface` in a `@constraint` JuMP macro. It is not assumed that disjunctions have an `Exactly(1)` constraint enforced on their disjuncts upon creation. This constraint must be explicitly specified.
63
63
64
64
```julia
65
65
@constraint(model, [Y[1], Y[2]] inExactly(1))
@@ -117,12 +117,10 @@ The following reformulation methods are currently supported:
117
117
118
118
-`value`: Big-M value to use. Default:`1e9`. Big-M values are currently global to the model. Constraint specific Big-M values can be supported in future releases.
119
119
-`tighten`: Boolean indicating if tightening the Big-M value should be attempted (currently supported only for linear disjunct constraints when variable bounds have been set or specified in the `variable_bounds` field). Default:`true`.
120
-
-`variable_bounds`: Dictionary specifying the lower and upper bounds for each `VariableRef` (e.g., `Dict(x => (lb, ub))`). Default: populate when calling the reformulation method.
121
120
122
121
2. [Hull](https://optimization.cbe.cornell.edu/index.php?title=Disjunctive_inequalities#Convex-Hull_Reformulation[1][2]): The `Hull` struct is created with the following optional arguments:
123
122
124
123
-`value`: `ϵ` value to use when reformulating quadratic or nonlinear constraints via the perspective function proposed by [Furman, et al. [2020]](https://link.springer.com/article/10.1007/s10589-020-00176-0). Default:`1e-6`. `ϵ` values are currently global to the model. Constraint specific tolerances can be supported in future releases.
125
-
-`variable_bounds`: Dictionary specifying the lower and upper bounds for each `VariableRef` (e.g., `Dict(x => (lb, ub))`). Default: populate when calling the reformulation method.
126
124
127
125
3. [Indicator](https://jump.dev/JuMP.jl/stable/manual/constraints/#Indicator-constraints): This method reformulates each disjunct constraint into an indicator constraint with the Boolean reformulation counterpart of the Logical variable used to define the disjunct constraint.
128
126
@@ -154,7 +152,7 @@ print(m)
154
152
# x[2] ≤ 20
155
153
156
154
##
157
-
optimize!(m, method = BigM(100, false)) #specify M value and disable M-tightening
155
+
optimize!(m, gdp_method = BigM(100, false)) #specify M value and disable M-tightening
A generalized disjunctive programming (GDP) model is created using `GDPModel()`, where the optimizer can be passed at model creation, along with other keyword arguments supported by JuMP Models.
19
+
A generalized disjunctive programming (GDP) model is created using [`GDPModel`](@ref), where the optimizer can be passed at model creation, along with other keyword arguments supported by JuMP Models.
20
20
21
21
```julia
22
22
using DisjunctiveProgramming
@@ -25,13 +25,13 @@ using HiGHS
25
25
model =GDPModel(HiGHS.Optimizer)
26
26
```
27
27
28
-
A `GDPModel` is a `JuMP Model` with a `GDPData` field in the model's `.ext` dictionary, which stores the following:
28
+
A [`GDPModel`](@ref) is a `JuMP Model` with a [`GDPData`](@ref) field in the model's `.ext` dictionary, which stores the following:
29
29
30
30
-`Logical Variables`: Indicator variables used for the various disjuncts involved in the model's disjunctions.
31
31
-`Logical Constraints`: Selector (cardinality) or proposition (Boolean) constraints describing the relationships between the logical variables.
32
32
-`Disjunct Constraints`: Constraints associated with each disjunct in the model.
33
33
-`Disjunctions`: Disjunction constraints.
34
-
-`Solution Method`: The reformulation technique or solution method. Currently supported methods include Big-M, Hull, and Indicator Constraints.
34
+
-`Solution Method`: The reformulation technique or solution method. Currently, supported methods include Big-M, Hull, and Indicator Constraints.
35
35
-`Reformulation Variables`: List of JuMP variables created when reformulating a GDP model into a MIP model.
36
36
-`Reformulation Constraints`: List of constraints created when reformulating a GDP model into a MIP model.
37
37
-`Ready to Optimize`: Flag indicating if the model can be optimized.
@@ -49,7 +49,7 @@ data = gdp_data(model)
49
49
50
50
## Logical Variables
51
51
52
-
Logical variables are JuMP `AbstractVariable`s with two fields: `fix_value` and `start_value`. These can be optionally specified at variable creation. Logical variables are created with the `@variable` JuMP macro by adding the tag `Logical` as the last keyword argument. As with the regular `@variable` macro, variables can be named and indexed:
52
+
Logical variables are JuMP `AbstractVariable`s with two fields: `fix_value` and `start_value`. These can be optionally specified at variable creation. Logical variables are created with the `@variable` JuMP macro by adding the tag [`Logical`](@ref) as the last keyword argument. As with the regular `@variable` macro, variables can be named and indexed:
53
53
54
54
```julia
55
55
@variable(model, Y[1:3], Logical)
@@ -59,7 +59,7 @@ Logical variables are JuMP `AbstractVariable`s with two fields: `fix_value` and
59
59
60
60
Two types of logical constraints are supported:
61
61
62
-
1.`Selector` or cardinality constraints: A subset of Logical variables is passed and `Exactly`, `AtMost`, or `AtLeast``n` of these is allowed to be `True`. These constraints are specified with the `func` $\in$ `set` notation in `MathOptInterface` in a `@constraint` JuMP macro. It is not assumed that disjunctions have an `Exactly(1)` constraint enforced on their disjuncts upon creation. This constraint must be explicitly specified.
62
+
1.`Selector` or cardinality constraints: A subset of Logical variables is passed and [`Exactly`](@ref), [`AtMost`](@ref), or [`AtLeast`](@ref)`n` of these is allowed to be `true`. These constraints are specified with the `func` $\in$ `set` notation in `MathOptInterface` in a `@constraint` JuMP macro. It is not assumed that disjunctions have an `Exactly(1)` constraint enforced on their disjuncts upon creation. This constraint must be explicitly specified.
63
63
64
64
```julia
65
65
@constraint(model, [Y[1], Y[2]] inExactly(1))
@@ -73,33 +73,33 @@ Two types of logical constraints are supported:
73
73
-`⟹` of `implies` (Implication, typed with `\Longrightarrow + tab`).
74
74
-`⇔` or `iff` or `==` (double implication or equivalence, typed with `\Leftrightarrow + tab`).
75
75
76
-
The `@constraint` JuMP macro is used to create these constraints with `:=`:
76
+
The `@constraint` JuMP macro is used to create these constraints with `:=`:
77
77
78
-
```julia
79
-
@constraint(model, Y[1] ⟹ Y[2] := true)
80
-
```
78
+
```julia
79
+
@constraint(model, Y[1] ⟹ Y[2] := true)
80
+
```
81
81
82
-
_Note_: The parenthesis in the example above around the implication clause are only required when the parent logical operator is `⟹` or `⇔` to avoid parsing errors.
82
+
_Note_: The parenthesis in the example above around the implication clause are only required when the parent logical operator is `⟹` or `⇔` to avoid parsing errors.
83
83
84
-
Logical propositions can be reformulated to IP constraints by automatic reformulation to [Conjunctive Normal Form](https://en.wikipedia.org/wiki/Conjunctive_normal_form).
84
+
Logical propositions can be reformulated to IP constraints by automatic reformulation to [Conjunctive Normal Form](https://en.wikipedia.org/wiki/Conjunctive_normal_form).
85
85
86
86
## Disjunctions
87
87
88
-
Disjunctions are built by first defining the constraints associated with each disjunct. This is done via the `@constraint` JuMP macro with the extra `Disjunct` tag specifying the Logical variable associated with the constraint:
88
+
Disjunctions are built by first defining the constraints associated with each disjunct. This is done via the `@constraint` JuMP macro with the extra [`Disjunct`](@ref) tag specifying the Logical variable associated with the constraint:
89
89
90
90
```julia
91
91
@variable(model, x)
92
92
@constraint(model, x ≤ 100, Disjunct(Y[1]))
93
93
@constraint(model, x ≥ 200, Disjunct(Y[2]))
94
94
```
95
95
96
-
After all disjunct constraints associated with a disjunction have been defined, the disjunction is created with the `@disjunction`macro, where the disjunction is defined as a `Vector` of Logical variables associated with each disjunct:
96
+
After all disjunct constraints associated with a disjunction have been defined, the disjunction is created with the [`@disjunction`](@ref)macro, where the disjunction is defined as a `Vector` of Logical variables associated with each disjunct:
97
97
98
98
```julia
99
99
@disjunction(model, [Y[1], Y[2]])
100
100
```
101
101
102
-
Disjunctions can be nested by passing an additional `Disjunct` tag. The Logical variable in the `Disjunct` tag specifies which disjunct, the nested disjunction belongs to:
102
+
Disjunctions can be nested by passing an additional [`Disjunct`](@ref) tag. The Logical variable in the `Disjunct` tag specifies which disjunct, the nested disjunction belongs to:
103
103
104
104
```julia
105
105
@disjunction(model, Y[1:2], Disjunct(Y[3]))
@@ -113,18 +113,11 @@ For convenience, the `Exactly(1)` selector constraint is added by default when a
113
113
114
114
The following reformulation methods are currently supported:
115
115
116
-
1. [Big-M](https://optimization.cbe.cornell.edu/index.php?title=Disjunctive_inequalities#Big-M_Reformulation[1][2]): The `BigM` struct is created with the following optional arguments:
117
-
118
-
-`value`: Big-M value to use. Default:`1e9`. Big-M values are currently global to the model. Constraint specific Big-M values can be supported in future releases.
119
-
-`tighten`: Boolean indicating if tightening the Big-M value should be attempted (currently supported only for linear disjunct constraints when variable bounds have been set or specified in the `variable_bounds` field). Default:`true`.
120
-
-`variable_bounds`: Dictionary specifying the lower and upper bounds for each `VariableRef` (e.g., `Dict(x => (lb, ub))`). Default: populate when calling the reformulation method.
121
-
122
-
2. [Hull](https://optimization.cbe.cornell.edu/index.php?title=Disjunctive_inequalities#Convex-Hull_Reformulation[1][2]): The `Hull` struct is created with the following optional arguments:
116
+
1. [Big-M](https://optimization.cbe.cornell.edu/index.php?title=Disjunctive_inequalities#Big-M_Reformulation[1][2]): The [`BigM`](@ref) struct is used.
123
117
124
-
-`value`: `ϵ` value to use when reformulating quadratic or nonlinear constraints via the perspective function proposed by [Furman, et al. [2020]](https://link.springer.com/article/10.1007/s10589-020-00176-0). Default:`1e-6`. `ϵ` values are currently global to the model. Constraint specific tolerances can be supported in future releases.
125
-
-`variable_bounds`: Dictionary specifying the lower and upper bounds for each `VariableRef` (e.g., `Dict(x => (lb, ub))`). Default: populate when calling the reformulation method.
118
+
2. [Hull](https://optimization.cbe.cornell.edu/index.php?title=Disjunctive_inequalities#Convex-Hull_Reformulation[1][2]): The [`Hull`](@ref) struct is used.
126
119
127
-
3. [Indicator](https://jump.dev/JuMP.jl/stable/manual/constraints/#Indicator-constraints): This method reformulates each disjunct constraint into an indicator constraint with the Boolean reformulation counterpart of the Logical variable used to define the disjunct constraint.
120
+
3. [Indicator](https://jump.dev/JuMP.jl/stable/manual/constraints/#Indicator-constraints): This method reformulates each disjunct constraint into an indicator constraint with the Boolean reformulation counterpart of the Logical variable used to define the disjunct constraint. This is invoked with [`Indicator`](@ref).
128
121
129
122
## Release Notes
130
123
@@ -154,7 +147,7 @@ print(m)
154
147
# x[2] ≤ 20
155
148
156
149
##
157
-
optimize!(m, method = BigM(100, false)) #specify M value and disable M-tightening
150
+
optimize!(m, gdp_method = BigM(100, false)) #specify M value and disable M-tightening
0 commit comments