ommx.dataset#

Load published benchmark problems as ommx.Instance objects.

miplib2017() takes a problem name, while qplib() takes a numeric tag as a string, including any leading zeros. The first load needs access to the public registry. Subsequent loads reuse the local Artifact. Record the distribution reference and the problem name when comparing runs. The distribution version identifies the data independently of the SDK version. See the publication records for MIPLIB v2.7 and QPLIB v2.8 for coverage, corrections and model digests. Dataset annotations describe the published instance. The benchmark solving example compares a solver result with the published objective. A known objective value alone does not establish the feasibility or optimality of a candidate.

For local files, use ommx.Instance.load_mps() or ommx.Instance.load_qplib(). ommx.qplib.load_solution() shows how to read a problem and a matching candidate, evaluate it and inspect violations without a solver. For a local OMMX archive, ommx.artifact.Artifact.import_archive() imports the data into the local registry and ommx.artifact.Artifact.get_instance() selects the problem. An Instance supplied by a modeler is ready for the same operations.

Functions#

miplib2017(name) → ommx.Instance

Load a MIPLIB 2017 instance as OMMX Artifact.

miplib2017_instance_annotations() → dict[str, dict[str, str]]

Return MIPLIB 2017 instance annotations.

qplib(tag) → ommx.Instance

Load a QPLIB instance as OMMX Artifact.

qplib_instance_annotations() → dict[str, dict[str, str]]

Return QPLIB instance annotations.

Module Contents#

miplib2017(name: str) → Instance#

Load a MIPLIB 2017 instance as OMMX Artifact.

Uses the published ghcr.io/jij-inc/ommx/v2.7/miplib2017 distribution, generated with the corrected MPS integer bounds in OMMX 2.7.0. The distribution version is fixed independently of the installed SDK version; existing unversioned Artifacts are not used as a fallback.

>>> from ommx.dataset import miplib2017

Loading the instance requires remote registry access, so the following calls are not executed as doctests.

>>> instance = miplib2017("air05")

Common annotations

>>> instance.title
'air05'
>>> instance.authors
['G. Astfalk']
>>> instance.license
'CC-BY-SA-4.0'
>>> instance.num_variables
7195
>>> instance.num_constraints
426

MIPLIB-specific annotations are stored with org.ommx.miplib.* keys.

>>> instance.annotations["org.ommx.miplib.binaries"]
'7195'
>>> instance.annotations["org.ommx.miplib.integers"]
'0'
>>> instance.annotations["org.ommx.miplib.continuous"]
'0'
>>> instance.annotations["org.ommx.miplib.non_zero"]
'52121'
>>> instance.annotations["org.ommx.miplib.status"]
'easy'
>>> instance.annotations["org.ommx.miplib.objective"]
'26374'
>>> instance.annotations["org.ommx.miplib.url"]
'https://miplib.zib.de/instance_details_air05.html'
>>> instance.annotations["org.ommx.miplib.tags"]
'benchmark,binary,benchmark_suitable,set_partitioning'
miplib2017_instance_annotations() → dict[str, dict[str, str]]#

Return MIPLIB 2017 instance annotations.

>>> from ommx.dataset import miplib2017_instance_annotations
>>> annotations = miplib2017_instance_annotations()
>>> sorted(annotations.keys())
['10teams', ..., 'air05', ...]
>>> annotations["air05"]["org.ommx.miplib.status"]
'easy'
qplib(tag: str) → Instance#

Load a QPLIB instance as OMMX Artifact.

Uses the published ghcr.io/jij-inc/ommx/v2.8/qplib distribution, generated with corrected quadratic coefficients in OMMX 2.8.0. The distribution version is independent of the installed SDK version; old unversioned Artifacts are not used as a fallback.

>>> from ommx.dataset import qplib

Loading the instance requires remote registry access, so the following calls are not executed as doctests.

>>> instance = qplib("0018")

Common annotations

>>> instance.title
'QPLIB_0018'
>>> instance.authors
['Andrea Scozzari']
>>> instance.license
'CC-BY-4.0'
>>> instance.num_variables
50
>>> instance.num_constraints
2

QPLIB-specific annotations are stored with org.ommx.qplib.* keys.

>>> instance.annotations["org.ommx.qplib.nvars"]
'50'
>>> instance.annotations["org.ommx.qplib.ncons"]
'1'
>>> instance.annotations["org.ommx.qplib.objtype"]
'quadratic'
>>> instance.annotations["org.ommx.qplib.objcurvature"]
'indefinite'
>>> instance.annotations["org.ommx.qplib.probtype"]
'QCL'
>>> instance.annotations["org.ommx.qplib.url"]
'http://qplib.zib.de/QPLIB_0018.html'
qplib_instance_annotations() → dict[str, dict[str, str]]#

Return QPLIB instance annotations.

>>> from ommx.dataset import qplib_instance_annotations
>>> annotations = qplib_instance_annotations()
>>> len(annotations)
453
>>> annotations["0018"]["org.ommx.qplib.probtype"]
'QCL'