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

Metadata

Release files for formulation-bench 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for formulation-bench 0.5.0
File Size Uploaded
formulation_bench-0.5.0.tar.gz 26.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for formulation-bench 0.5.0
File Interpreter ABI Platform
formulation_bench-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.6 kB

Release files / formulation_bench-0.5.0.tar.gz

Download URL formulation_bench-0.5.0.tar.gz
Size 26.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7f99da17ba6187ed643fd8f7aef5a21da1376479c72a4484ab7180e429fb5f14
BLAKE2b-256 checksum
How to use checksums
03ee7ae1d728d48f57c00a4bb8246a1c25cc1a65df7e2c92e1c803d4ff398cdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release files / formulation_bench-0.5.0-py3-none-any.whl

Download URL formulation_bench-0.5.0-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db416b4a5c2cadae3b16704ce4f008879e9af9cbba157e7611a6cb1d21a7521b
BLAKE2b-256 checksum
How to use checksums
f8939d4b549c403784f81ef9d1db9bff67c09ab89d7ca39bccefa6c905f82a96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page