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.1.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.1-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: formulation_bench-0.4.1.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.1.tar.gz
Algorithm Hash digest
SHA256 6656b3e32f225cb2f5867d453087e4fa946e0d703792259fae51a4055e649989
MD5 465c80cf08175d72676d96e5e0cf0e92
BLAKE2b-256 58cbad12ec5c2811238bed95dd50ef6e460cd323d9934f7765da7e3903453166

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for formulation_bench-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 31c445d6eb40e019ccfec6f996dc67ed32fe3008e0fda23c2c825cb8625d2a0e
MD5 fbde78f1b86544d80a76e0d8ba0039be
BLAKE2b-256 5caedaf97e60642d928115b6f5d958c488af6ffd98622ec84ffd6288cfd4cf69

See more details on using hashes here.

Provenance

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

This release

0.4.1 This release

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