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.2.20260714.tar.gz (9.4 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.2.20260714-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mpmmine-0.0.2.20260714.tar.gz
  • Upload date:
  • Size: 9.4 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.2.20260714.tar.gz
Algorithm Hash digest
SHA256 21e739e7cb45bd27ae18b7bb5a5b7111f38a383b83cbbf37b42fcc4a213b445a
MD5 bfe42fa01ee6f76cff46415c00542609
BLAKE2b-256 53288a9d7993daf9ba4aa79c39df6854178324f7d244cfc6effa8eeb1d89802f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpmmine-0.0.2.20260714-py3-none-any.whl
Algorithm Hash digest
SHA256 30bc14d9ed3688c3dddd9ea84ebb3a84796bede7b8bfacba6ea55d7e787a20b7
MD5 d2bc7c5539a9e115407a24cd83fd2fab
BLAKE2b-256 b3ed97d5a69d789ef751511bdc738aef1c9d0f94e0035dec229ff7dbccc9abe8

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