Example: Mixed-integer linear program
Profiles: OSCAR v1.0, OSCAR v1.1, OSCAR v1.2, OSCAR v1.3, OSCAR v1.4, OSCAR v1.5, OSCAR v1.6, OSCAR v1.7, OSCAR v1.8
Construct a mixed-integer linear program on the cube with two integer variables.
Related Specification
Systems
Oscar.jl
Generate code (generate.jl) [ edit ]
using Oscar
P = cube(3)
obj = mixed_integer_linear_program(P, [3, -2, 4]; k=2, convention=:min, integer_variables=[1, 2])
save("data.mrdi", obj)
Data outputs
Profiles: OSCAR v1.0, OSCAR v1.1, OSCAR v1.2, OSCAR v1.3, OSCAR v1.4, OSCAR v1.5, OSCAR v1.6, OSCAR v1.7
Data file: data.mrdi
{
"_ns": {"Oscar": ["https://github.com/oscar-system/Oscar.jl", "1.7.0"]},
"_type": {"name": "MixedIntegerLinearProgram", "params": {"_type": "QQField"}},
"data": {
"feasible_region": {
"BOUNDED": true,
"_attrs": {"FACETS": {"_type": "SparseMatrix<Rational, NonSymmetric>"}},
"CONE_DIM": 4,
"MILP": [
{
"_attrs": {"convention": {"attachment": true}},
"LINEAR_OBJECTIVE": ["2", "3", "-2", "4"],
"INTEGER_VARIABLES": [1, 2],
"_id": "unnamed#0",
"convention": "min"
}
],
"VERTICES_IN_FACETS": [
[0, 2, 4, 6],
[1, 3, 5, 7],
[0, 1, 4, 5],
[2, 3, 6, 7],
[0, 1, 2, 3],
[4, 5, 6, 7],
{"cols": 8}
],
"_info": {"description": "cube of dimension 3\n"},
"_ns": {"polymake": ["https://polymake.org", "4.15"]},
"CONE_AMBIENT_DIM": 4,
"FACETS": [
{"0": "1", "1": "1"},
{"0": "1", "1": "-1"},
{"0": "1", "2": "1"},
{"0": "1", "2": "-1"},
{"0": "1", "3": "1"},
{"0": "1", "3": "-1"},
{"cols": 4}
],
"_type": "polytope::Polytope<Rational>",
"AFFINE_HULL": [{"cols": 4}]
},
"convention": "min",
"milp_coeffs": {
"_type": "common::Vector<Rational>",
"data": ["2", "3", "-2", "4"],
"_ns": {"polymake": ["https://polymake.org", "4.15"]}
},
"int_vars": {
"_ns": {"polymake": ["https://polymake.org", "4.15"]},
"data": [1, 2],
"_type": "common::Set<Int>"
}
}
}
This serialized output is equivalent for these profiles up to UUID renaming and recorded namespace version strings.