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
* update
* Add plan for #52: TravelingSalesman to ILP reduction
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* save makefile and .claude
* fix reductions macro missing
* feat: add TravelingSalesman to ILP reduction (#52)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: add unit tests for TravelingSalesman to ILP reduction (#52)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add TravelingSalesman to ILP reduction rule in paper (#52)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add TravelingSalesman to ILP example (#52)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: regenerate reduction graph and fix clippy in example (#52)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* update issue-to-pr
* fix: resolve PR review comments for TSP-to-ILP reduction
- Use exact constraint count formula (n³ - n² + 2n + 4mn) instead of approximation
- Fix missing "is" in introduction.md
- Categorize TravelingSalesman as "graph" with correct doc_path
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/skills/issue-to-pr.md
+7-15Lines changed: 7 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,6 @@ description: Use when you have a GitHub issue and want to create a PR with an im
7
7
8
8
Convert a GitHub issue into an actionable PR with a plan that auto-triggers Claude execution.
9
9
10
-
## Usage
11
-
12
-
```
13
-
/issue-to-pr <issue-number-or-url>
14
-
```
15
-
16
10
## Workflow
17
11
18
12
```dot
@@ -24,15 +18,13 @@ digraph issue_to_pr {
24
18
"Research references" [shape=box];
25
19
"Write plan file" [shape=box];
26
20
"Create branch and PR" [shape=box];
27
-
"PR triggers [action]" [shape=doublecircle];
28
21
29
22
"Receive issue number" -> "Fetch issue with gh";
30
23
"Fetch issue with gh" -> "Check the rules to follow";
31
24
"Check the rules to follow" -> "Verify completeness";
32
25
"Verify completeness" -> "Research references";
33
26
"Research references" -> "Write plan file";
34
27
"Write plan file" -> "Create branch and PR";
35
-
"Create branch and PR" -> "PR triggers [action]";
36
28
}
37
29
```
38
30
@@ -108,6 +100,7 @@ The plan MUST include an **action pipeline** section with concrete steps based o
108
100
- Present example in tutorial style (see KColoring→QUBO section for reference)
109
101
110
102
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.
111
104
112
105
**Rules for solver implementation:**
113
106
- 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.
@@ -140,8 +133,10 @@ The plan MUST include an **action pipeline** section with concrete steps based o
Copy file name to clipboardExpand all lines: Makefile
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -165,9 +165,9 @@ compare: rust-export
165
165
INSTRUCTIONS ?=
166
166
OUTPUT ?= claude-output.log
167
167
AGENT_TYPE ?= claude
168
+
PLAN_FILE ?= $(shell ls -t docs/plans/*.md 2>/dev/null | head -1)
168
169
169
170
run-plan:
170
-
PLAN_FILE ?= $(shell ls -t docs/plans/*.md 2>/dev/null | head -1)
171
171
@NL=$$'\n';\
172
172
BRANCH=$$(git branch --show-current);\
173
173
if [ "$(AGENT_TYPE)"="claude" ];then \
@@ -182,6 +182,7 @@ run-plan:
182
182
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.";\
Copy file name to clipboardExpand all lines: docs/paper/reductions.typ
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -806,6 +806,25 @@ The following reductions to Integer Linear Programming are straightforward formu
806
806
_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}$.
807
807
]
808
808
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) dotsum_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.
0 commit comments