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

Uploaded Python 3

File details

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

File metadata

  • Download URL: formulation_bench-0.5.0.tar.gz
  • Upload date:
  • Size: 26.3 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.5.0.tar.gz
Algorithm Hash digest
SHA256 7f99da17ba6187ed643fd8f7aef5a21da1376479c72a4484ab7180e429fb5f14
MD5 1615f4da8c4dafdfeb112b9b24341173
BLAKE2b-256 03ee7ae1d728d48f57c00a4bb8246a1c25cc1a65df7e2c92e1c803d4ff398cdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for formulation_bench-0.5.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.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for formulation_bench-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db416b4a5c2cadae3b16704ce4f008879e9af9cbba157e7611a6cb1d21a7521b
MD5 48941d7f94b82de9640e38677292b4a6
BLAKE2b-256 f8939d4b549c403784f81ef9d1db9bff67c09ab89d7ca39bccefa6c905f82a96

See more details on using hashes here.

Provenance

The following attestation bundles were made for formulation_bench-0.5.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

This release

0.5.0 This release

2 files

0.4.1

2 files

0.4.0

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