Skip to content

Commit 064d7dd

Browse files
GiggleLiuclaude
andauthored
Fix paper citations from issue #126 and #117 reviews (#613)
* fix: address issue review comments for #126 and #117 PR #599 (KSat→SubsetSum): Fix imprecise Karp 1972 attribution — the direct 3-SAT→SubsetSum digit encoding follows Sipser (2012, Thm 7.56) and CLRS (2022, §34.5.5), not Karp's original reduction tree. Add bib entries for both textbooks. PR #570 (GraphPartitioning): Add proper @Citations for Garey, Johnson & Stockmeyer (1976) and Arora, Rao & Vazirani (2009) instead of plain-text references. Add bib entries for both papers. Regenerate problem_schemas.json and reduction_graph.json. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: add FPT complexity citation for GraphPartitioning (#117) Address review comment: explicitly state that brute-force O*(2^n) is the best known unconditional exact algorithm, and cite Cygan et al. (STOC 2014 / SICOMP 2019) for the FPT result parameterized by bisection width. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use sort_by_key per clippy unnecessary_sort_by lint Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add merge-with-main conflict resolution step to review-pipeline Add Step 1a between checkout and Copilot fixes to merge origin/main into the PR branch. Resolves simple conflicts automatically; aborts and reports for complex conflicts needing manual resolution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * update pipeline skills: eligibility-first sorting, merge-with-main project-pipeline: Reorder Steps 0c/0d so eligibility check (source and target models exist) runs before scoring. Only eligible issues get scored. review-pipeline: Add Step 1a to merge origin/main into the PR branch before fixing Copilot comments, catching conflicts early. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent eecdef4 commit 064d7dd

7 files changed

Lines changed: 202 additions & 113 deletions

File tree

.claude/skills/project-pipeline/SKILL.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,19 @@ Filter items where `status == "Ready"`. Partition into `[Model]` and `[Rule]` bu
4848
1. **Existing problems:** Call `list_problems` (MCP tool) to get all problems currently in the reduction graph.
4949
2. **Pending rules:** From the full project board JSON, collect all `[Rule]` issues that are in "Ready" or "In Progress" status. Parse their source/target problem names (e.g., `[Rule] BinPacking to ILP` → source=BinPacking, target=ILP).
5050

51-
#### 0c. Score Each Issue
51+
#### 0c. Check Eligibility
5252

53-
Score each Ready issue on three criteria. For `[Model]` issues, extract the problem name. For `[Rule]` issues, extract both source and target problem names.
53+
**Rule issues require both source and target models to exist.** For each `[Rule]` issue, parse the source and target problem names (e.g., `[Rule] BinPacking to ILP` → source=BinPacking, target=ILP). Check that both appear in the `list_problems` output (existing models) OR in a `[Model]` issue in the current Ready/In Progress columns.
54+
55+
- If both models exist → **eligible**
56+
- If a missing model has a `[Model]` issue in Ready → eligible only in `--all` mode (the Model will be processed first); in single-issue mode, **skip this Rule** and mark it `[blocked]`
57+
- If a missing model has no `[Model]` issue at all → **ineligible**, mark it `[blocked]` with reason
58+
59+
All `[Model]` issues are always eligible (no dependency check needed).
60+
61+
#### 0d. Score Eligible Issues
62+
63+
Score only **eligible** issues on three criteria. For `[Model]` issues, extract the problem name. For `[Rule]` issues, extract both source and target problem names.
5464

5565
| Criterion | Weight | How to Assess |
5666
|-----------|--------|---------------|
@@ -64,14 +74,6 @@ Score each Ready issue on three criteria. For `[Model]` issues, extract the prob
6474

6575
**Important for C2:** A problem that is merely a weighted/unweighted variant or a graph-subtype specialization of an existing problem scores **0** on C2, not 2. The goal is to add genuinely new problem types that expand the graph's reach.
6676

67-
#### 0d. Apply Hard Constraints
68-
69-
**Rule issues require both source and target models to exist.** For each `[Rule]` issue, check that both its source and target problem names appear in the `list_problems` output (existing models) OR in a `[Model]` issue in the current Ready/In Progress columns.
70-
71-
- If both models exist → eligible
72-
- If a missing model has a `[Model]` issue in Ready → eligible only in `--all` mode (the Model will be processed first); in single-issue mode, **skip this Rule** and mark it `[blocked]`
73-
- If a missing model has no `[Model]` issue at all → **ineligible**, mark it `[blocked]` with reason
74-
7577
#### 0e. Print Ranked List
7678

7779
Print all Ready issues with their scores for visibility (no confirmation needed). Blocked rules appear at the bottom with their reason:

.claude/skills/review-pipeline/SKILL.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,22 @@ cd "$WORKTREE_DIR"
8282

8383
All subsequent steps run inside the worktree.
8484

85+
### 1a. Resolve Conflicts with Main
86+
87+
Check if the branch has merge conflicts with main:
88+
89+
```bash
90+
git fetch origin main
91+
git merge origin/main --no-edit
92+
```
93+
94+
- If the merge succeeds cleanly: push the merge commit and continue.
95+
- If there are conflicts:
96+
1. Inspect the conflicting files with `git diff --name-only --diff-filter=U`.
97+
2. Resolve conflicts (prefer the PR branch for new code, main for regenerated artifacts like JSON).
98+
3. Stage resolved files, commit, and push.
99+
- If conflicts are too complex to resolve automatically (e.g., overlapping logic changes in the same function): abort the merge (`git merge --abort`), leave the PR in review-agentic, and report: `PR #N has complex merge conflicts with main — needs manual resolution.` Then STOP processing this PR.
100+
85101
### 2. Fix Copilot Review Comments
86102

87103
Copilot review is guaranteed to exist (verified in Step 0). Fetch the comments:
@@ -210,3 +226,4 @@ Completed: 2/2 | All moved to In Review
210226
| Not checking out the right branch | Use `gh pr view` to get the exact branch name |
211227
| Worktree left behind on failure | Always clean up with `git worktree remove` in Step 5 |
212228
| Working in main checkout | All work happens in `.worktrees/` — never modify the main checkout |
229+
| Skipping merge with main | Always merge origin/main in Step 1a to catch conflicts before fixing comments |

docs/paper/reductions.typ

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ caption: [The house graph with max cut $S = {v_0, v_3}$ (blue) vs $overline(S) =
385385
Given an undirected graph $G = (V, E)$ with $|V| = n$ (even), find a partition of $V$ into two disjoint sets $A$ and $B$ with $|A| = |B| = n slash 2$ that minimizes the number of edges crossing the partition:
386386
$ "cut"(A, B) = |{(u, v) in E : u in A, v in B}|. $
387387
][
388-
Graph Partitioning is a core NP-hard problem arising in VLSI design, parallel computing, and scientific simulation, where balanced workload distribution with minimal communication is essential. Closely related to Max-Cut (which _maximizes_ rather than _minimizes_ the cut) and to the Ising Spin Glass model. NP-completeness was proved by Garey, Johnson and Stockmeyer (1976). Arora, Rao and Vazirani (2009) gave an $O(sqrt(log n))$-approximation algorithm. Standard partitioning tools include METIS, KaHIP, and Scotch.
388+
Graph Partitioning is a core NP-hard problem arising in VLSI design, parallel computing, and scientific simulation, where balanced workload distribution with minimal communication is essential. Closely related to Max-Cut (which _maximizes_ rather than _minimizes_ the cut) and to the Ising Spin Glass model. NP-completeness was proved by Garey, Johnson and Stockmeyer @garey1976. Arora, Rao and Vazirani @arora2009 gave an $O(sqrt(log n))$-approximation algorithm. The best known unconditional exact algorithm is brute-force enumeration of all $binom(n, n slash 2) = O^*(2^n)$ balanced partitions; no faster worst-case algorithm is known. Cygan et al. @cygan2014 showed that Minimum Bisection is fixed-parameter tractable in $O(2^(O(k^3)) dot n^3 log^3 n)$ time parameterized by bisection width $k$. Standard partitioning tools include METIS, KaHIP, and Scotch.
389389

390390
*Example.* Consider the graph $G$ with $n = 6$ vertices and 9 edges: $(v_0, v_1)$, $(v_0, v_2)$, $(v_1, v_2)$, $(v_1, v_3)$, $(v_2, v_3)$, $(v_2, v_4)$, $(v_3, v_4)$, $(v_3, v_5)$, $(v_4, v_5)$. The optimal balanced partition is $A = {v_0, v_1, v_2}$, $B = {v_3, v_4, v_5}$, with cut value 3: the crossing edges are $(v_1, v_3)$, $(v_2, v_3)$, $(v_2, v_4)$. All other balanced partitions yield a cut of at least 3.
391391

@@ -1198,7 +1198,7 @@ where $P$ is a penalty weight large enough that any constraint violation costs m
11981198
Source config: #ksat_ss_sol.source_config #h(1em) Target config: #ksat_ss_sol.target_config
11991199
],
12001200
)[
1201-
Classical Karp reduction @karp1972 using base-10 digit encoding. Each integer has $(n + m)$ digits, where the first $n$ positions correspond to variables and the last $m$ to clauses. For variable $x_i$, two integers $y_i, z_i$ encode positive and negative literal occurrences. For clause $C_j$, slack integers $g_j, h_j$ pad the clause digit to exactly 4. Since each clause has at most 3 literals and slacks add at most 2, no digit exceeds 5, so no carries occur.
1201+
Base-10 digit encoding reduction following Sipser @sipser2012[Thm 7.56] and CLRS @cormen2022[§34.5.5]. (Karp @karp1972 established SubsetSum NP-completeness via Exact Cover; this direct 3-SAT construction is a later textbook formulation.) Each integer has $(n + m)$ digits, where the first $n$ positions correspond to variables and the last $m$ to clauses. For variable $x_i$, two integers $y_i, z_i$ encode positive and negative literal occurrences. For clause $C_j$, slack integers $g_j, h_j$ pad the clause digit to exactly 4. Since each clause has at most 3 literals and slacks add at most 2, no digit exceeds 5, so no carries occur.
12021202
][
12031203
_Construction._ Given a 3-CNF formula $phi$ with $n$ variables and $m$ clauses, create $2n + 2m$ integers in $(n+m)$-digit base-10 representation:
12041204

docs/paper/references.bib

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,3 +387,53 @@ @article{ibarra1975
387387
year = {1975},
388388
doi = {10.1145/321906.321909}
389389
}
390+
391+
@book{sipser2012,
392+
author = {Michael Sipser},
393+
title = {Introduction to the Theory of Computation},
394+
edition = {3rd},
395+
publisher = {Cengage Learning},
396+
year = {2012}
397+
}
398+
399+
@book{cormen2022,
400+
author = {Thomas H. Cormen and Charles E. Leiserson and Ronald L. Rivest and Clifford Stein},
401+
title = {Introduction to Algorithms},
402+
edition = {4th},
403+
publisher = {MIT Press},
404+
year = {2022}
405+
}
406+
407+
@article{garey1976,
408+
author = {Michael R. Garey and David S. Johnson and Larry Stockmeyer},
409+
title = {Some Simplified NP-Complete Graph Problems},
410+
journal = {Theoretical Computer Science},
411+
volume = {1},
412+
number = {3},
413+
pages = {237--267},
414+
year = {1976},
415+
doi = {10.1016/0304-3975(76)90059-1}
416+
}
417+
418+
@article{arora2009,
419+
author = {Sanjeev Arora and Satish Rao and Umesh Vazirani},
420+
title = {Expander Flows, Geometric Embeddings and Graph Partitioning},
421+
journal = {Journal of the ACM},
422+
volume = {56},
423+
number = {2},
424+
pages = {1--37},
425+
year = {2009},
426+
doi = {10.1145/1502793.1502794}
427+
}
428+
429+
@article{cygan2014,
430+
author = {Marek Cygan and Daniel Lokshtanov and Marcin Pilipczuk and Micha{\l} Pilipczuk and Saket Saurabh},
431+
title = {Minimum Bisection Is Fixed Parameter Tractable},
432+
journal = {SIAM Journal on Computing},
433+
volume = {48},
434+
number = {2},
435+
pages = {417--450},
436+
year = {2019},
437+
note = {Conference version: STOC 2014},
438+
doi = {10.1137/140990255}
439+
}

docs/src/reductions/problem_schemas.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@
110110
}
111111
]
112112
},
113+
{
114+
"name": "GraphPartitioning",
115+
"description": "Find minimum cut balanced bisection of a graph",
116+
"fields": [
117+
{
118+
"name": "graph",
119+
"type_name": "G",
120+
"description": "The undirected graph G=(V,E)"
121+
}
122+
]
123+
},
113124
{
114125
"name": "ILP",
115126
"description": "Optimize linear objective subject to linear constraints",

0 commit comments

Comments
 (0)