Commit 2eb68fb
Simplify variant system and clean up type hierarchy (#66)
* move paper static files
* Simplify variant system: derive categories from module_path, use node indices in JSON
- Replace hardcoded `categorize_type` and `compute_doc_path` with derivation
from `ProblemSchemaEntry.module_path` via inventory lookup
- Simplify reduction_graph.json edges to use node indices instead of full objects
- Use `G::NAME` instead of `short_type_name::<G>()` in variant() for correct
graph type names (e.g. "GridGraph" not "GridGraph<i32>")
- Remove manual `register_types` function; use `Problem::NAME` directly
- Add MIS GridGraph/UnitDiskGraph reductions via unitdiskmapping module
- Update docs (introduction.md, reductions.typ) to dereference node indices
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: apply rustfmt formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Remove hardcoded fallback from #[reduction] macro, make ReduceTo impls concrete
The proc macro had a fallback path for type-generic impls that silently
hardcoded "SimpleGraph"/"Unweighted" defaults and used heuristics,
producing wrong variants (e.g., KColoring lost "k" field, MaximumSetPacking
got spurious "graph" field).
Changes:
- Macro: replace type-generic fallback with compile error, remove
source_graph/target_graph/source_weighted/target_weighted attributes,
delete dead helper functions
- Make 10 ReduceTo impls concrete across 7 reduction files (i32 or f64)
- MaximumSetPacking→QUBO: only f64 impl (i32 promotes via natural edge)
- Add ConcreteVariantEntry registrations for Unweighted variants so
natural weight-promotion edges work correctly
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add design doc: type system cleanup (WeightElement, One, SatisfactionProblem)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add implementation plan: type system cleanup (WeightElement, One, SatisfactionProblem)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add WeightElement trait and One type, remove Unweighted/Weights/NumericWeight
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: update graph problem impls to use WeightElement
Replace verbose trait bounds (Clone + Default + PartialOrd + Num + Zero
+ AddAssign + 'static) with WeightElement in Problem and
OptimizationProblem impls for all 8 graph problems. Use W::Sum as the
metric/value type and W::to_sum() for weight accumulation. Also update
5 reduction rule files that reference these graph problems.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: update set and optimization problem impls to use WeightElement
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: update reduction rule bounds to use WeightElement
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: rename Unweighted to One in variant metadata
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add SatisfactionProblem marker trait
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: cleanup remaining Unweighted references in comments
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* update example
* feat: add Triangular graph type and MIS reduction via triangular mapping
Introduces a Triangular lattice graph type (subtype of UnitDiskGraph) and
a reduction from MIS<SimpleGraph> to MIS<Triangular> using the weighted
triangular unit disk mapping, with O(n²) overhead.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: resolve PR review comments and improve test coverage
- Fix variantDefaults.weight from "Unweighted" to "One" in docs
- Update design.md weight hierarchy docs to use "One" instead of "Unweighted"
- Format variants.rs inventory::submit! as multi-line blocks
- Apply rustfmt to sat_ksat.rs macro and other files
- Add UnitDiskGraph → GridGraph reduction test for coverage
- Add Triangular Graph trait method tests for coverage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: remove manual variant registration, infer natural edges only
Remove ConcreteVariantEntry and variants.rs — reduction graph nodes now
come exclusively from explicit #[reduction] registrations. Natural edges
between same-name variants are still inferred from the subtype partial
order on graph/weight types.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: rustdoc warning for unclosed HTML tags and update CLAUDE.md
- Wrap generic types in backticks in maximumsetpacking_qubo.rs doc comment
- Update CLAUDE.md: Unweighted→One, add Triangular/WeightElement, fix variant ID docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add Triangular to design.md graph types and hierarchy
- Add Triangular to graph types table and hierarchy diagram
- Update variant discovery description to reflect automatic node inference
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add natural edge example for Triangular MIS reduction
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add natural edge test for MIS/Triangular → MIS/SimpleGraph
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add generic natural-edge reduction system
Introduce GraphCast trait, ReductionAutoCast struct, and
impl_natural_reduction! macro for declarative graph subtype
relaxation reductions. First usage: MIS<Triangular> → MIS<SimpleGraph>.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: use Petersen graph and ILP solver for natural edge closed-loop test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent ee2494d commit 2eb68fb
81 files changed
Lines changed: 2353 additions & 2549 deletions
File tree
- .claude
- skills
- docs
- paper
- static
- plans
- src
- reductions
- examples
- problemreductions-macros/src
- src
- models
- graph
- optimization
- satisfiability
- set
- specialized
- registry
- rules
- topology
- unit_tests
- models/graph
- rules
- tests/data/qubo
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 | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
64 | | - | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
71 | | - | |
| 71 | + | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
169 | | - | |
| 170 | + | |
170 | 171 | | |
171 | | - | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| |||
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
208 | | - | |
| 209 | + | |
209 | 210 | | |
210 | | - | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
851 | 852 | | |
852 | 853 | | |
853 | 854 | | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
858 | 859 | | |
859 | 860 | | |
860 | 861 | | |
| |||
884 | 885 | | |
885 | 886 | | |
886 | 887 | | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
887 | 896 | | |
888 | 897 | | |
889 | 898 | | |
| |||
897 | 906 | | |
898 | 907 | | |
899 | 908 | | |
900 | | - | |
| 909 | + | |
901 | 910 | | |
902 | 911 | | |
903 | 912 | | |
| |||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
0 commit comments