ommx.dataset#

Functions#

miplib2017(→ ommx.Instance)

Load a MIPLIB 2017 instance as OMMX Artifact.

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

Return MIPLIB 2017 instance annotations.

qplib(→ 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'