Skip to content

Commit 1076067

Browse files
authored
Add Complements set (#16)
1 parent cdac21d commit 1076067

File tree

8 files changed

+886
-7
lines changed

8 files changed

+886
-7
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Encoded into the MathOptFormat file format, this example becomes:
6767
{
6868
"version": {
6969
"major": 0,
70-
"minor": 5
70+
"minor": 6
7171
},
7272
"variables": [{"name": "x"}],
7373
"objective": {
@@ -252,6 +252,7 @@ Here is a summary of the sets defined by MathOptFormat.
252252
| `"RelativeEntropyCone"` | (u, v, w) ∈ {R^{dimension}: u ≥ sumᵢ wᵢlog(wᵢ/vᵢ), vᵢ ≥ 0, wᵢ ≥ 0} | {"type": "RelativeEntropyCone", "dimension": 3} |
253253
| `"NormSpectralCone"` | (t, X) ∈ {R^{1+row_dim×column_dim}: t ≥ σ₁(X)} | {"type": "NormSpectralCone", "row_dim": 1, "column_dim": 2} |
254254
| `"NormNuclearCone"` | (t, X) ∈ {R^{1+row_dim×column_dim}: t ≥ σ₁(X)} | {"type": "NormNuclearCone", "row_dim": 1, "column_dim": 2} |
255+
| `"Complements"` | The set corresponding to a mixed complementarity constraint. Complementarity constraints should be specified with an AbstractVectorFunction-in-Complements(dimension) constraint. The dimension of the vector-valued function `F` must be `dimension`. This defines a complementarity constraint between the scalar function `F[i]` and the variable in `F[i + dimension/2]`. Thus, `F[i + dimension/2]` must be interpretable as a single variable `x_i` (e.g., `1.0 * x + 0.0`). The mixed complementarity problem consists of finding `x_i` in the interval `[lb, ub]` (i.e., in the set `Interval(lb, ub)`), such that the following holds: 1. `F_i(x) == 0` if `lb_i < x_i < ub_i`; 2. `F_i(x) >= 0` if `lb_i == x_i`; 3. `F_i(x) <= 0` if `x_i == ub_i`. Classically, the bounding set for `x_i` is `Interval(0, Inf)`, which recovers: `0 <= F_i(x) ⟂ x_i >= 0`, where the `` operator implies `F_i(x) * x_i = 0`. | {"type": "Complements", "dimension": 2} |
255256

256257
### Nonlinear functions
257258

examples/biobjective.mof.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"description": "The problem: [min{2x - y + 1, -y}]",
33
"version": {
44
"major": 0,
5-
"minor": 5
5+
"minor": 6
66
},
77
"variables": [{
88
"name": "x"

examples/milp.mof.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"description": "The problem: min{x | x + y >= 1, x ∈ [0, 1], y ∈ {0, 1}}",
33
"version": {
44
"major": 0,
5-
"minor": 5
5+
"minor": 6
66
},
77
"variables": [{
88
"name": "x",

examples/nlp.mof.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"description": "The problem: min{2x + sin(x)^2 + y}.",
33
"version": {
44
"major": 0,
5-
"minor": 5
5+
"minor": 6
66
},
77
"variables": [{
88
"name": "x"

examples/quadratic.mof.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"description": "The problem: min{x^2 + x * y + y^2}",
33
"version": {
44
"major": 0,
5-
"minor": 5
5+
"minor": 6
66
},
77
"variables": [{
88
"name": "x"

examples/vector.mof.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"description": "The problem: min{0 | [1 2; 3 4][x, y] + [5, 6] ∈ R+.",
33
"version": {
44
"major": 0,
5-
"minor": 5
5+
"minor": 6
66
},
77
"variables": [{
88
"name": "x"

python/mof.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import jsonschema
33
import os
44

5-
SCHEMA_FILENAME = '../schemas/mof.0.5.schema.json'
5+
SCHEMA_FILENAME = '../schemas/mof.0.6.schema.json'
66

77
def validate(filename):
88
with open(filename, 'r') as io:

0 commit comments

Comments
 (0)