Commit c57a131
feat: batch implement 17 reduction rules with 14 new models (#999)
* feat: add SubsetSum → Partition reduction rule (#973)
Implements the classical padding reduction from Garey & Johnson (SP12-SP13).
Handles all three cases: Σ=2T (no padding), Σ>2T (same-side extraction),
and Σ<2T (opposite-side extraction).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add NonTautology model and Satisfiability → NonTautology rule (#868)
Adds the NonTautology (DNF falsifiability) model with Value=Or, and the
De Morgan negation reduction from Satisfiability. Each CNF clause becomes
a DNF disjunct with flipped literal signs; solution extraction is identity.
Includes CLI/MCP support for NonTautology creation and example-db hooks.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add PartitionIntoCliques model and KColoring → PartitionIntoCliques rule (#844)
Adds the PartitionIntoCliques graph model (Value=Or, partitions vertices
into K cliques) and the complement-graph reduction from KColoring.
Color classes in G become cliques in the complement graph.
Includes CLI support, example-db entries, paper documentation, and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add Kernel model and 3SAT → Kernel reduction rule (#882)
Adds the Kernel model for directed graphs (Value=Or, independent + absorbing
vertex set) and Chvátal's 1973 reduction from KSatisfiability<K3>. Variable
digons encode truth assignments; directed 3-cycles with connection arcs
enforce clause satisfaction via the absorption property.
Includes CLI support, example-db entries, and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add DegreeConstrainedSpanningTree model and HamPath → DCST rule (#911)
Adds DegreeConstrainedSpanningTree graph model (Value=Or, edge-selection
configs checked for spanning tree + degree bound) and the identity reduction
from HamiltonianPath with K=2. A degree-2 spanning tree is exactly a
Hamiltonian path.
Includes CLI support, example-db entries, and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add SetSplitting model and NAE-SAT → SetSplitting rule (#382)
Adds the SetSplitting (hypergraph 2-colorability) model with Value=Or,
and the reduction from NAESatisfiability. Uses two elements per variable
(positive/negative literal) with pairing subsets to enforce complementary
assignment, plus one subset per clause to enforce non-monochromatic NAE.
Includes CLI support, paper entries, and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add SubsetProduct model and X3C → SubsetProduct rule (#388)
Adds SubsetProduct model (Value=Or, binary subset selection with product
check) and the prime-encoding reduction from ExactCoverBy3Sets. Each
universe element gets a distinct prime; each 3-set maps to the product
of its elements' primes. By FTA, subset product equals universe product
iff the selected sets form an exact cover.
Includes CLI support and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add IntegerExpressionMembership model and SubsetSum → IEM rule (#569)
Adds IntegerExpressionMembership (pick-one-per-position sum check with
Value=Or) and the shift-encoding reduction from SubsetSum. Each element
a_i creates choice set {1, a_i+1}; target K = B + n. Picking a_i+1 means
"include element"; sum equals K iff selected elements sum to B.
Includes CLI support, paper entries, and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add MinimumWeightSolutionToLinearEquations model and X3C → MWSLE rule (#860)
Adds MWSLE algebraic model (Value=Or, binary variables with linear equation
check + sparsity bound) and the incidence-matrix reduction from
ExactCoverBy3Sets. One variable per 3-set, one equation per universe element,
bound K = |U|/3. Exact cover iff equation system has K-sparse solution.
Includes CLI support, paper entries, and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add SimultaneousIncongruences model and 3SAT → SI rule (#554)
Adds SimultaneousIncongruences algebraic model (Value=Or, find x in [1..N]
satisfying all x mod m_i != r_i) and the CRT-based reduction from
KSatisfiability<K3>. Each variable gets a distinct odd prime, residues 1/2
encode true/false, other residues are forbidden, and each clause adds one
CRT-derived forbidden residue.
Includes CLI support, paper entries, and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add SequencingToMinimizeTardyTaskWeight model and Partition → SMTTW rule (#471)
Adds SequencingToMinimizeTardyTaskWeight model (Value=Min<u64>, Lehmer-coded
permutation schedules) and the common-deadline reduction from Partition.
Each element becomes a task with length=weight=size and deadline=B/2.
On-time tasks decode one partition half.
Includes CLI support and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add OpenShopScheduling model and Partition → OSS rule (#481)
Adds OpenShopScheduling model (Value=Min<u64>, Lehmer-coded permutation
schedules with active-schedule decoder) and the Gonzalez-Sahni 1976
reduction from Partition. Uses 3 machines with a special Q-job; makespan
≤3Q iff balanced partition exists.
Includes CLI support and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add NAESatisfiability → MaxCut reduction rule (#166)
Implements the Garey-Johnson-Stockmeyer 1976 reduction. Variable edges
with weight M=2m+1 force complementary partition; clause triangles with
unit weights contribute exactly 2 cut edges per NAE-satisfied clause.
Max cut ≥ nM+2m iff NAE-satisfiable.
Includes paper entry, canonical example, and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add IsomorphicSpanningTree model and HamPath → IST rule (#912)
Adds IsomorphicSpanningTree graph model (Value=Or, permutation-based
isomorphism check) and the identity reduction from HamiltonianPath with
tree T=P_n. A spanning tree isomorphic to a path is exactly a
Hamiltonian path.
Includes CLI support, updated ILP rule, and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add AlgebraicEquationsOverGF2 model and X3C → AEGF2 rule (#859)
Adds AlgebraicEquationsOverGF2 model (Value=Or, polynomial system over
GF(2) with XOR/AND evaluation) and the Fraenkel-Yesha 1977 reduction
from ExactCoverBy3Sets. Linear equations enforce odd-cover per element;
pairwise product equations forbid double-cover. Together they force
exactly-one cover.
Includes CLI support, paper entries, and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add ProductionPlanning model and Partition → PP rule (#488)
Adds ProductionPlanning model (Value=Or, lot-sizing with setup/production/
inventory costs and a total cost bound) and the Lenstra-Rinnooy Kan-Florian
1978 reduction from Partition. Element items map to production periods;
a terminal demand period consumes S/2; balanced partition iff feasible
production plan within cost bound.
Includes CLI support, paper entries, and tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add HamiltonianPathBetweenTwoVertices → LongestPath reduction rule (#359)
Copy graph with unit edge weights and same s/t vertices. A Hamiltonian
s-t path has n-1 edges = maximum possible simple path length.
Solution extraction walks selected edges from source to reconstruct
the vertex permutation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: remove stray prompt.md and implementation_log.md
These were working files from the batch implementation session,
not intended for the repository.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address PR #999 review issues
* update rules note
* docs: add Source Material section to write-rule-in-paper skill
Adds guidance to consult GitHub issues and derivation documents
as primary sources for mathematical content, rather than inventing proofs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: augment 18 paper entries with examples, citations, and pred-commands
Each reduction-rule entry now includes:
- load-example data bindings and example: true parameter
- Complexity citation (@garey1979, @karp1972, etc.)
- Worked example with pred-commands() reproducibility block
- Step-by-step verification using fixture data
Fixed entry #13 (NAE-SAT → MaxCut): proper @citation.
Fixed entry #18 (GraphPartitioning → MaxCut): completed proof
replacing $= dots$ placeholder with full derivation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add explicit GraphPartitioning name resolution for CI determinism
The inventory-based registry resolution is non-deterministic across
platforms. On CI, "GraphPartitioning" was resolving to "MaxCut" due to
registration order, causing test_create_graph_partitioning to fail.
Add explicit case-insensitive resolution, matching the pattern used
for other ambiguous problem names.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: align 3 paper entries with implemented code (Kernel, MaxCut, GraphPartitioning)
- KSatisfiability → Kernel: corrected arc count to 2n+6m, rewrote proof
to allow clause vertices in kernel matching the actual code
- NAESatisfiability → MaxCut: corrected M = m+1 (was 2m+1), fixed example
- GraphPartitioning → MaxCut: completed balance proof via P=|E|+1 penalty
All examples now use load-example() fixture data with pred-commands().
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: expand 9 paper examples with concrete fixture data and step-by-step verification
Expanded worked examples for: NAE-SAT→SetSplitting, X3C→SubsetProduct,
SubsetSum→IntegerExprMembership, X3C→MWSLE, 3SAT→SimultaneousIncongruences,
Partition→SeqMinTardyTaskWeight, Partition→OpenShopScheduling,
X3C→AlgEqOverGF2, Partition→ProductionPlanning.
Each example now shows construction with actual numbers from load-example()
fixtures and step-by-step witness verification.
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 61f059c commit c57a131
66 files changed
Lines changed: 5077 additions & 167 deletions
File tree
- .claude/skills/write-rule-in-paper
- docs/paper
- problemreductions-cli/src
- commands
- mcp
- src
- models
- algebraic
- formula
- graph
- set
- rules
- unit_tests
- models
- graph
- set
- 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.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
24 | 33 | | |
25 | 34 | | |
26 | 35 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| 227 | + | |
226 | 228 | | |
227 | 229 | | |
228 | 230 | | |
| |||
370 | 372 | | |
371 | 373 | | |
372 | 374 | | |
| 375 | + | |
373 | 376 | | |
374 | 377 | | |
375 | 378 | | |
| |||
474 | 477 | | |
475 | 478 | | |
476 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
477 | 483 | | |
478 | 484 | | |
479 | 485 | | |
| |||
484 | 490 | | |
485 | 491 | | |
486 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
487 | 496 | | |
488 | 497 | | |
489 | 498 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
657 | 659 | | |
658 | 660 | | |
659 | 661 | | |
| 662 | + | |
660 | 663 | | |
661 | 664 | | |
662 | 665 | | |
| |||
707 | 710 | | |
708 | 711 | | |
709 | 712 | | |
710 | | - | |
| 713 | + | |
711 | 714 | | |
712 | 715 | | |
713 | 716 | | |
| |||
1092 | 1095 | | |
1093 | 1096 | | |
1094 | 1097 | | |
| 1098 | + | |
1095 | 1099 | | |
1096 | 1100 | | |
1097 | 1101 | | |
| |||
1212 | 1216 | | |
1213 | 1217 | | |
1214 | 1218 | | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
1215 | 1225 | | |
1216 | 1226 | | |
1217 | 1227 | | |
| |||
1762 | 1772 | | |
1763 | 1773 | | |
1764 | 1774 | | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
1765 | 1792 | | |
1766 | 1793 | | |
1767 | 1794 | | |
| |||
2397 | 2424 | | |
2398 | 2425 | | |
2399 | 2426 | | |
2400 | | - | |
| 2427 | + | |
2401 | 2428 | | |
2402 | 2429 | | |
2403 | | - | |
2404 | | - | |
2405 | 2430 | | |
2406 | | - | |
| 2431 | + | |
2407 | 2432 | | |
2408 | 2433 | | |
2409 | 2434 | | |
| |||
7360 | 7385 | | |
7361 | 7386 | | |
7362 | 7387 | | |
| 7388 | + | |
| 7389 | + | |
| 7390 | + | |
| 7391 | + | |
| 7392 | + | |
| 7393 | + | |
| 7394 | + | |
| 7395 | + | |
| 7396 | + | |
| 7397 | + | |
| 7398 | + | |
| 7399 | + | |
| 7400 | + | |
| 7401 | + | |
| 7402 | + | |
| 7403 | + | |
| 7404 | + | |
| 7405 | + | |
| 7406 | + | |
| 7407 | + | |
| 7408 | + | |
| 7409 | + | |
7363 | 7410 | | |
7364 | 7411 | | |
7365 | 7412 | | |
| |||
9901 | 9948 | | |
9902 | 9949 | | |
9903 | 9950 | | |
| 9951 | + | |
9904 | 9952 | | |
9905 | 9953 | | |
9906 | 9954 | | |
| 9955 | + | |
9907 | 9956 | | |
9908 | 9957 | | |
9909 | 9958 | | |
| |||
10843 | 10892 | | |
10844 | 10893 | | |
10845 | 10894 | | |
| 10895 | + | |
| 10896 | + | |
| 10897 | + | |
| 10898 | + | |
| 10899 | + | |
| 10900 | + | |
| 10901 | + | |
| 10902 | + | |
| 10903 | + | |
| 10904 | + | |
| 10905 | + | |
| 10906 | + | |
| 10907 | + | |
| 10908 | + | |
| 10909 | + | |
| 10910 | + | |
| 10911 | + | |
| 10912 | + | |
| 10913 | + | |
| 10914 | + | |
| 10915 | + | |
| 10916 | + | |
| 10917 | + | |
| 10918 | + | |
| 10919 | + | |
| 10920 | + | |
| 10921 | + | |
| 10922 | + | |
| 10923 | + | |
| 10924 | + | |
| 10925 | + | |
| 10926 | + | |
| 10927 | + | |
| 10928 | + | |
| 10929 | + | |
| 10930 | + | |
| 10931 | + | |
| 10932 | + | |
| 10933 | + | |
| 10934 | + | |
| 10935 | + | |
| 10936 | + | |
| 10937 | + | |
| 10938 | + | |
| 10939 | + | |
| 10940 | + | |
| 10941 | + | |
| 10942 | + | |
| 10943 | + | |
| 10944 | + | |
| 10945 | + | |
| 10946 | + | |
| 10947 | + | |
| 10948 | + | |
| 10949 | + | |
| 10950 | + | |
| 10951 | + | |
| 10952 | + | |
| 10953 | + | |
| 10954 | + | |
| 10955 | + | |
| 10956 | + | |
| 10957 | + | |
| 10958 | + | |
| 10959 | + | |
| 10960 | + | |
| 10961 | + | |
| 10962 | + | |
| 10963 | + | |
| 10964 | + | |
| 10965 | + | |
| 10966 | + | |
| 10967 | + | |
| 10968 | + | |
| 10969 | + | |
| 10970 | + | |
| 10971 | + | |
| 10972 | + | |
| 10973 | + | |
10846 | 10974 | | |
10847 | 10975 | | |
10848 | 10976 | | |
| |||
0 commit comments