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
Rewrite getting-started with Factoring→SpinGlass and path overhead API (#78)
* feat: rewrite getting-started with Factoring→SpinGlass example and path overhead API
- Rewrite getting-started.md Example 2 to Factoring→SpinGlass with notebook style
- Add path_overheads() as single source of truth for per-edge overhead lookup
- Refactor compose_path_overhead() and tests to build on path_overheads() (DRY)
- Remove evaluate_path_overhead() in favor of symbolic per-edge checks
- Add 7 rich paper examples recovered from stash (SAT→KColoring, SAT→DS, etc.)
- Fix rustdoc unresolved link to ProblemSize
- Add force-push prohibition to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add coverage for ReductionPath and ReductionStep Display impls
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: .claude/CLAUDE.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,9 @@ make release V=x.y.z # Tag and push a new release (CI publishes to crates.io)
35
35
make test clippy # Must pass before PR
36
36
```
37
37
38
+
## Git Safety
39
+
-**NEVER force push** (`git push --force`, `git push -f`, `git push --force-with-lease`). This is an absolute rule with no exceptions. Force push can silently destroy other people's work and stashed changes.
#sat_kc_r.solutions.len() valid 3-colorings (color symmetry of satisfying assignments) #sym.checkmark
648
+
],
649
+
)[
639
650
@garey1979 Given CNF $phi$, construct graph $G$ such that $phi$ is satisfiable iff $G$ is 3-colorable.
640
651
][
641
652
_Construction._ (1) Base triangle: TRUE, FALSE, AUX vertices with all pairs connected. (2) Variable gadget for $x_i$: vertices $"pos"_i$, $"neg"_i$ connected to each other and to AUX. (3) Clause gadget: for $(ell_1 or ... orell_k)$, apply OR-gadgets iteratively producing output $o$, then connect $o$ to FALSE and AUX.
@@ -645,7 +656,18 @@ where $P$ is a penalty weight large enough that any constraint violation costs m
645
656
_Solution extraction._ Set $x_i = 1$ iff $"color"("pos"_i) = "color"("TRUE")$.
Dominating set of size $n = #sat_ds.source.instance.num_vars$: one vertex per variable triangle #sym.checkmark
669
+
],
670
+
)[
649
671
@garey1979 Given CNF $phi$ with $n$ variables and $m$ clauses, $phi$ is satisfiable iff the constructed graph has a dominating set of size $n$.
650
672
][
651
673
_Construction._ (1) Variable triangle for $x_i$: vertices $"pos"_i = 3i$, $"neg"_i = 3i+1$, $"dum"_i = 3i+2$ forming a triangle. (2) Clause vertex $c_j = 3n+j$ connected to $"pos"_i$ if $x_i in C_j$, to $"neg"_i$ if $overline(x_i) in C_j$.
@@ -661,7 +683,18 @@ where $P$ is a penalty weight large enough that any constraint violation costs m
S ⊆ V is an independent set iff V \ S is a vertex cover, so the complement
102
+
maps optimality in one direction to optimality in the other.
103
+
104
+
### Example 2: Reduction path search — integer factoring to spin glass
105
+
106
+
Real-world problems often require **chaining** multiple reductions. Here we factor the integer 6 by reducing `Factoring` through the reduction graph to `SpinGlass`, through automatic reduction path search.
0 commit comments