|
1 | 1 | { |
2 | 2 | "$schema": "https://json-schema.org/schema#", |
3 | | - "$id": "https://jump.dev/MathOptFormat/schemas/mof.1.0.schema.json", |
| 3 | + "$id": "https://jump.dev/MathOptFormat/schemas/mof.1.1.schema.json", |
4 | 4 | "title": "The schema for MathOptFormat", |
5 | 5 | "type": "object", |
6 | 6 | "required": ["version", "variables", "objective", "constraints"], |
|
11 | 11 | "required": ["minor", "major"], |
12 | 12 | "properties": { |
13 | 13 | "minor": { |
14 | | - "const": 0 |
| 14 | + "const": 1 |
15 | 15 | }, |
16 | 16 | "major": { |
17 | 17 | "const": 1 |
|
872 | 872 | "minimum": 2 |
873 | 873 | } |
874 | 874 | } |
| 875 | + }, { |
| 876 | + "description": "The set {x in Z^d} such that no two elements in x take the same value and dimension=d.", |
| 877 | + "examples": ["{\"type\": \"AllDifferent\", \"dimension\": 2}"], |
| 878 | + "required": ["dimension"], |
| 879 | + "properties": { |
| 880 | + "type": { |
| 881 | + "const": "AllDifferent" |
| 882 | + }, |
| 883 | + "dimension": { |
| 884 | + "type": "integer", |
| 885 | + "minimum": 1 |
| 886 | + } |
| 887 | + } |
| 888 | + }, { |
| 889 | + "description": "The set `{x in Z^d}` where `d = length(w)`, such that each item `i` in `1:d` of weight `w[i]` is put into bin `x[i]`, and the total weight of each bin does not exceed `c`.", |
| 890 | + "examples": ["{\"type\": \"BinPacking\", \"capacity\": 3.0, \"weights\": [1.0, 2.0, 3.0]}"], |
| 891 | + "required": ["capacity", "weights"], |
| 892 | + "properties": { |
| 893 | + "type": { |
| 894 | + "const": "BinPacking" |
| 895 | + }, |
| 896 | + "capacity": { |
| 897 | + "type": "number" |
| 898 | + }, |
| 899 | + "weights": { |
| 900 | + "type": "array", |
| 901 | + "items": { |
| 902 | + "type": "number" |
| 903 | + } |
| 904 | + } |
| 905 | + } |
| 906 | + }, { |
| 907 | + "description": "The set `{x in {1..d}^d}` that constraints `x` to be a circuit, such that `x_i = j` means that `j` is the successor of `i`, and `dimension = d`.", |
| 908 | + "examples": ["{\"type\": \"Circuit\", \"dimension\": 3}"], |
| 909 | + "required": ["dimension"], |
| 910 | + "properties": { |
| 911 | + "type": { |
| 912 | + "const": "Circuit" |
| 913 | + }, |
| 914 | + "dimension": { |
| 915 | + "type": "integer", |
| 916 | + "minimum": 1 |
| 917 | + } |
| 918 | + } |
| 919 | + }, { |
| 920 | + "description": "The set `{x in Z^{d_1 + d_2 + ldots d_N}}`, where `x` is partitioned into `N` subsets (`{x_1, ldots, x_{d_1}}`, `{x_{d_1 + 1}, ldots, x_{d_1 + d_2}}` and so on), and at least `n` elements of each subset take one of the values in `set`.", |
| 921 | + "examples": ["{\"type\": \"CountAtLeast\", \"n\": 1, \"partitions\": [2, 2], \"set\": [3]}"], |
| 922 | + "required": ["n", "partitions", "set"], |
| 923 | + "properties": { |
| 924 | + "type": { |
| 925 | + "const": "CountAtLeast" |
| 926 | + }, |
| 927 | + "n": { |
| 928 | + "type": "integer", |
| 929 | + "minimum": 0 |
| 930 | + }, |
| 931 | + "partitions": { |
| 932 | + "type": "array", |
| 933 | + "items": { |
| 934 | + "type": "integer" |
| 935 | + } |
| 936 | + }, |
| 937 | + "set": { |
| 938 | + "type": "array", |
| 939 | + "items": { |
| 940 | + "type": "integer" |
| 941 | + } |
| 942 | + } |
| 943 | + } |
| 944 | + }, { |
| 945 | + "description": "The set `{(n, x) in Z^{1+d}}`, such that `n` elements of the vector `x` take on of the values in `set` and `dimension = 1 + d`.", |
| 946 | + "examples": ["{\"type\": \"CountBelongs\", \"dimension\": 3, \"set\": [3, 4, 5]}"], |
| 947 | + "required": ["dimension", "set"], |
| 948 | + "properties": { |
| 949 | + "type": { |
| 950 | + "const": "CountBelongs" |
| 951 | + }, |
| 952 | + "dimension": { |
| 953 | + "type": "integer", |
| 954 | + "minimum": 1 |
| 955 | + }, |
| 956 | + "set": { |
| 957 | + "type": "array", |
| 958 | + "items": { |
| 959 | + "type": "integer" |
| 960 | + } |
| 961 | + } |
| 962 | + } |
| 963 | + }, { |
| 964 | + "description": "The set `{(n, x) in Z^{1+d}}`, such that the number of distinct values in `x` is `n` and `dimension = 1 + d`.", |
| 965 | + "examples": ["{\"type\": \"CountDistinct\", \"dimension\": 3}"], |
| 966 | + "required": ["dimension"], |
| 967 | + "properties": { |
| 968 | + "type": { |
| 969 | + "const": "CountDistinct" |
| 970 | + }, |
| 971 | + "dimension": { |
| 972 | + "type": "integer", |
| 973 | + "minimum": 1 |
| 974 | + } |
| 975 | + } |
| 976 | + }, { |
| 977 | + "description": "The set `{(c, y, x) in Z^{1+1+d}}`, such that `c` is strictly greater than the number of occurances of `y` in `x` and `dimension = 1 + 1 + d`.", |
| 978 | + "examples": ["{\"type\": \"CountGreaterThan\", \"dimension\": 3}"], |
| 979 | + "required": ["dimension"], |
| 980 | + "properties": { |
| 981 | + "type": { |
| 982 | + "const": "CountGreaterThan" |
| 983 | + }, |
| 984 | + "dimension": { |
| 985 | + "type": "integer", |
| 986 | + "minimum": 1 |
| 987 | + } |
| 988 | + } |
| 989 | + }, { |
| 990 | + "description": "The set `{(s, d, r, b) in Z^{3n+1}}`, representing the `cumulative` global constraint, where `n == length(s) == length(r) == length(b)` and `dimension = 3n + 1`. `Cumulative` requires that a set of tasks given by start times `s`, durations `d`, and resource requirements `r`, never requires more than the global resource bound `b` at any one time.", |
| 991 | + "examples": ["{\"type\": \"Cumulative\", \"dimension\": 10}"], |
| 992 | + "required": ["dimension"], |
| 993 | + "properties": { |
| 994 | + "type": { |
| 995 | + "const": "Cumulative" |
| 996 | + }, |
| 997 | + "dimension": { |
| 998 | + "type": "integer", |
| 999 | + "minimum": 1 |
| 1000 | + } |
| 1001 | + } |
| 1002 | + }, { |
| 1003 | + "description": "Given a graph comprised of a set of nodes `1..N` and a set of arcs `1..E` represented by an edge from node `from[i]` to node `to[i]`, `Path` constrains the set `(s, t, ns, es) in (1..N)times(1..E)times{0,1}^Ntimes{0,1}^E`, to form subgraph that is a path from node `s` to node `t`, where node `n` is in the path if `ns[n]` is `1`, and edge `e` is in the path if `es[e]` is `1`. The path must be acyclic, and it must traverse all nodes `n` for which `ns[n]` is `1`, and all edges `e` for which `es[e]` is `1`.", |
| 1004 | + "examples": ["{\"type\": \"Path\", \"from\": [1, 1, 2, 2, 3], \"to\": [2, 3, 3, 4, 4]}"], |
| 1005 | + "required": ["from", "to"], |
| 1006 | + "properties": { |
| 1007 | + "type": { |
| 1008 | + "const": "Path" |
| 1009 | + }, |
| 1010 | + "from": { |
| 1011 | + "type": "array", |
| 1012 | + "items": { |
| 1013 | + "type": "integer" |
| 1014 | + } |
| 1015 | + }, |
| 1016 | + "to": { |
| 1017 | + "type": "array", |
| 1018 | + "items": { |
| 1019 | + "type": "integer" |
| 1020 | + } |
| 1021 | + } |
| 1022 | + } |
| 1023 | + }, { |
| 1024 | + "description": "The set `{x in R^d}` where `d = size(table, 2)`, such that `x` belongs to one row of `table`. That is, there exists some `j` in `1:size(table, 1)`, such that `x[i] = table[j, i]` for all `i=1:size(table, 2)`.", |
| 1025 | + "examples": ["{\"type\": \"Table\", \"table\": [[1, 1, 0], [0, 1, 1]]}"], |
| 1026 | + "required": ["table"], |
| 1027 | + "properties": { |
| 1028 | + "type": { |
| 1029 | + "const": "Table" |
| 1030 | + }, |
| 1031 | + "table": { |
| 1032 | + "type": "array", |
| 1033 | + "items": { |
| 1034 | + "type": "array", |
| 1035 | + "items": { |
| 1036 | + "type": "number" |
| 1037 | + } |
| 1038 | + } |
| 1039 | + } |
| 1040 | + } |
875 | 1041 | }] |
876 | 1042 | } |
877 | 1043 | } |
|
0 commit comments