Skip to main content

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

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.4.0.tar.gz (26.2 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.4.0-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: formulation_bench-0.4.0.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for formulation_bench-0.4.0.tar.gz
Algorithm Hash digest
SHA256 af362895900bf4f739e84e184f8561d3ce30bcc0bfa7b063e0c548d53ab23e41
MD5 ac01c3865d3ebc70d160aeac7b3e171b
BLAKE2b-256 cf75ab1f6755226cd566d47ea2d69232a5c71dd60eb1a460ff087622d0b4359c

See more details on using hashes here.

Provenance

The following attestation bundles were made for formulation_bench-0.4.0.tar.gz:

Publisher: release.yml on henryrobbins/formulation-bench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for formulation_bench-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bde68e20a89b3fba6c618e65f55c7b4241f8f40fe80bfe12d070538f7396c761
MD5 d867a04cf7797a26a72c6537ca0dce61
BLAKE2b-256 ed2a576701d439f65820caba4b44cd21476103cbcb0f5a6008bcd4983c0b53b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for formulation_bench-0.4.0-py3-none-any.whl:

Publisher: release.yml on henryrobbins/formulation-bench

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.5.0

2 files

0.4.1

2 files

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

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