Reformulation¶
- class formulation_bench.reformulation.Reformulation(a, b, is_reformulation)[source]¶
A pair of MILP formulations with a reformulation label.
Consists of two MILP formulations
aandband a booleanis_reformulationlabel indicating whetherbis a reformulation ofa. The formal definition of reformulation is given in Reformulation. Positive entries (is_reformulation=True) are accompanied by a Lean 4 proof whose path is accessible via thelean_proof_pathattribute; negative entries have no proof andlean_proof_pathresolves toNone.- Attributes:
- a
Formulation The base formulation.
- b
Formulation The reformulation candidate.
- is_reformulationbool
Trueiffbis a reformulation ofa.- lean_proof_path
pathlib.PathorNone For positive entries, the path to the accompanying Lean 4 proof file. For negative entries,
Nonesince no proof exists.
- a
Examples
Formulation
bof p12 | Traveling Salesman Problem (TSP) is a reformulation of formulationa:>>> from formulation_bench import Dataset >>> ds = Dataset("dataset") >>> reform = ds.reformulations[80] # corresponds to p12.a -> p12.b >>> reform.a.problem.name 'Traveling Salesman Problem (TSP)' >>> reform.b.problem.name 'Traveling Salesman Problem (TSP)' >>> reform.b.constraints[-1].description # cutting plane added by p12.b 'Depot-Exit Position Bound (EC1)...' >>> reform.is_reformulation True