Skip to content

feat: add 20 problem models with ILP rules#976

Merged
isPANN merged 32 commits intomainfrom
feat/batch-models
Apr 1, 2026
Merged

feat: add 20 problem models with ILP rules#976
isPANN merged 32 commits intomainfrom
feat/batch-models

Conversation

@isPANN
Copy link
Copy Markdown
Collaborator

@isPANN isPANN commented Apr 1, 2026

Summary

  • Add 26 new problem models from Garey & Johnson with full implementations (model, tests, CLI create, paper entry, canonical examples)
  • Add 12 direct ILP reduction rules for models that claim ILP solvability
  • Add 1 variant registration (MaxCut/SimpleGraph/One as MaximumBipartiteSubgraph alias)

Closes #807, closes #810, closes #817, closes #820, closes #851, closes #869, closes #873, closes #876, closes #878, closes #880, closes #887, closes #897, closes #900, closes #901, closes #902, closes #903, closes #906, closes #923, closes #927, closes #930, closes #931, closes #932, closes #933, closes #935, closes #936, closes #986

Closes #961, closes #962, closes #963, closes #964, closes #965, closes #966, closes #967, closes #968, closes #969, closes #971

Models Added

Issue Model Category ILP Rule
#807 Maximum2Satisfiability formula #961
#810 MinimumEdgeCostFlow graph #962
#817 NumericalMatchingWithTargetSums misc
#820 SquareTiling misc
#851 ThreeMatroidIntersection set
#869 MinimumAxiomSet misc
#873 MinimumRegisterSufficiencyForLoops misc
#876 MinimumGraphBandwidth graph
#878 MaximumDomaticNumber graph #963
#880 MinimumMetricDimension graph #964
#887 MaximumBipartiteSubgraph (MaxCut/One) graph
#897 MaximumLeafSpanningTree graph #965
#900 MinimumCodeGenerationOneRegister misc
#901 MinimumCapacitatedSpanningTree graph #966
#902 MinimumCodeGenerationUnlimitedRegisters misc
#903 MinimumCodeGenerationParallelAssignments misc
#906 OptimumCommunicationSpanningTree misc #967
#923 MinimumWeightDecoding algebraic #968
#927 Clustering misc
#930 MaximumLikelihoodRanking misc #969
#931 MinimumMatrixCover algebraic #971
#932 MinimumDecisionTree misc
#933 MinimumWeightAndOrGraph misc
#935 MinimumFaultDetectionTestSet misc
#936 MinimumDisjunctiveNormalForm misc
#986 VertexCover graph

Not included: #934 (FaultDetectionInLogicCircuits) — moved to Low Priority; the ∀∃ quantifier structure does not fit Problem::evaluate() naturally.

Per-model checklist

Each model includes:

  • Problem struct with Problem trait impl
  • ProblemSchemaEntry registration
  • declare_variants! with verified complexity
  • Canonical model example (example-db)
  • Unit tests (≥3 per model, typically 9-17)
  • Paper entry in docs/paper/reductions.typ
  • ILP reduction rule when issue claims ILP solvability

Test plan

  • make check (fmt + clippy + test) passes
  • make paper compiles
  • cargo test --features "ilp-highs example-db" --workspace passes
  • All 12 ILP rules verified with ILPSolver closed-loop tests

🤖 Generated with Claude Code

isPANN and others added 21 commits March 31, 2026 16:57
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
…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>
…ias) (#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>
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>
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>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 99.23926% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.12%. Comparing base (423506c) to head (f34c852).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/models/misc/minimum_weight_and_or_graph.rs 94.40% 8 Missing ⚠️
src/models/graph/minimum_edge_cost_flow.rs 95.23% 6 Missing ⚠️
src/models/misc/minimum_disjunctive_normal_form.rs 95.83% 6 Missing ⚠️
...rc/models/misc/minimum_fault_detection_test_set.rs 96.53% 6 Missing ⚠️
...models/misc/optimum_communication_spanning_tree.rs 96.40% 6 Missing ⚠️
src/models/graph/vertex_cover.rs 91.66% 4 Missing ⚠️
src/models/misc/minimum_decision_tree.rs 95.50% 4 Missing ⚠️
src/models/graph/maximum_domatic_number.rs 97.33% 2 Missing ⚠️
...isc/minimum_code_generation_unlimited_registers.rs 98.91% 2 Missing ⚠️
...els/misc/minimum_register_sufficiency_for_loops.rs 97.56% 2 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #976      +/-   ##
==========================================
+ Coverage   98.03%   98.12%   +0.09%     
==========================================
  Files         784      858      +74     
  Lines       82310    89004    +6694     
==========================================
+ Hits        80695    87338    +6643     
- Misses       1615     1666      +51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

isPANN and others added 8 commits April 1, 2026 09:53
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>
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>
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>
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>
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>
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>
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>
isPANN and others added 2 commits April 1, 2026 19:46
…fficiency

- 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>
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a large batch of new Garey & Johnson problem models and several direct ILP reduction rules, along with unit tests and CLI/paper/example-db wiring, to expand the library’s model/reduction coverage (including an alias registration for MaxCut as MaximumBipartiteSubgraph).

Changes:

  • Introduces multiple new models (graph/formula/algebraic/misc/set) with schema registration, canonical examples, and unit tests.
  • Adds several new “direct-to-ILP” reduction rules plus closed-loop ILP solver tests.
  • Extends CLI creation flags and paper bibliography entries to cover the new models/rules.

Reviewed changes

Copilot reviewed 89 out of 89 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/unit_tests/rules/optimumcommunicationspanningtree_ilp.rs Adds OCST → ILP closed-loop + structural tests.
src/unit_tests/rules/numericalmatchingwithtargetsums_ilp.rs Adds NMTS → ILP tests (closed-loop, structure, unsat).
src/unit_tests/rules/minimumweightdecoding_ilp.rs Adds MinimumWeightDecoding → ILP tests (structure/closed-loop).
src/unit_tests/rules/minimummetricdimension_ilp.rs Adds MinimumMetricDimension → ILP tests.
src/unit_tests/rules/minimumgraphbandwidth_ilp.rs Adds MinimumGraphBandwidth → ILP tests.
src/unit_tests/rules/minimumedgecostflow_ilp.rs Adds MinimumEdgeCostFlow → ILP tests.
src/unit_tests/rules/maximumdomaticnumber_ilp.rs Adds MaximumDomaticNumber → ILP tests.
src/unit_tests/rules/maximum2satisfiability_ilp.rs Adds Maximum2Satisfiability → ILP tests.
src/unit_tests/models/misc/numerical_matching_with_target_sums.rs Adds NMTS model tests (evaluate/serde/solver).
src/unit_tests/models/misc/minimum_weight_and_or_graph.rs Adds MinimumWeightAndOrGraph model tests.
src/unit_tests/models/misc/minimum_fault_detection_test_set.rs Adds MinimumFaultDetectionTestSet model tests.
src/unit_tests/models/misc/minimum_disjunctive_normal_form.rs Adds MinimumDNF model tests (PIs/coverage).
src/unit_tests/models/misc/minimum_decision_tree.rs Adds MinimumDecisionTree model tests.
src/unit_tests/models/misc/minimum_code_generation_parallel_assignments.rs Adds MinimumCodeGenerationParallelAssignments tests.
src/unit_tests/models/misc/minimum_axiom_set.rs Adds MinimumAxiomSet model tests.
src/unit_tests/models/graph/vertex_cover.rs Adds VertexCover (decision) model tests.
src/unit_tests/models/graph/minimum_metric_dimension.rs Adds MinimumMetricDimension model tests.
src/unit_tests/models/graph/minimum_edge_cost_flow.rs Adds MinimumEdgeCostFlow model tests.
src/unit_tests/models/graph/maximum_domatic_number.rs Adds MaximumDomaticNumber model tests.
src/unit_tests/models/formula/maximum_2_satisfiability.rs Adds Maximum2Satisfiability model tests.
src/rules/numericalmatchingwithtargetsums_ilp.rs Implements NMTS → ILP reduction + canonical rule example.
src/rules/mod.rs Wires new ILP rule modules + canonical rule specs aggregation.
src/rules/minimumweightdecoding_ilp.rs Implements MinimumWeightDecoding → ILP reduction + example.
src/rules/minimummetricdimension_ilp.rs Implements MinimumMetricDimension → ILP reduction + example.
src/rules/minimumgraphbandwidth_ilp.rs Implements MinimumGraphBandwidth → ILP reduction + example.
src/rules/minimumedgecostflow_ilp.rs Implements MinimumEdgeCostFlow → ILP reduction + example.
src/rules/maximumlikelihoodranking_ilp.rs Implements MaximumLikelihoodRanking → ILP reduction + example.
src/rules/maximumdomaticnumber_ilp.rs Implements MaximumDomaticNumber → ILP reduction + example.
src/rules/maximum2satisfiability_ilp.rs Implements Maximum2Satisfiability → ILP reduction + example.
src/models/set/mod.rs Registers ThreeMatroidIntersection in set module exports/specs.
src/models/mod.rs Re-exports newly added models across modules.
src/models/misc/maximum_likelihood_ranking.rs Adds MaximumLikelihoodRanking model implementation.
src/models/graph/vertex_cover.rs Adds VertexCover (decision) model implementation.
src/models/graph/minimum_vertex_cover.rs Exposes shared helper for vertex-cover validation.
src/models/graph/minimum_graph_bandwidth.rs Adds MinimumGraphBandwidth model implementation.
src/models/graph/maximum_domatic_number.rs Adds MaximumDomaticNumber model implementation.
src/models/graph/max_cut.rs Adds alias + One-weight variant registration/examples for MaxCut.
src/models/formula/mod.rs Registers Maximum2Satisfiability in formula module exports/specs.
src/models/formula/maximum_2_satisfiability.rs Adds Maximum2Satisfiability model implementation.
src/models/algebraic/mod.rs Registers MinimumWeightDecoding + MinimumMatrixCover in exports/specs.
src/models/algebraic/minimum_weight_decoding.rs Adds MinimumWeightDecoding model implementation.
src/models/algebraic/minimum_matrix_cover.rs Adds MinimumMatrixCover model implementation.
src/lib.rs Updates prelude re-exports for new models.
problemreductions-cli/src/problem_name.rs Adds explicit alias resolutions for new problem names.
problemreductions-cli/src/cli.rs Documents/defines CLI flags for new models.
docs/paper/references.bib Adds bibliography entries for newly added models.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +88 to +91

// Collect which vertices belong to each set
let mut sets: Vec<Vec<usize>> = vec![vec![]; n];
for (v, &set_idx) in config.iter().enumerate() {
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

evaluate_partition indexes sets[set_idx] for every entry in config without validating config.len() == n and set_idx < n. A malformed config can panic instead of returning Max(None). Consider early-returning None if the config length is wrong or any set index is out of range, to keep Problem::evaluate() total and consistent with other models’ validation behavior.

Suggested change
// Collect which vertices belong to each set
let mut sets: Vec<Vec<usize>> = vec![vec![]; n];
for (v, &set_idx) in config.iter().enumerate() {
// Configuration must assign each vertex to exactly one set.
if config.len() != n {
return None;
}
// Collect which vertices belong to each set
let mut sets: Vec<Vec<usize>> = vec![vec![]; n];
for (v, &set_idx) in config.iter().enumerate() {
// Each set index must be within bounds of the available sets.
if set_idx >= n {
return None;
}

Copilot uses AI. Check for mistakes.
Comment on lines +89 to +95
// Linking constraints: y_i <= Σ_v x_{v,i} for each i
// Rewritten as: Σ_v x_{v,i} - y_i >= 0
for i in 0..n {
let mut terms: Vec<(usize, f64)> = (0..n).map(|v| (v * n + i, 1.0)).collect();
terms.push((n * n + i, -1.0));
constraints.push(LinearConstraint::ge(terms, 0.0));
}
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ILP permits vertices to be assigned to a set with y_i = 0, which disables the domination constraints for that set. Since extract_solution() returns the raw set index assignment (x variables only), this can yield an invalid MaximumDomaticNumber configuration even when the ILP optimum is correct, depending on which optimal solution the solver returns. To make extraction sound, add constraints that force y_i = 1 whenever any x_{v,i} = 1 (e.g., x_{v,i} <= y_i for all v,i or Σ_v x_{v,i} - n*y_i <= 0).

Copilot uses AI. Check for mistakes.
@zazabap zazabap moved this to Review pool in Good issues Apr 1, 2026
@zazabap zazabap moved this from Review pool to Under review in Good issues Apr 1, 2026
@zazabap
Copy link
Copy Markdown
Collaborator

zazabap commented Apr 1, 2026

Agentic Review Report

Structural Check

Build Status: make check (fmt + clippy + test): PASS

Model Structural Completeness (sampled 6 of 25): MinimumMetricDimension, MinimumMatrixCover, Clustering, Maximum2Satisfiability, VertexCover, ThreeMatroidIntersection

# Check Status
1 Model file exists PASS (all 6)
2 inventory::submit! present PASS (all 6)
3 Serialize, Deserialize on struct PASS (all 6)
4 Problem trait impl PASS (all 6)
5 Aggregate value present PASS (all 6)
6 #[path = ...] test link PASS (all 6)
7 Test file exists PASS (all 6)
8 Test file has >= 3 tests PASS (all 6; counts: 11, 9, 14, 9, 10, 12)
9 Registered in category mod.rs PASS (all 6)
10 Re-exported in models/mod.rs PASS (all 6)
11 declare_variants! PASS (all 6)
12 CLI resolve_alias entry FAILVertexCover missing from problem_name.rs
13 CLI create support FAIL — 4 models missing: VertexCover, MinimumDecisionTree, MinimumDisjunctiveNormalForm, SquareTiling
14 Canonical model example PASS (all 6)
15 Paper display-name entry PASS (all 6)
16 Paper problem-def block PASS (all 6)

Rule Structural Completeness (sampled 4 of 12): minimummetricdimension_ilp, maximum2satisfiability_ilp, numericalmatchingwithtargetsums_ilp, optimumcommunicationspanningtree_ilp

# Check Status
1–10 All rule checks PASS (all 4)

Semantic Review:

  • evaluate() correctness: OK — all sampled models correctly compute their objective values
  • dims() correctness: OK — binary problems return vec![2; n], cluster problems return vec![K; n], permutation problems return vec![m; m]
  • Complexity claims: OK — MAX-2-SAT 2^(0.7905*n) matches Williams 2005; VertexCover 1.1996^n matches Chen/Kanj/Xia 2010
  • extract_solution correctness: OK — all sampled rules correctly invert the ILP variable mapping
  • Overhead accuracy: OK — manually verified constraint/variable counts for MetricDimension, MAX-2-SAT, NMTS, OCST
  • MAX-2-SAT ILP constraint formulation: OK — traced through negative literal handling, confirmed correctness

Issues Found:

  1. [medium] CLI create missing for 4 models: VertexCover, MinimumDecisionTree, MinimumDisjunctiveNormalForm, SquareTiling have no pred create support in problemreductions-cli/src/commands/create.rs. Users cannot create instances of these problems via the CLI.

  2. [medium] CLI resolve_alias missing for VertexCover: VertexCover is not listed in problemreductions-cli/src/problem_name.rs. The "VC" alias will not resolve correctly in the CLI.

  3. [low] BFS duplication: bfs_distances helper is duplicated between src/models/graph/minimum_metric_dimension.rs:34 and src/rules/minimummetricdimension_ilp.rs:18.


Quality Check

Design Principles:

  • DRY: ISSUE [medium]bfs_distances function duplicated verbatim between src/models/graph/minimum_metric_dimension.rs:34 and src/rules/minimummetricdimension_ilp.rs:18. Should be a shared utility.
  • DRY: ISSUE [low] — Permutation validation + order-building pattern (~10 lines) repeated across minimum_code_generation_one_register.rs:177, minimum_code_generation_unlimited_registers.rs:225, and similar models. A shared helper would reduce repetition.
  • DRY: OK — ILP rules share structural pattern but each has genuinely different extraction logic. Good use of rule_example_via_ilp and assert_bf_vs_ilp test helpers.
  • KISS: OK — All models are well-scoped. Code-generation models have substantial simulate methods (80–100 lines) reflecting genuine domain complexity, not over-engineering.
  • HC/LC: OK — Each model file is self-contained. Each ILP rule file follows the same clean pattern.
  • HC/LC: ISSUE [low]vertex_cover.rs:7 imports is_vertex_cover_config from minimum_vertex_cover. Good reuse but creates coupling between model files.

Test Quality:

  • ISSUE [medium]src/unit_tests/rules/minimumgraphbandwidth_ilp.rs (75 lines) has weakest coverage among ILP rules: closed-loop test asserts is_some() but never compares BF vs ILP optimal values; test_solution_extraction is near-duplicate of closed-loop test. Should verify optimal value equality and add a distinct test instance.
  • OKminimumedgecostflow_ilp.rs: exemplary with 6 tests covering structure, exact values, infeasibility, assert_bf_vs_ilp.
  • OKmaximumleafspanningtree_ilp.rs: thorough with 9 tests including multiple graph types.
  • OK — Model tests (e.g., clustering.rs with 13 tests) are comprehensive.

Consistency: OK — All 6 sampled models follow identical structural template. All 4 sampled ILP rules follow the same pattern.

Summary: Well-structured batch PR. Two medium issues (duplicated BFS, weak bandwidth test) worth addressing.


Agentic Feature Tests

Build: cargo build -p problemreductions-cli — PASS

Test 1: pred list — New Models in Catalog (6 sampled)

Model Category Listed PASS/FAIL
MinimumMatrixCover algebraic Yes PASS
Maximum2Satisfiability formula Yes PASS
MaximumLeafSpanningTree graph Yes PASS
VertexCover graph Yes PASS
Clustering misc Yes PASS
ThreeMatroidIntersection set Yes PASS

Test 2: pred show <Model> — Details Display (all 6): PASS — all show description, complexity, fields, and reductions correctly.

Test 3: pred create --example <Model> — Example Creation (all 6): PASS — valid JSON with correct type fields and reasonable data.

Test 4: pred solve — Solving Works

Model Solver Result PASS/FAIL
MinimumMatrixCover ILP Min(-20) PASS
Maximum2Satisfiability ILP Max(6) PASS
MaximumLeafSpanningTree ILP Max(4) PASS
MinimumEdgeCostFlow ILP Min(3) PASS
VertexCover brute-force Or(true) PASS
Clustering brute-force Or(true) PASS
ThreeMatroidIntersection brute-force Or(true) PASS

Test 5: pred path <Model> ILP — Reduction Paths

Rule Path found PASS/FAIL
Maximum2Satisfiability → ILP Yes (1 step) PASS
MaximumLeafSpanningTree → ILP Yes (2 steps) PASS
MinimumEdgeCostFlow → ILP Yes (2 steps) PASS
VertexCover → ILP No path (expected) PASS

Test 6: Full Test Suite: cargo test — PASS (140 doc tests, 66 lib/integration tests, 0 failures)

All 28 individual test checks PASS. No issues found.


Generated by review-pipeline

@zazabap zazabap moved this from Under review to Final review in Good issues Apr 1, 2026
Copy link
Copy Markdown
Collaborator

@zazabap zazabap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

… 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>
@isPANN isPANN merged commit 61f059c into main Apr 1, 2026
5 checks passed
@isPANN isPANN moved this from Final review to Done in Good issues Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

3 participants