Skip to main content

Utilities for loading and working with the FormulationBench dataset.

Project description

formulation-bench

PyPI version CI codecov Documentation Status License: MIT Checked with mypy Ruff

Python utilities for loading and working with the FormulationBench dataset. FormulationBench is a collection of 20 optimization problems with 116 mixed-integer linear programming (MILP) formulations. Each formulation has a natural language description, LaTeX formulation, GurobiPy implementation, and Lean representation. Furthermore, there are 96 pairs of formulations consisting of 70 positive reformulation examples and 26 negative examples. Each positive example has a machine-checked Lean 4 reformulation proof. See the documentation for details.

Installation

pip install formulation-bench

Quickstart

Download the dataset:

from formulation_bench import Dataset
ds = Dataset.load()

Access a problem's formulations:

p1 = ds.problems[1]
p1a = p1.formulations["a"]

Access reformulation pairs:

pos = [r for r in ds.reformulations if r.is_reformulation]
neg = [r for r in ds.reformulations if not r.is_reformulation]

Development

See AGENTS.md for development information.

Cite

TODO: Add arXiv article citation

License

MIT

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

formulation_bench-0.3.0.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

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

formulation_bench-0.3.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file formulation_bench-0.3.0.tar.gz.

File metadata

  • Download URL: formulation_bench-0.3.0.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for formulation_bench-0.3.0.tar.gz
Algorithm Hash digest
SHA256 91e3498e2b49c9b9b2dd7146bc1b0cc8caab11789d6545040e5dd9a94b575b3f
MD5 110943edb0076f80727206172bb6ec2f
BLAKE2b-256 245e5ea38da7d3372526950bee342783b1c000177b568afb3a4f53a292b91840

See more details on using hashes here.

File details

Details for the file formulation_bench-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: formulation_bench-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for formulation_bench-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9412a4a4910ce1c365f1a005b4ca39360b74bf28b65ef191fd6f3d97a38b8ffd
MD5 6240ad373a632bbd6d65dcefff014908
BLAKE2b-256 5a20135f8c898008f82222381a1431c4370471491141a94be047f703e7ae8673

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