Skip to content

Commit 183b19a

Browse files
isPANNclaude
andauthored
feat: add 38 problem models (#960)
* feat: add MinimumInternalMacroDataCompression model (#442) Implement the internal macro data compression problem (GJ SR23) with direct ILP reduction, CLI support, canonical example, and paper entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: generalize MinimumTardinessSequencing with weight parameter (#495) Add W type parameter to MinimumTardinessSequencing: W=One for unit-length tasks (existing behavior), W=usize for arbitrary task lengths. Includes ILP reduction for both variants, canonical examples, and updated tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add SequencingToMinimizeTardyTaskWeight model (#496) Implement the weighted tardy task scheduling problem (GJ SS3) with direct ILP reduction, CLI support, canonical example, and paper entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add SequencingWithDeadlinesAndSetUpTimes model (#499) Implement the scheduling feasibility problem with compiler-class setup times (GJ SS6) with direct ILP reduction, CLI support, and paper entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add PreemptiveScheduling model (#504) Implement multiprocessor preemptive scheduling (GJ SS12) with binary time-slot assignment, direct ILP<i32> reduction, CLI support, and paper entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix #506: Add OpenShopScheduling model and direct ILP rule Implements the Open Shop Scheduling optimization model (minimize makespan) with a direct ILP reduction using disjunctive formulation (binary ordering variables + integer start times + makespan objective). Canonical example uses the 4 jobs × 3 machines instance with true optimal makespan = 8. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: add QuadraticCongruences model (#536) Implement the quadratic congruences feasibility problem (GJ AN1) with brute-force solver, CLI support, canonical example, and paper entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add SimultaneousIncongruences model (#537) Implement the simultaneous incongruences feasibility problem (GJ AN2) with brute-force solver, CLI support, canonical example, and paper entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add EquilibriumPoint model (#549) Implement the discrete Nash equilibrium existence problem (GJ AN15) with brute-force solver, CLI support, canonical example, and paper entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add DirectedHamiltonianPath model (#813) Implement directed Hamiltonian path feasibility problem with ILP reduction, CLI support, canonical example, and paper entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add SetSplitting model (#830) Implement hypergraph 2-colorability / set splitting feasibility problem (GJ SP4) with ILP reduction, CLI support, canonical example, and paper entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add HamiltonianPathBetweenTwoVertices model (#831) Implement the fixed-endpoint Hamiltonian path problem (GJ Chapter 3) with brute-force solver, CLI support, canonical example, and paper entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add MinimumMaximalMatching model (#832) Implement minimum maximal matching / minimum edge dominating set (GJ GT10) with ILP reduction, CLI support, canonical example, and paper entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add PartitionIntoForests model (#833) Implement vertex arboricity / partition into forests feasibility problem (GJ GT14) with brute-force solver, CLI support, canonical example, and paper entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: resolve clippy needless_range_loop in OpenShopScheduling ILP Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: use i32 instead of usize for MinimumTardinessSequencing weight parameter Replace standalone `usize` weight type with `i32`, which integrates into the existing One → i32 → f64 variant hierarchy. This enables natural edges between MinimumTardinessSequencing<One> and <i32> variants in the reduction graph. Remove now-unnecessary WeightElement and VariantParam impls for usize from types.rs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add 24 new problem models with tests, paper entries, and CLI support Models span all categories: graph (10), formula (3), algebraic (3), set (1), and misc (7). Each model includes unit tests (7-19 per model), canonical examples, paper problem-def entries, and CLI create handlers. Also fixes: Typst compile error in MinimumMatrixDomination example, missing bouchez2006 bib entry, sect→inter deprecation warning. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: resolve clippy needless_range_loop in MinimumWeightSolutionToLinearEquations Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: code quality improvements for batch models - Fix feasible_register_assignment: reject num_registers==0 with vertices, correct complexity from num_vertices^2*2^num_vertices to factorial(num_vertices) - Fix numerical_3_dimensional_matching complexity: 3^num_groups -> num_groups^(2*num_groups) - Fix subset_product complexity: 2^(num_elements/2) -> 2^num_elements - Extract duplicated config_to_assignment to shared formula/mod.rs utility - Use is_disjoint() in minimum_intersection_graph_basis - Remove redundant is_valid_solution from ThreeDimensionalMatching - Gate SubsetProduct::new_unchecked with #[cfg(test)] Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: improve code quality across batch models - Cache globally_dead in NonLivenessFreePetriNet constructor (was recomputed on every evaluate() call) - Precompute dependencies/dependents in FeasibleRegisterAssignment constructor (was rebuilt on every is_feasible() call) - Remove dead has_input vector in NonLivenessFreePetriNet::enabled_transitions - Extract shared BigUint serde modules from SubsetSum/SubsetProduct into biguint_serde.rs (was duplicated verbatim in both files) - Add early exit in SubsetProduct::evaluate when product exceeds target - Single-pass grouping in MinimumCoveringByCliques::is_valid_cover (was O(max_group * num_edges), now O(num_edges)) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address agentic review findings for PR #960 Must-fix: - S1: Add 4 missing re-exports in models/mod.rs and lib.rs prelude (QuadraticCongruences, OpenShopScheduling, PreemptiveScheduling, SequencingWithDeadlinesAndSetUpTimes) - S2: Add OpenShopScheduling CLI create handler - S3: Fix DirectedHamiltonianPath→ILP overhead (2n→3n constraints) - S4/Q1: Fix PreemptiveScheduling→ILP overhead (num_tasks→d_max) - S5: Fix SequencingWithDeadlinesAndSetUpTimes→ILP overhead (3*(n-1) → n^2*(n-1) switch detection constraints) Should-fix: - S7: Fix MinimumInternalMacroDataCompression→ILP overhead (2n+1 → n+1 constraints) - Q2: Fix setup_times field description ("away from" → "to") - Q3: Extract duplicated decode_permutation to shared misc/mod.rs Low: - A1: Remove unused EquilibriumPoint import in create.rs - A2: Fix redundant closure in create.rs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0f51be6 commit 183b19a

112 files changed

Lines changed: 19312 additions & 371 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/paper/reductions.typ

Lines changed: 1418 additions & 3 deletions
Large diffs are not rendered by default.

docs/paper/references.bib

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
@inproceedings{bouchez2006,
2+
author = {Florent Bouchez and Alain Darte and Christophe Guillon and Fabrice Rastello},
3+
title = {Register Allocation: What Does the {NP}-Completeness Proof of {Chaitin} et al. Really Prove?},
4+
booktitle = {Languages and Compilers for Parallel Computing (LCPC)},
5+
series = {LNCS},
6+
volume = {4382},
7+
pages = {283--298},
8+
year = {2006},
9+
publisher = {Springer},
10+
doi = {10.1007/978-3-540-72521-3_21}
11+
}
12+
113
@article{sethi1975,
214
author = {Ravi Sethi},
315
title = {Complete Register Allocation Problems},
@@ -658,6 +670,17 @@ @article{aspvall1979
658670
doi = {10.1016/0020-0190(79)90002-4}
659671
}
660672

673+
@article{lichtenstein1982,
674+
author = {David Lichtenstein},
675+
title = {Planar Formulae and Their Uses},
676+
journal = {SIAM Journal on Computing},
677+
volume = {11},
678+
number = {2},
679+
pages = {329--343},
680+
year = {1982},
681+
doi = {10.1137/0211025}
682+
}
683+
661684
@inproceedings{hansen2019,
662685
author = {Thomas Dueholm Hansen and Haim Kaplan and Or Zamir and Uri Zwick},
663686
title = {Faster $k$-{SAT} Algorithms Using Biased-{PPSZ}},
@@ -1570,3 +1593,25 @@ @article{Murty1972
15701593
pages = {326--370},
15711594
doi = {10.1007/BF01584550}
15721595
}
1596+
1597+
@article{gonzalez1976,
1598+
author = {Teofilo Gonzalez and Sartaj Sahni},
1599+
title = {Open Shop Scheduling to Minimize Finish Time},
1600+
journal = {Journal of the ACM},
1601+
volume = {23},
1602+
number = {4},
1603+
pages = {665--679},
1604+
year = {1976},
1605+
doi = {10.1145/321978.321985}
1606+
}
1607+
1608+
@article{yannakakis1980,
1609+
author = {Mihalis Yannakakis and Fanica Gavril},
1610+
title = {Edge Dominating Sets in Graphs},
1611+
journal = {SIAM Journal on Applied Mathematics},
1612+
volume = {38},
1613+
number = {3},
1614+
pages = {364--372},
1615+
year = {1980},
1616+
doi = {10.1137/0138030}
1617+
}

problemreductions-cli/src/cli.rs

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ Flags by problem type:
218218
MIS, MVC, MaxClique, MinDomSet --graph, --weights
219219
MaxCut, MaxMatching, TSP, BottleneckTravelingSalesman --graph, --edge-weights
220220
LongestPath --graph, --edge-lengths, --source-vertex, --target-vertex
221+
HamiltonianPathBetweenTwoVertices --graph, --source-vertex, --target-vertex
221222
ShortestWeightConstrainedPath --graph, --edge-lengths, --edge-weights, --source-vertex, --target-vertex, --weight-bound
222223
MaximalIS --graph, --weights
223224
SAT, NAESAT --num-vars, --clauses
@@ -227,6 +228,7 @@ Flags by problem type:
227228
KColoring --graph, --k
228229
KClique --graph, --k
229230
MinimumMultiwayCut --graph, --terminals, --edge-weights
231+
MonochromaticTriangle --graph
230232
PartitionIntoTriangles --graph
231233
GeneralizedHex --graph, --source, --sink
232234
IntegralFlowWithMultipliers --arcs, --capacities, --source, --sink, --multipliers, --requirement
@@ -247,10 +249,17 @@ Flags by problem type:
247249
BinPacking --sizes, --capacity
248250
CapacityAssignment --capacities, --cost-matrix, --delay-matrix, --cost-budget, --delay-budget
249251
ProductionPlanning --num-periods, --demands, --capacities, --setup-costs, --production-costs, --inventory-costs, --cost-bound
252+
SubsetProduct --sizes, --target
250253
SubsetSum --sizes, --target
254+
Numerical3DimensionalMatching --w-sizes, --x-sizes, --y-sizes, --bound
255+
Betweenness --n, --sets (triples a,b,c)
256+
CyclicOrdering --n, --sets (triples a,b,c)
251257
ThreePartition --sizes, --bound
258+
DynamicStorageAllocation --release-times, --deadlines, --sizes, --capacity
252259
KthLargestMTuple --sets, --k, --bound
260+
QuadraticCongruences --coeff-a, --coeff-b, --coeff-c
253261
QuadraticDiophantineEquations --coeff-a, --coeff-b, --coeff-c
262+
SimultaneousIncongruences --pairs (semicolon-separated a,b pairs)
254263
SumOfSquaresPartition --sizes, --num-groups
255264
ExpectedRetrievalCost --probabilities, --num-sectors
256265
PaintShop --sequence
@@ -260,6 +269,7 @@ Flags by problem type:
260269
EnsembleComputation --universe, --sets, --budget
261270
ComparativeContainment --universe, --r-sets, --s-sets [--r-weights] [--s-weights]
262271
X3C (ExactCoverBy3Sets) --universe, --sets (3 elements each)
272+
3DM (ThreeDimensionalMatching) --universe, --sets (triples w,x,y)
263273
SetBasis --universe, --sets, --k
264274
MinimumCardinalityKey --num-attributes, --dependencies
265275
PrimeAttributeName --universe, --deps, --query
@@ -312,16 +322,21 @@ Flags by problem type:
312322
RectilinearPictureCompression --matrix (0/1), --k
313323
SchedulingWithIndividualDeadlines --n, --num-processors/--m, --deadlines [--precedence-pairs]
314324
SequencingToMinimizeMaximumCumulativeCost --costs [--precedence-pairs]
325+
SequencingToMinimizeTardyTaskWeight --sizes, --weights, --deadlines
315326
SequencingToMinimizeWeightedCompletionTime --lengths, --weights [--precedence-pairs]
316327
SequencingToMinimizeWeightedTardiness --sizes, --weights, --deadlines, --bound
328+
SequencingWithDeadlinesAndSetUpTimes --sizes, --deadlines, --compilers, --setup-times
317329
MinimumExternalMacroDataCompression --string, --pointer-cost [--alphabet-size]
330+
MinimumInternalMacroDataCompression --string, --pointer-cost [--alphabet-size]
318331
SCS --strings [--alphabet-size]
319332
StringToStringCorrection --source-string, --target-string, --bound [--alphabet-size]
320333
D2CIF --arcs, --capacities, --source-1, --sink-1, --source-2, --sink-2, --requirement-1, --requirement-2
321334
MinimumDummyActivitiesPert --arcs [--num-vertices]
335+
FeasibleRegisterAssignment --arcs, --assignment, --k [--num-vertices]
322336
RegisterSufficiency --arcs, --bound [--num-vertices]
323337
CBQ --domain-size, --relations, --conjuncts-spec
324338
IntegerExpressionMembership --expression (JSON), --target
339+
MinimumGeometricConnectedDominatingSet --positions (float x,y pairs), --radius
325340
ILP, CircuitSAT (via reduction only)
326341
327342
Geometry graph variants (use slash notation, e.g., MIS/KingsSubgraph):
@@ -469,7 +484,7 @@ pub struct CreateArgs {
469484
/// Random seed for reproducibility
470485
#[arg(long)]
471486
pub seed: Option<u64>,
472-
/// Target value (for Factoring and SubsetSum)
487+
/// Target value (for Factoring, SubsetSum, and SubsetProduct)
473488
#[arg(long)]
474489
pub target: Option<String>,
475490
/// Bits for first factor (for Factoring); also accepted as a processor-count alias for scheduling create commands
@@ -589,6 +604,9 @@ pub struct CreateArgs {
589604
/// Upper bound on total path weight
590605
#[arg(long)]
591606
pub weight_bound: Option<i32>,
607+
/// Upper bound on tree diameter (in edges) for BoundedDiameterSpanningTree
608+
#[arg(long)]
609+
pub diameter_bound: Option<usize>,
592610
/// Upper bound on total inter-partition arc cost
593611
#[arg(long)]
594612
pub cost_bound: Option<i32>,
@@ -755,6 +773,12 @@ pub struct CreateArgs {
755773
/// Number of sectors for ExpectedRetrievalCost
756774
#[arg(long)]
757775
pub num_sectors: Option<usize>,
776+
/// Compiler index for each task in SequencingWithDeadlinesAndSetUpTimes (comma-separated, e.g., "0,1,0,1,0")
777+
#[arg(long)]
778+
pub compilers: Option<String>,
779+
/// Setup times per compiler for SequencingWithDeadlinesAndSetUpTimes (comma-separated, e.g., "1,2")
780+
#[arg(long)]
781+
pub setup_times: Option<String>,
758782
/// Source string for StringToStringCorrection (comma-separated symbol indices, e.g., "0,1,2,3")
759783
#[arg(long)]
760784
pub source_string: Option<String>,
@@ -767,15 +791,39 @@ pub struct CreateArgs {
767791
/// Expression tree for IntegerExpressionMembership (JSON, e.g., '{"Sum":[{"Atom":1},{"Atom":2}]}')
768792
#[arg(long)]
769793
pub expression: Option<String>,
770-
/// Coefficient a for QuadraticDiophantineEquations (coefficient of x²)
794+
/// Equations for AlgebraicEquationsOverGF2 (semicolon-separated polynomials, each a colon-separated list of monomials, each a comma-separated list of variable indices; empty monomial = constant 1; e.g., "0,1:2;1,2:0:;0:1:2:")
795+
#[arg(long)]
796+
pub equations: Option<String>,
797+
/// Register assignment for FeasibleRegisterAssignment (comma-separated register indices, e.g., "0,1,0,0")
798+
#[arg(long)]
799+
pub assignment: Option<String>,
800+
/// Coefficient/parameter a for QuadraticCongruences (residue target) or QuadraticDiophantineEquations (coefficient of x²)
771801
#[arg(long)]
772802
pub coeff_a: Option<u64>,
773-
/// Coefficient b for QuadraticDiophantineEquations (coefficient of y)
803+
/// Coefficient/parameter b for QuadraticCongruences (modulus) or QuadraticDiophantineEquations (coefficient of y)
774804
#[arg(long)]
775805
pub coeff_b: Option<u64>,
776-
/// Constant c for QuadraticDiophantineEquations (right-hand side of ax² + by = c)
806+
/// Constant c for QuadraticCongruences (search-space bound) or QuadraticDiophantineEquations (right-hand side of ax² + by = c)
777807
#[arg(long)]
778808
pub coeff_c: Option<u64>,
809+
/// Incongruence pairs for SimultaneousIncongruences (semicolon-separated "a,b" pairs, e.g., "2,2;1,3;2,5;3,7")
810+
#[arg(long)]
811+
pub pairs: Option<String>,
812+
/// W-set sizes for Numerical3DimensionalMatching (comma-separated, e.g., "4,5")
813+
#[arg(long)]
814+
pub w_sizes: Option<String>,
815+
/// X-set sizes for Numerical3DimensionalMatching (comma-separated, e.g., "4,5")
816+
#[arg(long)]
817+
pub x_sizes: Option<String>,
818+
/// Y-set sizes for Numerical3DimensionalMatching (comma-separated, e.g., "5,7")
819+
#[arg(long)]
820+
pub y_sizes: Option<String>,
821+
/// Initial marking for NonLivenessFreePetriNet (comma-separated tokens per place, e.g., "1,0,0,0")
822+
#[arg(long)]
823+
pub initial_marking: Option<String>,
824+
/// Output arcs (transition-to-place) for NonLivenessFreePetriNet (e.g., "0>1,1>2,2>3")
825+
#[arg(long)]
826+
pub output_arcs: Option<String>,
779827
}
780828

781829
#[derive(clap::Args)]

0 commit comments

Comments
 (0)