Commit 61f059c
feat: add 20 problem models with ILP rules (#976)
* feat: add Maximum2Satisfiability model (#807)
MAX-2-SAT optimization problem — maximize satisfied 2-literal clauses.
Includes model, tests, CLI create support, canonical example, and paper entry.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add Maximum2Satisfiability → ILP reduction rule (#961)
Direct ILP formulation for MAX-2-SAT: binary clause indicators with
linking constraints. Includes closed-loop tests, ILP solver verification,
canonical example, and paper entry.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumEdgeCostFlow model and ILP rule (#810, #962)
Fixed-charge network flow problem: minimize total price of arcs with
nonzero flow subject to capacity, conservation, and flow requirement.
ILP formulation uses integer flow + binary indicator variables.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MaximumDomaticNumber model and ILP rule (#878, #963)
Maximum domatic number: partition vertices into maximum number of
disjoint dominating sets. ILP uses n²+n binary variables with
partition, domination, and linking constraints.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumMetricDimension model and ILP rule (#880, #964)
Metric dimension: minimum resolving set where all vertices have
distinct distance vectors. ILP uses n binary variables with
n*(n-1)/2 pair-distinguishing constraints from BFS distances.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MaximumLeafSpanningTree model and ILP rule (#897, #965)
Edge-selection spanning tree problem maximizing leaf count. ILP uses
single-commodity flow for connectivity with leaf-detection constraints.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumGraphBandwidth model and ILP rule (#876)
Permutation-based graph bandwidth minimization: find vertex ordering
minimizing maximum edge stretch. ILP uses assignment variables with
position-linking and edge-stretch constraints.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumMatrixCover model and ILP rule (#931, #971)
Quadratic form minimization over ±1 sign assignments. ILP uses
McCormick linearization with auxiliary variables for bilinear terms.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MaximumLikelihoodRanking model and ILP rule (#930, #969)
Permutation-based ranking to minimize disagreement cost in comparison
matrix. ILP uses pairwise ordering variables with transitivity constraints.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumWeightDecoding model and ILP rule (#923, #968)
GF(2) minimum-weight codeword problem: find binary vector with minimum
Hamming weight satisfying Hx ≡ s (mod 2). ILP linearizes modular
constraints with integer slack variables.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add Clustering model (#927)
Distance-based clustering feasibility problem: partition elements into
≤K clusters with all intra-cluster distances ≤ B. NP-complete for K≥3.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumWeightAndOrGraph model (#933)
AND/OR DAG solution subgraph: minimize arc weight subject to AND
(all children) and OR (at least one child) gate constraints.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add NumericalMatchingWithTargetSums model and ILP rule (#817)
Bipartite matching with target pair sums. ILP creates variables only
for compatible (x_i, y_j, B_k) triples where sizes sum to target.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumAxiomSet model (#869)
Deductive closure minimization: find smallest axiom subset whose
iterative closure under implication rules yields all true sentences.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumFaultDetectionTestSet model (#935)
DAG fault detection: find minimum input-output path set covering all
vertices. Uses BFS reachability for coverage computation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumRegisterSufficiencyForLoops model (#873)
Circular arc graph coloring for loop register allocation: assign
registers minimizing count with no two conflicting variables sharing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumCapacitatedSpanningTree model and ILP rule (#901, #966)
Capacitated spanning tree: minimize edge weight with subtree requirement
constraints. ILP uses requirement-weighted flow for connectivity and
capacity enforcement.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add OptimumCommunicationSpanningTree model and ILP rule (#906, #967)
Communication spanning tree: minimize weighted path-cost sum over
vertex pairs. ILP uses multi-commodity flow for path routing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MaxCut/SimpleGraph/One variant (MaximumBipartiteSubgraph alias) (#887)
Registers the unit-weight MaxCut variant with alias MaximumBipartiteSubgraph.
Complexity: O*(2^(0.7907n)) via Williams 2004.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add SquareTiling model (#820)
Wang tiling: place tile types on N×N grid with matching edge colors.
NP-complete via reduction from Directed Hamiltonian Path.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add ThreeMatroidIntersection model (#851)
Common independent set in three partition matroids: find K elements
independent in all three. NP-complete via 3-Dimensional Matching.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: resolve needless_range_loop clippy warnings on Rust 1.94
Use iterator enumerate() instead of range indexing in clustering
validation, likelihood ranking ILP objective, and matrix cover ILP.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumCodeGenerationOneRegister model (#900)
One-register machine code generation: find minimum instruction sequence
(LOAD/STORE/OP) to evaluate expression DAG. Uses permutation config
for evaluation order with greedy register simulation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumCodeGenerationUnlimitedRegisters model (#902)
Unlimited-register 2-address code generation: minimize instructions
(OPs + copies) where left operand register is destroyed by each OP.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumCodeGenerationParallelAssignments model (#903)
Parallel assignment scheduling: find execution ordering minimizing
backward dependencies where overwritten variables are still needed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumDecisionTree model (#932)
Object identification via binary tests: find decision tree minimizing
total external path length. Config encodes flattened complete binary
tree with test assignments at internal nodes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add MinimumDisjunctiveNormalForm model (#936)
Two-level logic minimization: find minimum-term DNF via Quine-McCluskey
prime implicant enumeration then minimum set cover. Config selects
subset of precomputed prime implicants covering all minterms.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add VertexCover decision problem (#986)
Decision version of MinimumVertexCover: given graph G and threshold k,
determine whether a vertex cover of size ≤ k exists. One of Karp's
21 NP-complete problems.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: simplify review — remove duplication, precompute, improve efficiency
- MinimumDecisionTree: remove redundant second traversal and dead
`object_placed` state in simulate(), use HashSet for leaf uniqueness
- VertexCover: reuse `is_vertex_cover_config` from MinimumVertexCover
instead of duplicating the covering check
- Clustering: extract `is_valid_partition` helper, fix `&Vec` return
type to `&[Vec]`, use single-pass cluster grouping
- MinimumDisjunctiveNormalForm: use HashSet for QMC dedup (O(1) vs
O(n)), drop unused covered-minterms tracking
- MinimumMetricDimension: precompute all-pairs BFS distance matrix
in constructor to avoid redundant BFS per evaluate() call
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add missing paper entries for 5 ILP reduction rules
Added problem-def + reduction-rule entries for MaximumDomaticNumber,
MinimumMetricDimension, MinimumGraphBandwidth, MinimumCapacitatedSpanningTree.
Added reduction-rule entry for MinimumMatrixCover.
Fixed QMC prime implicant ordering to be deterministic (sorted).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: harden ILP reductions, DRY bfs_distances, add CLI create for new models
- Fix MaximumDomaticNumber ILP linking constraints (per-vertex x_{v,i} ≤ y_i)
and update doc comment + overhead formula to match
- Add bounds checking in MaximumDomaticNumber::evaluate_partition
- Remove duplicate bfs_distances from MetricDimension ILP, reuse public fn
- Strengthen MinimumGraphBandwidth ILP tests with exact value assertions
- Add CLI create support for VertexCover, MinimumDecisionTree,
MinimumDisjunctiveNormalForm, SquareTiling
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 423506c commit 61f059c
89 files changed
Lines changed: 15151 additions & 60 deletions
File tree
- docs/paper
- problemreductions-cli/src
- commands
- src
- models
- algebraic
- formula
- graph
- misc
- set
- rules
- unit_tests
- models
- algebraic
- formula
- graph
- misc
- set
- rules
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
13 | 34 | | |
14 | 35 | | |
15 | 36 | | |
| |||
1615 | 1636 | | |
1616 | 1637 | | |
1617 | 1638 | | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
| 236 | + | |
235 | 237 | | |
236 | 238 | | |
| 239 | + | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
| |||
247 | 250 | | |
248 | 251 | | |
249 | 252 | | |
| 253 | + | |
250 | 254 | | |
251 | 255 | | |
252 | 256 | | |
253 | 257 | | |
| 258 | + | |
254 | 259 | | |
255 | 260 | | |
256 | 261 | | |
| |||
270 | 275 | | |
271 | 276 | | |
272 | 277 | | |
| 278 | + | |
273 | 279 | | |
274 | 280 | | |
275 | 281 | | |
| |||
284 | 290 | | |
285 | 291 | | |
286 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
287 | 296 | | |
288 | 297 | | |
289 | 298 | | |
| |||
333 | 342 | | |
334 | 343 | | |
335 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
336 | 351 | | |
337 | 352 | | |
338 | 353 | | |
339 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
340 | 358 | | |
341 | 359 | | |
342 | 360 | | |
| |||
547 | 565 | | |
548 | 566 | | |
549 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
550 | 571 | | |
551 | 572 | | |
552 | 573 | | |
| |||
631 | 652 | | |
632 | 653 | | |
633 | 654 | | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
634 | 661 | | |
635 | 662 | | |
636 | 663 | | |
| |||
824 | 851 | | |
825 | 852 | | |
826 | 853 | | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
827 | 899 | | |
828 | 900 | | |
829 | 901 | | |
| |||
0 commit comments