Commit 0f9db3c
feat: batch add 14 reduction rules (hard rules phase 2) (#1028)
* feat: add PartitionIntoCliques to MinimumCoveringByCliques rule
* feat: add 3SAT to RegisterSufficiency reduction (Sethi Reduction I)
Implements Sethi's Reduction I / Theorem 3.11 for KSatisfiability<K3> →
RegisterSufficiency with corrected extraction (stop at w[n], read x_pos[k],
"at most one"). Also adds RegisterSufficiency → ILP companion rule.
Closes #872
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add DecisionMinimumVertexCover to HamiltonianCircuit reduction
* feat: add DecisionMinimumDominatingSet to MinMaxMulticenter
* feat: add DecisionMinimumDominatingSet to MinimumSumMulticenter
* style: fix rustfmt formatting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add KColoring to Clustering reduction
* Add ExactCoverBy3Sets to MinimumAxiomSet reduction
* Fix MaximumLikelihoodRanking constructor validation
* fix: allow negative entries in MaximumLikelihoodRanking (c=0 skew-symmetric)
The GJ definition uses "antisymmetric" which means a_ij + a_ji = c
including c=0 (skew-symmetric with negative entries). Remove the
non-negative constraint, keep constant-sum validation. Add test for
c=0 encoding of a directed 3-cycle.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add x3c to fault detection test set reduction
* feat: add MinimumFeedbackArcSet to MaximumLikelihoodRanking reduction
* feat: add fvs to unlimited-register codegen rule
* feat: add mvc to minimum weight and/or graph reduction
* Add 3-SAT to quadratic diophantine equations reduction
* test: pin max2sat maxcut affine relation
* fix: resolve clippy warnings and test assertion after new reductions
- Fix manual_memcpy and needless_range_loop in FVS→CodeGen reduction
- Fix manual_div_ceil in QuadraticDiophantineEquations
- Allow too_many_arguments for bounded path search
- Relax find_paths_up_to test assertion for bounded search behavior
- Apply rustfmt to touched files
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add B&B solver for RegisterSufficiency, avoid slow ILP in tests
The KSat→RS canonical example builds a 70-vertex RegisterSufficiency
instance. Solving it through the RS→ILP chain (17K vars, 52K constraints)
took 50+ seconds locally and timed out CI at 56 minutes.
Add solve_exact() to RegisterSufficiency: a branch-and-bound solver with
heuristic candidate ordering (prefer vertices that free the most registers).
YES instances resolve instantly on the first greedy path without backtracking.
For NO instances the full search tree must be explored, so the ILP path is
kept for infeasibility proofs.
Test time for KSat→RS suite: 278s → 9s.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add Clustering→ILP and MinimumFaultDetectionTestSet→ILP reductions
Clustering→ILP: binary assignment variables x[i,c], exact-one-cluster
constraints per element, conflict constraints for violated distance pairs.
Feasibility formulation (minimize 0). O(n·K) variables, O(n + n²·K) constraints.
MinimumFaultDetectionTestSet→ILP: binary selection variables per input-output
pair, covering constraints requiring each internal vertex appears in at least
one selected pair's coverage set. Minimize total selected pairs.
O(|I|·|O|) variables, O(internal vertices) constraints.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: structural review fixes — overheads, paper entries, test speedup
- Fix Clustering→ILP overhead: use n*(n-1)/2 instead of n² for pair count
- Fix MFDTS→ILP overhead: num_constraints covers internal vertices only
- Add num_edges to Decision<MDS>→MinSumMulticenter overhead
- Add 3 missing paper reduction-rule entries (KSat→QDE, FVS→CodeGen, MVC→AndOrGraph)
- Rename DecisionMVC→HC test to include closed_loop
- Replace slow KSat→RS UNSAT test (ILP on 17K vars) with BF + structural check
- Add 5s test time limit rule to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: speed up BMF→ILP closed-loop test (36s → 0.01s)
Use ILP solver on target + brute force on source instead of brute-force
enumerating all 2^24 ILP configurations.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: model_specs_are_optimal stuck on DecisionMVC→HC→QA→ILP chain
The new DecisionMVC→HamiltonianCircuit reduction created a path
DecisionMVC → HC(50 verts) → QA(2500 vars) → ILP that HiGHS can't
solve in reasonable time.
Fix: try brute force first for small instances (≤2^20 configs) before
falling back to ILP via reduction. DecisionMVC with 4 vertices has
only 16 configs — instant via brute force.
Also add CLAUDE.md note: overhead expressions describe scaling, not
exact sizes — read reduce_to() code for actual sizes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add witness edge for Decision<P> → P, enabling cheaper ILP paths
Previously Decision<P> → P was aggregate-only, forcing witness-mode path
search through expensive chains (e.g., DecisionMVC → HC → QA → ILP).
Now the edge supports both witness and aggregate modes — a P-witness
meeting the bound is directly a Decision<P> witness (identity config).
- Add DecisionToOptimizationWitnessResult and ReduceTo<P> for Decision<P>
- Merge register_decision_variant! macro to emit single both() edge
- Add witness edge + canonical example for Decision<MDS<SG,One>> variant
- Update dominated rules allow-list (KSat→MVC now dominated via DecisionMVC)
- Fix CLI truncation test (MIS→QUBO path count changed due to new edges)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: paper build errors — cast QDE strings to int, fix missing optimal_value keys
- Cast a/b/c from JSON strings to int for QuadraticDiophantineEquations example
- Compute MVC→AndOrGraph target weight from arc_weights instead of missing optimal_value
- Compute FVS→CodeGen instruction count from target_config length instead of missing optimal_value
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test: add coverage for find_paths_up_to_mode_bounded
Exercises the bounded path search with tight and zero intermediate-node
limits, covering the previously-untested function body in graph.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 8cd6ac1 commit 0f9db3c
File tree
60 files changed
+5660
-291
lines changed- .claude
- docs/paper
- problemreductions-cli/tests
- src
- models
- algebraic
- formula
- graph
- misc
- rules
- unit_tests
- models
- algebraic
- misc
- rules
- tests
- suites
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
60 files changed
+5660
-291
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
| 230 | + | |
| 231 | + | |
229 | 232 | | |
230 | 233 | | |
231 | 234 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
167 | 178 | | |
168 | 179 | | |
169 | 180 | | |
| |||
242 | 253 | | |
243 | 254 | | |
244 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
245 | 278 | | |
246 | 279 | | |
247 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7642 | 7642 | | |
7643 | 7643 | | |
7644 | 7644 | | |
7645 | | - | |
| 7645 | + | |
| 7646 | + | |
| 7647 | + | |
| 7648 | + | |
| 7649 | + | |
| 7650 | + | |
| 7651 | + | |
| 7652 | + | |
| 7653 | + | |
7646 | 7654 | | |
7647 | 7655 | | |
7648 | 7656 | | |
| |||
7661 | 7669 | | |
7662 | 7670 | | |
7663 | 7671 | | |
7664 | | - | |
| 7672 | + | |
7665 | 7673 | | |
7666 | 7674 | | |
7667 | | - | |
| 7675 | + | |
7668 | 7676 | | |
7669 | 7677 | | |
7670 | 7678 | | |
7671 | 7679 | | |
7672 | 7680 | | |
7673 | 7681 | | |
7674 | | - | |
| 7682 | + | |
7675 | 7683 | | |
7676 | 7684 | | |
7677 | 7685 | | |
| |||
0 commit comments