Remove weight type parameter from CircuitSAT and KColoring#56
Merged
Remove weight type parameter from CircuitSAT and KColoring#56
Conversation
…BO example Create docs/paper/lib.typ with reusable graph drawing functions (draw-graph, petersen-graph, house-graph, octahedral-graph, draw-grid-graph, draw-triangular-graph) and import it from reductions.typ. Add a featured KColoring→QUBO example with a colored house graph visualization and a 4-step tutorial walkthrough (encode, one-hot penalty, edge conflict, verify). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CircuitSAT and KColoring are satisfaction problems (Metric = bool), not optimization problems, so they should not have a weight type parameter W. - CircuitSAT: remove W, simplify from CircuitSAT<W> to CircuitSAT - KColoring: remove W, simplify from KColoring<K, G, W> to KColoring<K, G> - Fix #[reduction] macro: check second type param is actually a weight type before treating it as one (fixes KColoring<K, SimpleGraph> being misinterpreted as having weight "SimpleGraph") - Update all reduction rules, tests, examples, benchmarks - Regenerate reduction_graph.json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dynamic variant extraction using fn pointers instead of static inference from type parameters. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…to-pr skill Move "Adding a Reduction Rule" and "Adding a Model" procedural sections from CLAUDE.md into the issue-to-pr skill's plan-writing step. CLAUDE.md now contains only global rules and reference; the skill contains actionable pipelines keyed by issue type ([Rule] and [Model]). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add natural variant reduction design and implementation plans - Expand unit tests with variant checking and edge cases - Update paper with streamlined reduction content - Update examples with improved structure - Update issue template and README Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
==========================================
+ Coverage 96.93% 96.95% +0.02%
==========================================
Files 176 176
Lines 25337 25386 +49
==========================================
+ Hits 24560 24614 +54
+ Misses 777 772 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace hardcoded ("graph", ...), ("weight", ...) variant fields in the
#[reduction] macro with fn pointers that call Problem::variant() at
runtime. This makes Problem::variant() the single source of truth for
variant fields, fixing disconnected KColoring and KSatisfiability nodes
in the reduction graph.
Key changes:
- ReductionEntry/ConcreteVariantEntry use fn pointers for variants
- Macro substitutes usize::MAX for const generics (maps to "N")
- Added "k" field support in is_variant_reducible() for natural edges
- KColoring[k=3] → KColoring[k=N] → ILP/QUBO now properly connected
- KSatisfiability[k=2,3] → KSatisfiability[k=N] now properly connected
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CircuitSATandKColoring— these problems have no meaningful weight semantics, so the genericWparameter was unnecessary complexitydocs/paper/lib.typ) and tutorial-style KColoring→QUBO example in the paperdocs/plans/2026-02-13-reduction-macro-redesign-design.md).claude/— make CLAUDE.md purely declarative (architecture, conventions, naming) and move action pipelines into theissue-to-prskill's plan-writing stepTest plan
make testpasses — all existing tests updated for removed type parametersmake clippypassesmake examples)make paper)🤖 Generated with Claude Code