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
docs: improve example instances implementation plan (#41)
* docs: update title for example instances improvement plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat(docs): interactive reduction diagram with Cytoscape.js (#34)
Add an interactive Cytoscape.js-based reduction graph page to the mdBook
documentation. The page loads reduction_graph.json, filters to base
problem nodes, deduplicates edges, and renders an explorable directed
graph with category-colored nodes and two-click shortest-path highlighting.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* examples: use Petersen graph for MIS reductions
Replace trivial P4 path graph (4 vertices, 3 edges, MIS=2) with the
Petersen graph (10 vertices, 15 edges, 3-regular, MIS=4) in all four
MIS reduction examples: QUBO, ILP, MinimumVertexCover, MaximumSetPacking.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* examples: use Petersen graph for MVC reductions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* examples: use Petersen graph for Matching and DomSet reductions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* examples: use Petersen graph for Coloring and MaxCut reductions
Replace trivial K3/triangle instances with more interesting graphs:
- kcoloring_to_ilp: Petersen graph (10v, 15e) with ILPSolver
- kcoloring_to_qubo: house graph (5v, 6e) to keep BruteForce feasible
- maxcut_to_spinglass: Petersen graph (10v, 15e) with unit weights
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* examples: use octahedron for MaximumClique reduction
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* examples: use 6-set instances for SetPacking and SetCovering
Replace trivial 3-set instances with richer 6-set instances over
8 elements in SetPacking (QUBO and ILP) and SetCovering (ILP) examples.
The new instances have interesting overlap structure and produce
max packing size 2 and min cover size 3.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* examples: use 5-variable SAT instances for SAT reductions
Replace trivial 2-3 variable SAT formulas with richer 5-variable instances
across 4 SAT reduction examples:
- sat_to_mis: 5-var, 7-clause 3-SAT (21 vertices, fast BruteForce)
- sat_to_coloring: 5-var, 3 unit clauses (13 vertices; OR-gadgets make
multi-literal clauses infeasible for BruteForce on 3-coloring)
- sat_to_mds: 5-var, 7-clause 3-SAT (22 vertices, fast BruteForce)
- sat_to_ksat: 5-var, 6-clause mixed sizes (1,2,3,3,4,5 literals) to
demonstrate both padding and splitting transformations
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* examples: use 5-variable 3-SAT instance for kSAT-to-QUBO
Generalize the KSatisfiability-to-QUBO reduction to support K=3 using
Rosenberg quadratization (one auxiliary variable per 3-literal clause).
Update the example from a trivial 2-SAT/3-variable instance to a
3-SAT instance with 5 variables and 7 clauses, producing a 12-variable
QUBO (5 original + 7 auxiliary).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* examples: use Petersen topology for SpinGlass/QUBO/MaxCut
Replace trivial 3-spin/3-variable instances with 10-variable Petersen
graph instances for SpinGlass-QUBO and SpinGlass-MaxCut reductions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* examples: use 6-variable knapsack for ILP-to-QUBO
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* examples: use full adder circuit for CircuitSAT-to-SpinGlass
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* examples: use factoring 35=5×7 for Factoring reductions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address review feedback
- Remove interactive reduction graph page (docs/src/reductions/graph.md)
- Remove Reductions section from SUMMARY.md
- Rename ReductionK3SatToQUBO to Reduction3SATToQUBO
- Document 3-SAT→QUBO Rosenberg quadratization in reductions.typ
- Update PR description to reflect code changes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/paper/reductions.typ
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -522,9 +522,9 @@ where $P$ is a penalty weight large enough that any constraint violation costs m
522
522
]
523
523
524
524
#reduction-rule("KSatisfiability", "QUBO")[
525
-
Given a Max-2-SAT instance with $m$ clauses over $n$ variables, construct upper-triangular $Q inRR^(n times n)$where each clause $(ell_i orell_j)$ contributes a penalty gadget encoding its unique falsifying assignment.
525
+
Given a Max-$k$-SAT instance with $m$ clauses over $n$ variables, construct a QUBO that counts unsatisfied clauses. For $k = 2$, $Q inRR^(n times n)$directly encodes quadratic penalties. For $k = 3$, Rosenberg quadratization introduces $m$ auxiliary variables, giving $Q inRR^((n+m) times (n+m))$.
526
526
][
527
-
_Construction._ Applying the penalty method (@sec:penalty-method), each 2-literal clause has exactly one falsifying assignment (both literals false). The penalty for that assignment is a quadratic function of $x_i, x_j$:
527
+
*Case $k = 2$.* Applying the penalty method (@sec:penalty-method), each 2-literal clause has exactly one falsifying assignment (both literals false). The penalty for that assignment is a quadratic function of $x_i, x_j$:
528
528
529
529
#table(
530
530
columns: (auto, auto, auto, auto),
@@ -538,6 +538,12 @@ where $P$ is a penalty weight large enough that any constraint violation costs m
538
538
)
539
539
540
540
Summing over all clauses, $f(bold(x)) = sum_j "penalty"_j (bold(x))$ counts falsified clauses. Minimizers of $f$ maximize satisfied clauses.
541
+
542
+
*Case $k = 3$ (Rosenberg quadratization).* For each clause $(ell_1 orell_2 orell_3)$, define complement variables $y_i = overline(ell_i)$ (so $y_i = x_i$ if the literal is negated, $y_i = 1 - x_i$ if positive). The clause is violated when $y_1 y_2 y_3 = 1$. This cubic penalty is reduced to quadratic form by introducing an auxiliary variable $a$ and the substitution $a = y_1 y_2$, enforced via a Rosenberg penalty with weight $M$:
543
+
$ H = a dot y_3 + M (y_1 y_2 - 2 y_1 a - 2 y_2 a + 3a) $
544
+
where $M = 2$ suffices. For any binary assignment, if $a = y_1 y_2$ the penalty term vanishes and $H = y_1 y_2 y_3$ counts the clause violation. If $a != y_1 y_2$, the penalty $M(dots.c) >= 1$ makes this suboptimal.
545
+
546
+
Each clause adds one auxiliary variable (indices $n, n+1, ..., n+m-1$), so the total QUBO has $n + m$ variables. Solution extraction discards auxiliary variables: return $bold(x)[0..n]$.
0 commit comments