You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add QUBO test data generation script and ground truth datasets
- Add scripts/generate_qubo_tests.py using qubogen to generate QUBO
ground truth for 7 problem types: MaxCut, VertexCovering, IndependentSet,
Coloring, SetPacking, KSatisfiability (2-SAT), and ILP
- Add scripts/ Python project managed by uv (pyproject.toml, uv.lock)
- Add tests/data/qubo/*.json with brute-force optimal solutions
- Add `make qubo-testdata` target to regenerate test data
- Update .gitignore for .venv/
Ref #18
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add related projects section to README
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* update
* feat: add IndependentSet, VertexCovering, and MaxCut → QUBO reductions
Implement three problem-to-QUBO reductions with closed-loop unit tests:
- IndependentSet → QUBO: penalty formulation with P = 1 + Σw_i
- VertexCovering → QUBO: constraint penalty for uncovered edges
- MaxCut → QUBO: unconstrained cut maximization
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add KColoring, SetPacking, and KSatisfiability → QUBO reductions
Implement three more problem-to-QUBO reductions with closed-loop tests:
- KColoring → QUBO: one-hot encoding with n*K variables
- SetPacking → QUBO: IS on intersection graph structure
- KSatisfiability(K=2) → QUBO: Max-2-SAT penalty formulation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add ILP (binary) → QUBO reduction
Implement binary ILP to QUBO reduction with slack variables for
inequality constraints. Feature-gated behind `ilp`. Supports
Maximize, Minimize, and equality/inequality constraints.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add integration tests for QUBO reductions against ground truth
Add 7 integration tests comparing Rust QUBO reductions against
Python-generated ground truth JSON datasets for IS, VC, MaxCut,
KColoring, SetPacking, KSatisfiability, and ILP.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add QUBO reductions example program
Demonstrate all 7 problem-to-QUBO reductions with practical stories:
wireless towers (IS), security cameras (VC), network partitioning
(MaxCut), map coloring, delivery zones (SP), switch config (2-SAT),
and project selection (ILP).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add QUBO reduction theorems to paper, acknowledge references
- Add 7 QUBO reduction theorems with step-by-step mathematical proofs
(IS, VC, MaxCut, KColoring, SetPacking, 2-SAT, ILP → QUBO)
- Update QUBO definition to clarify upper-triangular matrix convention
- Update problem definitions with "Reduces to: QUBO" cross-references
- Add 7 rows to the summary table
- Add Acknowledgments section to README crediting ProblemReductions.jl,
UnitDiskMapping.jl, and qubogen
- Fix graph path-finding tests for new QUBO reduction edges
- Update .gitignore for pkgref/ reference packages directory
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: fix ILP slack variables, remove redundant MaxCut→QUBO, add coverage tests
- Fix ILP→QUBO slack variable signs (Le→+1, Ge→-1) and count formula
(ceil(log2(range+1)) to represent all valid slack values)
- Remove redundant MaxCut→QUBO reduction (reachable via MaxCut→SpinGlass→QUBO)
- Add round-trip tests covering ILP Ge/Le slack branches, KColoring
reversed edge ordering, and KSat reversed variable ordering
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add references for QUBO reductions (Glover 2019, Lucas 2014)
Add Glover, Kochenberger & Du (2019) "Quantum Bridge Analytics I" as
primary reference for QUBO formulations. Cite Lucas (2014) for IS, VC,
KColoring, and ILP reductions. Update summary table citations.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: reclassify QUBO reductions into penalty-method section
Move 6 QUBO reductions from "Trivial" to new "Penalty-Method QUBO
Reductions" section. Add introductory paragraph explaining the penalty
method with label for cross-referencing. Each proof now references the
shared penalty-method description. Remove gray fill from summary table
for QUBO rows.
Trivial: complement/isomorphism (IS↔VC, IS↔SP, VC→SC, Matching→SP, SG↔QUBO)
Penalty-method: IS→QUBO, VC→QUBO, KColoring→QUBO, SP→QUBO, 2SAT→QUBO, ILP→QUBO
Non-trivial: gadget-based (SAT→IS, SAT→3-Coloring, etc.)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address Copilot review - generic SetPacking, ILP slack bounds
- Make SetPacking→QUBO reduction generic over weight type W: Into<f64>
(supports both i32 and f64 weights, removing the f64→i32 truncation)
- Fix ILP slack range to use min_lhs/max_lhs for negative coefficients
- Fix duplicate variable accumulation (= → +=) in ILP constraint matrix
- Remove unused import and variable in Python test generator
- Update test comments to match corrected formulas
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Read reference implementations in the codebase (e.g., `src/rules/spinglass_qubo.rs`) to understand conventions
17
+
- Agree on scope (weighted vs unweighted, specific graph types, const generics)
18
+
2.**Generate ground truth test data** — use an existing library (e.g., Python with qubogen, qubovert, or networkx) to create small instances, reduce them, brute-force solve both sides, and export as JSON to `tests/data/<target>/`. It is recommended to download the relevant package and check the existing tests to understand how to construct tests. To generate the test data, you can use the following command:
19
+
```bash
20
+
# Example: generate QUBO test data
21
+
cd scripts && uv run python generate_qubo_tests.py
22
+
```
23
+
3.**Create a practical example** — design a small, explainable instance for `examples/` (e.g., "wireless tower placement" for IndependentSet, "map coloring" for Coloring). This example will also appear in the `docs/paper/reductions.typ`.
24
+
4.**Write the implementation plan** — save to `docs/plans/` using `superpowers:writing-plans`. The plan must include implementation details from the brainstorming session (formulas, penalty terms, matrix construction, variable indexing).
25
+
8
26
## 1. Implementation
9
-
Create `src/rules/<source>_<target>.rs`:
27
+
28
+
Create `src/rules/<source>_<target>.rs` following the pattern in `src/rules/spinglass_qubo.rs`:
Copy file name to clipboardExpand all lines: .claude/skills/issue-to-pr.md
+18-34Lines changed: 18 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,13 +19,15 @@ Convert a GitHub issue into an actionable PR with a plan that auto-triggers Clau
19
19
digraph issue_to_pr {
20
20
"Receive issue number" [shape=box];
21
21
"Fetch issue with gh" [shape=box];
22
+
"Check the rules to follow" [shape=box];
22
23
"Brainstorm with user" [shape=box];
23
24
"Write plan file" [shape=box];
24
25
"Create branch and PR" [shape=box];
25
26
"PR triggers [action]" [shape=doublecircle];
26
27
27
28
"Receive issue number" -> "Fetch issue with gh";
28
-
"Fetch issue with gh" -> "Brainstorm with user";
29
+
"Fetch issue with gh" -> "Check the rules to follow";
30
+
"Check the rules to follow" -> "Brainstorm with user";
29
31
"Brainstorm with user" -> "Write plan file";
30
32
"Write plan file" -> "Create branch and PR";
31
33
"Create branch and PR" -> "PR triggers [action]";
@@ -53,45 +55,27 @@ Present issue summary to user.
53
55
54
56
**REQUIRED:** Invoke `superpowers:brainstorming` skill with the issue context (if superpowers plugin is available). Otherwise, conduct a manual brainstorming discussion with the user.
55
57
56
-
This ensures:
57
-
- User intent is clarified
58
-
- Multiple approaches are explored
59
-
- Requirements are understood before planning
58
+
Brainstorming must cover:
59
+
-**User intent** — clarify what the issue is asking for
60
+
-**Multiple approaches** — explore 2-3 different implementation strategies
61
+
-**Implementation details** — discuss the mathematical formulation, data structures, variable mappings, constraint encodings, and any non-obvious design choices
62
+
-**Existing patterns** — read reference implementations in the codebase (e.g., `spinglass_qubo.rs` for reductions) to understand the conventions
63
+
-**Scope** — agree on which variants to implement (e.g., unweighted only, specific K values)
60
64
61
65
Do NOT skip brainstorming. Do NOT write a plan without user discussion.
62
66
63
67
### 4. Write Plan
64
68
65
-
After brainstorming concludes, write plan to `issue-<number>-<slug>.md` in the repo root:
66
-
67
-
```markdown
68
-
# <Titlefrombrainstorming>
69
-
70
-
Issue: #<number>
71
-
72
-
## Context
73
-
<Briefproblemstatement>
74
-
75
-
## Approach
76
-
<Chosenapproachfrombrainstorming>
77
-
78
-
## Tasks
79
-
1. <Specificimplementationtask>
80
-
2. <Anothertask>
81
-
...
82
-
83
-
## Acceptance Criteria
84
-
- <Criteria from issue/brainstorming>
85
-
```
69
+
After brainstorming concludes, write plan to `docs/plans/YYYY-MM-DD-<slug>.md` using `superpowers:writing-plans`:
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,21 @@ make check # Quick check before commit (fmt + clippy + test)
72
72
```
73
73
74
74
75
+
## Acknowledgments
76
+
77
+
This project draws inspiration from the following packages:
78
+
79
+
-**[ProblemReductions.jl](https://github.com/GiggleLiu/ProblemReductions.jl)** — Julia library for computational problem reductions. Our problem trait hierarchy, reduction interface (`ReduceTo`/`ReductionResult`), and graph-based reduction registry are directly inspired by this package.
80
+
-**[UnitDiskMapping.jl](https://github.com/QuEraComputing/UnitDiskMapping.jl)** — Julia package for mapping problems to unit disk graphs. Our unit disk graph (King's subgraph / triangular lattice) reductions and the copy-line method are based on this implementation.
81
+
-**[qubogen](https://github.com/tamuhey/qubogen)** — Python library for generating QUBO matrices from combinatorial problems. Our QUBO reduction formulas (Vertex Cover, Graph Coloring, Set Packing, Max-2-SAT, binary ILP) reference the implementations in this package.
82
+
83
+
## Related Projects
84
+
85
+
-**[Karp](https://github.com/REA1/karp)** — A DSL (built on Racket) for writing and testing Karp reductions between NP-complete problems ([PLDI 2022 paper](https://dl.acm.org/doi/abs/10.1145/3519939.3523732)). Focused on education and proof verification rather than a solver pipeline.
-**[A Compendium of NP Optimization Problems](https://www.csc.kth.se/tcs/compendium/)** — Online catalog of NP optimization problems with approximability results (Crescenzi & Kann).
88
+
-**Computers and Intractability** (Garey & Johnson, 1979) — The classic reference cataloging 300+ NP-complete problems with reductions. The most cited book in computer science.
0 commit comments