Skip to main content

A Python package for accessing the MPMMine dataset

Project description

image

mpmmine-py: A Python package for accessing the MPMMine dataset

The mpmmine-py library provides a Python API for the MPMMine benchmark dataset. By leveraging native Python structures, it simplifies script development and facilitates seamless integration of the dataset into larger Python projects. MPMMine is a standardized dataset of benchmark problems for Mathematical Programming model mining problems. For the details on the dataset, see the corresponding repository.

Getting started

Installation

pip install mpmmine

Usage

from mpmmine import MPMMine
from pathlib import Path

mpmmine = MPMMine(Path("~/path/to/MPMMine").expanduser())

print("Available benchmarks and their statistics: ")
for problem in mpmmine.problems:
    for model in problem.models:
        for instance in model.instances:
            print(f"{instance.full_id}: {len(list(instance.solutions))} solutions, and " +
                  f"{len(list(instance.non_solutions))} non-solutions")

print("A reference MiniZinc model for benchmark P016M001:")
model = mpmmine["MPMMine-P016M001"]
print(model.mzn)  # read MiniZinc code

print("Here's the problem description in natural text:")
print(model.get_description("D001").markdown)  # read Markdown

print("Here's another description read using full artifact id:")
print(mpmmine["MPMMine-P016M001D002"].markdown)  # read Markdown

print("Here's I001 instance (model parameters):")
print(model.get_instance("I001").dzn)  # read MiniZinc data 

print("Here's some solutions (variable values):")
for i, solution in enumerate(mpmmine["MPMMine-P016M001I001"].solutions):
    if i >= 3:
        break
    print(f"% {solution.full_id}:\n{solution.dzn}")

print("... and non-solutions:")
for i, non_solution in enumerate(mpmmine["MPMMine-P016M001I001"].non_solutions):
    if i >= 3:
        break
    print(f"% {non_solution.full_id}:\n{non_solution.dzn}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpmmine-0.0.3.20260714.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpmmine-0.0.3.20260714-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file mpmmine-0.0.3.20260714.tar.gz.

File metadata

  • Download URL: mpmmine-0.0.3.20260714.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for mpmmine-0.0.3.20260714.tar.gz
Algorithm Hash digest
SHA256 fbaf19e5e1fd414cd832877c77a3bc2abf4d3053b4c080db96940312a5c7642c
MD5 b3ac6e186f5070db87ae3aa1bd6aa111
BLAKE2b-256 177113178369f0cc51e8793f94f63b7b56bd8870328cf7c5dcb40b8090ab7131

See more details on using hashes here.

File details

Details for the file mpmmine-0.0.3.20260714-py3-none-any.whl.

File metadata

File hashes

Hashes for mpmmine-0.0.3.20260714-py3-none-any.whl
Algorithm Hash digest
SHA256 cf13eeae689259f08bdeb27f446af9e588ecdfde0f3c765040aa0de1fce93a12
MD5 237e44c8d8b7e0bc3807001e81f1ad4c
BLAKE2b-256 e2823976c339c78cb1288136350e9595f5dcb90e8fadd0667af0dcb923a3a487

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page