Skip to content

Commit ee2494d

Browse files
committed
merge
2 parents 3026c55 + bad8a5b commit ee2494d

24 files changed

Lines changed: 1795 additions & 94 deletions

.claude/skills/issue-to-pr.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ The plan MUST include an **action pipeline** section with concrete steps based o
100100
- Present example in tutorial style (see KColoring→QUBO section for reference)
101101

102102
5. **Regenerate graph**`cargo run --example export_graph`
103+
6. **Push and create PR** — Push the changes and create a pull request with a description of the changes.
103104

104105
**Rules for solver implementation:**
105106
- Make sure at least one solver is provided in the issue template. Check if the solving strategy is valid. If not, reply under issue to ask for clarification.
@@ -132,8 +133,10 @@ The plan MUST include an **action pipeline** section with concrete steps based o
132133
3. **Document** — Update `docs/paper/reductions.typ`:
133134
- Add `display-name` entry
134135
- Add `#problem-def("Name")[definition...]`
136+
4. **Push and create PR** — Push the changes and create a pull request with a description of the changes.
135137

136138
### 6. Create PR
139+
Create a pull request with only the plan file.
137140

138141
```bash
139142
# Create branch

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,4 @@ docs/paper/examples/
7777

7878
# Claude Code logs
7979
claude-output.log
80+
.worktrees/

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ compare: rust-export
165165
INSTRUCTIONS ?=
166166
OUTPUT ?= claude-output.log
167167
AGENT_TYPE ?= claude
168+
PLAN_FILE ?= $(shell ls -t docs/plans/*.md 2>/dev/null | head -1)
168169

169170
run-plan:
170-
PLAN_FILE ?= $(shell ls -t docs/plans/*.md 2>/dev/null | head -1)
171171
@NL=$$'\n'; \
172172
BRANCH=$$(git branch --show-current); \
173173
if [ "$(AGENT_TYPE)" = "claude" ]; then \
@@ -182,6 +182,7 @@ run-plan:
182182
PROMPT="$${PROMPT}$${NL}$${NL}## Process$${NL}$${PROCESS}$${NL}$${NL}## Rules$${NL}- Tests should be strong enough to catch regressions.$${NL}- Do not modify tests to make them pass.$${NL}- Test failure must be reported."; \
183183
echo "=== Prompt ===" && echo "$$PROMPT" && echo "===" ; \
184184
claude --dangerously-skip-permissions \
185-
--model claude-opus-4-6 \
185+
--model opus \
186+
--verbose \
186187
--max-turns 500 \
187188
-p "$$PROMPT" 2>&1 | tee "$(OUTPUT)"

docs/paper/reductions.typ

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,25 @@ The following reductions to Integer Linear Programming are straightforward formu
806806
_Construction._ Variables: $x_v in {0, 1}$ for each $v in V$. Constraints: $x_u + x_v <= 1$ for each $(u, v) in.not E$ (non-edges). Objective: maximize $sum_v x_v$. Equivalently, IS on the complement graph. _Solution extraction:_ $K = {v : x_v = 1}$.
807807
]
808808

809+
#reduction-rule("TravelingSalesman", "ILP",
810+
example: true,
811+
example-caption: [Weighted $K_4$: the optimal tour $0 arrow 1 arrow 3 arrow 2 arrow 0$ with cost 80 is found by position-based ILP.],
812+
)[
813+
The traveling salesman problem reduces to binary ILP with $n^2 + 2 m n$ variables via position-based encoding with McCormick linearization.
814+
][
815+
_Construction._ For graph $G = (V, E)$ with $n = |V|$ and $m = |E|$:
816+
817+
_Variables:_ Binary $x_(v,k) in {0, 1}$ for each vertex $v in V$ and position $k in {0, ..., n-1}$. Interpretation: $x_(v,k) = 1$ iff vertex $v$ is at position $k$ in the tour.
818+
819+
_Auxiliary variables:_ For each edge $(u,v) in E$ and position $k$, introduce $y_(u,v,k)$ and $y_(v,u,k)$ to linearize the products $x_(u,k) dot x_(v,(k+1) mod n)$ and $x_(v,k) dot x_(u,(k+1) mod n)$ respectively.
820+
821+
_Constraints:_ (1) Each vertex has exactly one position: $sum_(k=0)^(n-1) x_(v,k) = 1$ for all $v in V$. (2) Each position has exactly one vertex: $sum_(v in V) x_(v,k) = 1$ for all $k$. (3) Non-edge consecutive prohibition: if ${v,w} in.not E$, then $x_(v,k) + x_(w,(k+1) mod n) <= 1$ for all $k$. (4) McCormick: $y <= x_(v,k)$, $y <= x_(w,(k+1) mod n)$, $y >= x_(v,k) + x_(w,(k+1) mod n) - 1$.
822+
823+
_Objective:_ Minimize $sum_((u,v) in E) w(u,v) dot sum_k (y_(u,v,k) + y_(v,u,k))$.
824+
825+
_Solution extraction._ For each position $k$, find vertex $v$ with $x_(v,k) = 1$ to recover the tour permutation; then select edges between consecutive positions.
826+
]
827+
809828
== Unit Disk Mapping
810829

811830
#reduction-rule("MaximumIndependentSet", "GridGraph")[
@@ -918,6 +937,7 @@ The following table shows concrete variable overhead for example instances, gene
918937
"kcoloring_to_ilp", "factoring_to_ilp",
919938
"maximumsetpacking_to_ilp", "minimumsetcovering_to_ilp",
920939
"minimumdominatingset_to_ilp", "maximumclique_to_ilp",
940+
"travelingsalesman_to_ilp",
921941
)
922942

923943
#let examples = example-files.map(n => {

0 commit comments

Comments
 (0)