Agent Work: Homework7
Claude Opus 4.6 · COMP 382: Reasoning about Algorithms
COMP 382: Reasoning about Algorithms
Homework 7
Total Points: 100 (NP-Completeness Reductions)
Note: Solutions to polynomial-time mapping reductions must be accompanied by proofs of correctness.
---
Problem 1: Efficient Recruiting [25 points]
Suppose you are helping organize a summer camp. The camp is supposed to have at least one counselor who is skilled at each of the n sports covered by the camp (baseball, volleyball, and so on). They have received job applicants from m potential counselors. For each of the n sports, there is a subset of the m applicants qualified in that sport.
The question is: For a given number k < m, is it possible to hire at most k of the counselors and have at least one counselor qualified in each of the n sports? We'll call this the *Efficient Recruiting* problem.
Show that Vertex Cover ≤ₚ Efficient Recruiting.
---
Problem 2: Plot Fulfillment [25 points]
Hypertext fiction is a type of fiction consisting of a set of pages, each containing some text, along with links between them. The reader of such a hypertext story follows a *trail* — a sequence of pages that begins with a *start page* s and finishes at an *end page* t — through the story.
Suppose you have created a piece of hypertext fiction, and you would like to know if there is a trail through your story that contains each of a set of *thematic elements*. You have n thematic elements, the i-th of which can be identified with a set Tᵢ of pages.
We formalize this as the *Plot Fulfillment* problem, which asks: is there a trail from s to t that contains at least one page from each of the sets Tᵢ?
Show that Hitting Set ≤ₚ Plot Fulfillment.
---
Problem 3: Path Selection [25 points]
Suppose you are managing a communication network, modeled by a directed graph G = (V, E). There are c users who want to use the network. User i (we have 1 ≤ i ≤ c) issues a *request* to reserve a specific path Pᵢ in G on which to transmit data.
You want to accept as many path requests as possible, except if you accept Pᵢ and Pⱼ, then Pᵢ and Pⱼ cannot share any nodes.
The *Path Selection* problem formalizes this intent. It asks: Given a directed graph G = (V, E), a set of path requests P₁, ..., Pₓ, and a number k, is it possible to select at least k of the paths so that no two of the selected paths share any nodes?
Show that Independent Set ≤ₚ Path Selection.
---
Problem 4: Half 3-SAT Satisfiability [25 points]
Given a 3-SAT formula φ with n variables and m clauses, where m is even. We wish to determine whether there is a truth assignment to the variables of φ such that exactly half the clauses evaluate to true and half the clauses evaluate to false.
Show that 3-SAT ≤ₚ Half 3-SAT Satisfiability.
# COMP382 Homework 7
## Student Responses
<!-- Write your solutions below. Add sections for each problem as needed. -->
<!-- Use proper mathematical notation where applicable. -->
[Your solutions here]
COMP382 Homework 7
Student Responses
---
Problem 1: Vertex Cover ≤ₚ Efficient Recruiting
Reduction
Given an instance of Vertex Cover: a graph G = (V, E) and an integer k, we construct an instance of Efficient Recruiting as follows:
- Counselors (applicants): Each vertex v ∈ V becomes a potential counselor. So m = |V|.
- Sports: Each edge e = {u, v} ∈ E becomes a sport. So n = |E|.
- Qualifications: For each sport corresponding to edge e = {u, v}, the counselors qualified in that sport are exactly u and v. That is, the subset of applicants qualified for sport e is A_e = {u, v}.
- Budget: The hiring budget is k (same as the vertex cover budget).
This reduction runs in O(|V| + |E|) time, which is polynomial.
Proof of Correctness
(Forward direction): Suppose G has a vertex cover S ⊆ V with |S| ≤ k. We claim that hiring the set of counselors corresponding to S covers all sports. Consider any sport, which corresponds to some edge e = {u, v} ∈ E. Since S is a vertex cover, at least one of u or v belongs to S. Therefore, at least one counselor qualified in this sport has been hired. Since this holds for every sport (edge), hiring the counselors in S — at most k of them — covers all n sports. So the Efficient Recruiting instance is a YES instance.
(Backward direction): Suppose the Efficient Recruiting instance is a YES instance, meaning we can hire a set H of at most k counselors that covers every sport. We claim that H (viewed as a set of vertices) is a vertex cover. Consider any edge e = {u, v} ∈ E. The sport corresponding to e has qualified applicants {u, v}, and since H covers this sport, at least one of u or v is in H. Since this holds for every edge, H is a vertex cover of size at most k.
(Conclusion): G has a vertex cover of size ≤ k if and only if the constructed Efficient Recruiting instance can be solved with ≤ k hires. Since the reduction is computable in polynomial time, we have Vertex Cover ≤ₚ Efficient Recruiting. ∎
---
Problem 2: Hitting Set ≤ₚ Plot Fulfillment
Reduction
Given an instance of Hitting Set: a universe U = {u₁, u₂, ..., u_m}, a collection of subsets S₁, S₂, ..., S_n ⊆ U, and an integer k, we construct an instance of Plot Fulfillment as follows:
Construct the directed graph (hypertext) as a layered graph with k layers:
- Pages:
- A start page s and an end page t. - For each layer l ∈ {1, 2, ..., k} and each element u_j ∈ U, create a page p_{l,j}. This gives km pages plus s and t.
- Links (directed edges):
- From s to p_{1,j} for every j ∈ {1, ..., m} (start page links to all pages in layer 1). - From p_{l,j} to p_{l+1,j'} for every l ∈ {1, ..., k-1} and every j, j' ∈ {1, ..., m} (every page in layer l links to every page in layer l+1). - From p_{k,j} to t for every j ∈ {1, ..., m} (all pages in layer k link to the end page).
- Thematic elements: For each subset S_i (i = 1, ..., n), define the thematic element T_i = {p_{l,j} : 1 ≤ l ≤ k, u_j ∈ S_i}. That is, T_i contains all pages across all layers that correspond to elements in S_i.
This reduction runs in polynomial time: the graph has 2 + km pages, O(km²) links, and n thematic elements.
Proof of Correctness
Key observation: Any trail from s to t in this layered graph has the form:
s → p_{1, j₁} → p_{2, j₂} → ... → p_{k, j_k} → t
The trail selects exactly one page per layer, corresponding to elements u_{j₁}, u_{j₂}, ..., u_{j_k} from U (with possible repetitions). The set of elements "chosen" is H = {u_{j₁}, ..., u_{j_k}}, which has |H| ≤ k.
(Forward direction): Suppose (U, S₁, ..., S_n, k) is a YES instance of Hitting Set. Then there exists H = {u_{j₁}, ..., u_{j_{k'}}} with k' ≤ k such that H ∩ S_i ≠ ∅ for all i. Construct a trail by:
- In layers 1 through k', visit pages p_{l, j_l} corresponding to elements u_{j₁}, ..., u_{j_{k'}}.
- In layers k'+1 through k (if k' < k), visit p_{l, j₁} (repeating the first element).
This is a valid trail from s to t. For each thematic element T_i: since H ∩ S_i ≠ ∅, some u_{j_l} ∈ S_i, so the page p_{l, j_l} ∈ T_i is visited. Hence the trail contains at least one page from each T_i.
(Backward direction): Suppose there is a trail from s to t that contains at least one page from each T_i. The trail visits pages p_{1,j₁}, ..., p_{k,j_k}. Define H = {u_{j₁}, ..., u_{j_k}} ⊆ U. Then |H| ≤ k. For each S_i: since the trail hits T_i, some p_{l, j_l} ∈ T_i, meaning u_{j_l} ∈ S_i, so H ∩ S_i ≠ ∅. Therefore H is a hitting set of size at most k.
(Conclusion): The Hitting Set instance is a YES instance if and only if the constructed Plot Fulfillment instance is a YES instance. Since the construction is polynomial-time, we have Hitting Set ≤ₚ Plot Fulfillment. ∎
---
Problem 3: Independent Set ≤ₚ Path Selection
Reduction
Given an instance of Independent Set: a graph G = (V, E) and an integer k, we construct an instance of Path Selection as follows:
Construct a directed graph G' and a set of path requests:
- Nodes of G':
- For each vertex v ∈ V, create a unique start node s_v and end node t_v. - For each edge e ∈ E, create a single shared node n_e. - Total: 2|V| + |E| nodes.
- Path requests: For each vertex v ∈ V, create a path request P_v defined as follows. Let e₁, e₂, ..., e_{d_v} be the edges incident to v in some fixed ordering (where d_v is the degree of v). Then:
P_v: s_v → n_{e₁} → n_{e₂} → ... → n_{e_{d_v}} → t_v
If v is an isolated vertex (d_v = 0), then P_v: s_v → t_v.
- Edges of G': All directed edges along the paths P_v (for all v ∈ V).
- Selection budget: k (same as the independent set target).
This reduction runs in polynomial time.
Proof of Correctness
Key property: Two paths P_u and P_v share a node if and only if u and v are adjacent in G.
*Proof of key property:*
- The start and end nodes s_v, t_v are unique to path P_v, so they never cause sharing.
- The only potentially shared nodes are the edge nodes n_e. Node n_e appears in path P_v if and only if edge e is incident to v. So n_e appears in both P_u and P_v if and only if e is incident to both u and v, which means e = {u, v} ∈ E, i.e., u and v are adjacent.
(Forward direction): Suppose G has an independent set S ⊆ V with |S| ≥ k. Consider the set of paths {P_v : v ∈ S}. Since no two vertices in S are adjacent, no edge of G connects two vertices in S. By the key property, no two paths in {P_v : v ∈ S} share any node. We have selected |S| ≥ k paths with no shared nodes.
(Backward direction): Suppose we can select at least k paths from {P_v : v ∈ V} such that no two selected paths share any node. Let S be the set of vertices corresponding to the selected paths. Then |S| ≥ k. We claim S is an independent set: if two vertices u, v ∈ S were adjacent (i.e., {u, v} ∈ E), then by the key property, P_u and P_v would share the node n_{{u,v}}, contradicting the selection constraint. So no two vertices in S are adjacent.
(Conclusion): G has an independent set of size ≥ k if and only if we can select ≥ k node-disjoint paths in the constructed Path Selection instance. Since the reduction is polynomial-time, we have Independent Set ≤ₚ Path Selection. ∎
---
Problem 4: 3-SAT ≤ₚ Half 3-SAT Satisfiability
Reduction
Given a 3-SAT instance φ with n variables x₁, ..., x_n and m clauses C₁, ..., C_m, we construct a Half 3-SAT instance φ' as follows:
- Introduce one fresh variable y (not appearing in φ).
- φ' contains the following 2m clauses:
1. The m original clauses C₁, C₂, ..., C_m (unchanged). 2. m dummy clauses D₁, D₂, ..., D_m, where each D_i = (y ∨ y ∨ y).
The formula φ' has n + 1 variables and 2m clauses. Since 2m is always even, the Half 3-SAT requirement that the number of clauses be even is satisfied.
This reduction runs in O(n + m) time, which is polynomial.
Proof of Correctness
Preliminary lemma: *If φ is unsatisfiable, then there is no assignment to x₁, ..., x_n that makes all m clauses of φ simultaneously false.*
*Proof of lemma:* Suppose for contradiction that assignment α makes all m clauses false. Each clause C_i = (l_{i1} ∨ l_{i2} ∨ l_{i3}) being false means l_{i1} = l_{i2} = l_{i3} = false under α. Define α' by flipping every variable: α'(x_j) = ¬α(x_j) for all j. Under α', every literal that was false under α becomes true: if l = x_j was false (α(x_j) = F), then α'(x_j) = T so l is true; if l = ¬x_j was false (α(x_j) = T), then α'(x_j) = F so ¬x_j is true. Since all three literals in every clause were false under α, all three are true under α', making every clause true. So α' satisfies φ, contradicting the assumption that φ is unsatisfiable. ∎
Behavior of dummy clauses: Under any assignment, all m dummy clauses D_i = (y ∨ y ∨ y) have the same truth value:
- If y = true: all m dummy clauses are true.
- If y = false: all m dummy clauses are false.
(Forward direction): Suppose φ is satisfiable, with satisfying assignment α. Extend α to α' by setting y = false. Under α':
- All m original clauses are true (since α satisfies φ).
- All m dummy clauses are false (since y = false).
- Total true clauses: m out of 2m, which is exactly half. ✓
(Backward direction): Suppose there exists an assignment β to φ' that makes exactly m out of 2m clauses true. There are two cases:
- *Case β(y) = false:* All dummy clauses are false, contributing 0 true clauses. So all m true clauses must come from the original clauses. This means all m original clauses are true under β, so β restricted to x₁, ..., x_n satisfies φ.
- *Case β(y) = true:* All m dummy clauses are true. Since exactly m of 2m total clauses are true, exactly 0 original clauses are true. By the preliminary lemma (applied contrapositively), if all original clauses are simultaneously false under some assignment, then flipping all variables gives a satisfying assignment. So φ is satisfiable.
In both cases, φ is satisfiable.
(No false positives for unsatisfiable φ): If φ is unsatisfiable, we show no assignment to φ' achieves exactly m true clauses:
- If y = false: all dummy clauses are false. Original true count j ≤ m - 1 (since φ is unsatisfiable). Total = j ≤ m - 1 < m.
- If y = true: all dummy clauses are true (contributing m). Original true count j ≥ 1 (by the lemma, j = 0 is impossible for unsatisfiable φ). Total = j + m ≥ m + 1 > m.
In neither case does the total equal m. So no assignment makes exactly half the clauses true.
(Conclusion): φ is satisfiable if and only if φ' has an assignment making exactly half its clauses true. Since the reduction is polynomial-time, we have 3-SAT ≤ₚ Half 3-SAT. ∎
Problem 1: Efficient Recruiting [25 points]
Score: 25/25 points
Assessment:
Approach: The student maps vertices to counselors, edges to sports, and endpoint incidence to qualification — identical to the reference reduction.
Strengths:
- Reduction is clearly and precisely stated with explicit definitions of counselors, sports, qualifications, and budget
- Forward direction (vertex cover → recruiting solution) is rigorous: every edge/sport is covered because at least one endpoint/counselor is in the cover
- Backward direction (recruiting solution → vertex cover) is equally rigorous: every sport covered implies every edge has an endpoint in the hiring set
- Polynomial-time complexity explicitly noted
Errors/Gaps:
- None
Detailed Feedback: This is a textbook-quality reduction that matches the reference solution exactly. The construction is natural (vertices↔counselors, edges↔sports, incidence↔qualification), both directions of the correctness proof are complete, and the polynomial-time bound is stated. No deductions.
Rubric Breakdown:
- Correct reduction construction: 10/10
- Forward direction proof: 5/5
- Backward direction proof: 5/5
- Polynomial-time argument: 5/5
---
Problem 2: Plot Fulfillment [25 points]
Score: 25/25 points
Assessment:
Approach: The student constructs a k-layer directed graph where each layer has one node per universe element, with complete bipartite edges between consecutive layers, and thematic element sets corresponding to hitting set subsets. This matches the reference solution's layered construction.
Strengths:
- Layered graph construction is clearly described with explicit node set, edge set, and thematic element definitions
- Key structural observation is identified: any s-to-t trail selects exactly one page per layer, corresponding to at most k universe elements
- Forward direction correctly handles the case where the hitting set has fewer than k elements (padding remaining layers)
- Backward direction correctly extracts a hitting set from a valid trail
- Polynomial size explicitly verified: 2 + km pages, O(km²) links
Errors/Gaps:
- None
Detailed Feedback: The student's solution is essentially identical to the reference solution, with the same layered graph construction. The notation differs slightly (p_{l,j} vs v_{ij}, U vs A) but the mathematical content is the same. The proof handles the subtlety that the hitting set may have fewer than k elements by repeating elements in the extra layers — a detail the reference solution handles by assuming |H| = k. Both directions of the correctness proof are complete and convincing. Full marks.
Rubric Breakdown:
- Correct graph construction (layered graph): 8/8
- Correct thematic element definition: 4/4
- Forward direction proof: 5/5
- Backward direction proof: 5/5
- Polynomial-time argument: 3/3
---
Problem 3: Path Selection [25 points]
Score: 25/25 points
Assessment:
Approach: The student creates a directed graph G' with unique start/end nodes (s_v, t_v) for each vertex and a shared node (n_e) for each edge. Each vertex's path traverses its incident edge-nodes. This differs from the reference (which uses a complete directed graph on edge-nodes) but is equally correct and arguably cleaner.
Strengths:
- The construction is elegant: dedicated start/end nodes per vertex guarantee no spurious path overlap at endpoints
- The key property ("P_u and P_v share a node iff u and v are adjacent in G") is explicitly stated and proved as a separate lemma — excellent proof organization
- The proof of the key property is airtight: shared nodes can only be edge-nodes n_e, and n_e appears in both paths iff e connects u and v
- Both directions of the main proof cleanly follow from the key property
- Handles isolated vertices (degree-0 paths)
Errors/Gaps:
- None
Detailed Feedback: The student's construction is different from the reference solution but entirely valid. Where the reference uses a complete directed graph and paths without dedicated endpoints, the student introduces s_v and t_v nodes to give each path unique start and end points. This makes the key property cleaner to prove since start/end nodes can never cause spurious sharing. The proof structure — isolating the key property as a lemma, then using it for both directions — demonstrates strong proof-writing skills. The construction is polynomial (2|V| + |E| nodes, O(Σ deg(v)) edges). Full marks.
Rubric Breakdown:
- Correct reduction construction: 10/10
- Key property identified and proved: 5/5
- Forward direction proof: 4/4
- Backward direction proof: 4/4
- Polynomial-time argument: 2/2
---
Problem 4: Half 3-SAT Satisfiability [25 points]
Score: 25/25 points
Assessment:
Approach: The student introduces one fresh variable y and appends m dummy clauses (y ∨ y ∨ y) to the original m clauses, yielding 2m total clauses. A novel "flipping lemma" is proved to handle the y = true case. This is a simpler and more elegant construction than the reference solution's 4m-clause approach.
Strengths:
- The construction is simpler than the reference solution (2m clauses vs 4m) while being fully correct
- The "preliminary lemma" is a clever and correct observation: if all clauses of an unsatisfiable formula could be simultaneously falsified, then flipping all variables would satisfy them — contradiction
- Forward direction is straightforward: set y = false, m originals true + m dummies false = m/2m = half ✓
- Backward direction handles both cases (y = false and y = true) correctly, using the lemma for the y = true case
- The "no false positives" section explicitly verifies that unsatisfiable φ cannot produce a half-satisfying assignment — this goes beyond what many proofs include
- Correctly notes that 2m is always even, satisfying the problem's constraint
Errors/Gaps:
- None
Detailed Feedback: This is an outstanding solution that improves on the reference. The reference solution uses 4m clauses (m copies of T = (¬y ∨ ¬y ∨ ¬y), 2m copies of F = (y ∨ y ∨ y), plus the m originals) with a two-type padding scheme. The student achieves the same result with only one type of dummy clause and 2m total clauses. The key insight that makes this work is the flipping lemma, which handles the otherwise problematic y = true case. The lemma is correctly proved by contrapositive: if some assignment α makes all clauses false, then the complement assignment α' (flipping every variable) makes all literals in every clause true, thereby satisfying φ.
The proof is organized exceptionally well: lemma first, then forward direction, then backward direction with case analysis, then an explicit verification that unsatisfiable formulas cannot produce false positives. Every step is justified. Full marks.
Rubric Breakdown:
- Correct reduction construction: 8/8
- Preliminary lemma (flipping argument): 4/4
- Forward direction proof: 5/5
- Backward direction proof (both cases): 5/5
- Polynomial-time argument: 3/3
---
Overall Summary
| Problem | Score | Notes |
|---|---|---|
| 1 - Efficient Recruiting | 25/25 | Perfect reduction, matches reference exactly |
| 2 - Plot Fulfillment | 25/25 | Correct layered graph construction, thorough proof |
| 3 - Path Selection | 25/25 | Elegant alternative to reference, cleaner construction |
| 4 - Half 3-SAT | 25/25 | Simpler than reference (2m vs 4m clauses), clever flipping lemma |
| Total | 100/100 |
General Comments:
This is an exceptional submission demonstrating complete mastery of NP-completeness reductions. All four reductions are correct, complete, and clearly written. The student consistently provides: (1) a precise construction, (2) both directions of the correctness proof, and (3) a polynomial-time argument. Problems 3 and 4 show particular creativity — the Path Selection construction with dedicated start/end nodes is arguably cleaner than the reference, and the Half 3-SAT reduction achieves a simpler construction through the clever flipping lemma. The proofs are well-organized, with key properties isolated as separate claims. No deductions warranted.
Total: 100/100
diff --git a/writeup.md b/writeup.md
index 6069765..bf8e854 100644
--- a/writeup.md
+++ b/writeup.md
@@ -2,8 +2,155 @@
## Student Responses
-<!-- Write your solutions below. Add sections for each problem as needed. -->
-<!-- Use proper mathematical notation where applicable. -->
+---
-[Your solutions here]
+## Problem 1: Vertex Cover ≤ₚ Efficient Recruiting
+### Reduction
+
+Given an instance of Vertex Cover: a graph G = (V, E) and an integer k, we construct an instance of Efficient Recruiting as follows:
+
+- **Counselors (applicants):** Each vertex v ∈ V becomes a potential counselor. So m = |V|.
+- **Sports:** Each edge e = {u, v} ∈ E becomes a sport. So n = |E|.
+- **Qualifications:** For each sport corresponding to edge e = {u, v}, the counselors qualified in that sport are exactly u and v. That is, the subset of applicants qualified for sport e is A_e = {u, v}.
+- **Budget:** The hiring budget is k (same as the vertex cover budget).
+
+This reduction runs in O(|V| + |E|) time, which is polynomial.
+
+### Proof of Correctness
+
+**(Forward direction):** Suppose G has a vertex cover S ⊆ V with |S| ≤ k. We claim that hiring the set of counselors corresponding to S covers all sports. Consider any sport, which corresponds to some edge e = {u, v} ∈ E. Since S is a vertex cover, at least one of u or v belongs to S. Therefore, at least one counselor qualified in this sport has been hired. Since this holds for every sport (edge), hiring the counselors in S — at most k of them — covers all n sports. So the Efficient Recruiting instance is a YES instance.
+
+**(Backward direction):** Suppose the Efficient Recruiting instance is a YES instance, meaning we can hire a set H of at most k counselors that covers every sport. We claim that H (viewed as a set of vertices) is a vertex cover. Consider any edge e = {u, v} ∈ E. The sport corresponding to e has qualified applicants {u, v}, and since H covers this sport, at least one of u or v is in H. Since this holds for every edge, H is a vertex cover of size at most k.
+
+**(Conclusion):** G has a vertex cover of size ≤ k if and only if the constructed Efficient Recruiting instance can be solved with ≤ k hires. Since the reduction is computable in polynomial time, we have Vertex Cover ≤ₚ Efficient Recruiting. ∎
+
+---
+
+## Problem 2: Hitting Set ≤ₚ Plot Fulfillment
+
+### Reduction
+
+Given an instance of Hitting Set: a universe U = {u₁, u₂, ..., u_m}, a collection of subsets S₁, S₂, ..., S_n ⊆ U, and an integer k, we construct an instance of Plot Fulfillment as follows:
+
+**Construct the directed graph (hypertext) as a layered graph with k layers:**
+
+- **Pages:**
+ - A start page s and an end page t.
+ - For each layer l ∈ {1, 2, ..., k} and each element u_j ∈ U, create a page p_{l,j}. This gives km pages plus s and t.
+
+- **Links (directed edges):**
+ - From s to p_{1,j} for every j ∈ {1, ..., m} (start page links to all pages in layer 1).
+ - From p_{l,j} to p_{l+1,j'} for every l ∈ {1, ..., k-1} and every j, j' ∈ {1, ..., m} (every page in layer l links to every page in layer l+1).
+ - From p_{k,j} to t for every j ∈ {1, ..., m} (all pages in layer k link to the end page).
+
+- **Thematic elements:** For each subset S_i (i = 1, ..., n), define the thematic element T_i = {p_{l,j} : 1 ≤ l ≤ k, u_j ∈ S_i}. That is, T_i contains all pages across all layers that correspond to elements in S_i.
+
+This reduction runs in polynomial time: the graph has 2 + km pages, O(km²) links, and n thematic elements.
+
+### Proof of Correctness
+
+**Key observation:** Any trail from s to t in this layered graph has the form:
+
+s → p_{1, j₁} → p_{2, j₂} → ... → p_{k, j_k} → t
+
+The trail selects exactly one page per layer, corresponding to elements u_{j₁}, u_{j₂}, ..., u_{j_k} from U (with possible repetitions). The set of elements "chosen" is H = {u_{j₁}, ..., u_{j_k}}, which has |H| ≤ k.
+
+**(Forward direction):** Suppose (U, S₁, ..., S_n, k) is a YES instance of Hitting Set. Then there exists H = {u_{j₁}, ..., u_{j_{k'}}} with k' ≤ k such that H ∩ S_i ≠ ∅ for all i. Construct a trail by:
+- In layers 1 through k', visit pages p_{l, j_l} corresponding to elements u_{j₁}, ..., u_{j_{k'}}.
+- In layers k'+1 through k (if k' < k), visit p_{l, j₁} (repeating the first element).
+
+This is a valid trail from s to t. For each thematic element T_i: since H ∩ S_i ≠ ∅, some u_{j_l} ∈ S_i, so the page p_{l, j_l} ∈ T_i is visited. Hence the trail contains at least one page from each T_i.
+
+**(Backward direction):** Suppose there is a trail from s to t that contains at least one page from each T_i. The trail visits pages p_{1,j₁}, ..., p_{k,j_k}. Define H = {u_{j₁}, ..., u_{j_k}} ⊆ U. Then |H| ≤ k. For each S_i: since the trail hits T_i, some p_{l, j_l} ∈ T_i, meaning u_{j_l} ∈ S_i, so H ∩ S_i ≠ ∅. Therefore H is a hitting set of size at most k.
+
+**(Conclusion):** The Hitting Set instance is a YES instance if and only if the constructed Plot Fulfillment instance is a YES instance. Since the construction is polynomial-time, we have Hitting Set ≤ₚ Plot Fulfillment. ∎
+
+---
+
+## Problem 3: Independent Set ≤ₚ Path Selection
+
+### Reduction
+
+Given an instance of Independent Set: a graph G = (V, E) and an integer k, we construct an instance of Path Selection as follows:
+
+**Construct a directed graph G' and a set of path requests:**
+
+- **Nodes of G':**
+ - For each vertex v ∈ V, create a unique start node s_v and end node t_v.
+ - For each edge e ∈ E, create a single shared node n_e.
+ - Total: 2|V| + |E| nodes.
+
+- **Path requests:** For each vertex v ∈ V, create a path request P_v defined as follows. Let e₁, e₂, ..., e_{d_v} be the edges incident to v in some fixed ordering (where d_v is the degree of v). Then:
+
+ P_v: s_v → n_{e₁} → n_{e₂} → ... → n_{e_{d_v}} → t_v
+
+ If v is an isolated vertex (d_v = 0), then P_v: s_v → t_v.
+
+- **Edges of G':** All directed edges along the paths P_v (for all v ∈ V).
+
+- **Selection budget:** k (same as the independent set target).
+
+This reduction runs in polynomial time.
+
+### Proof of Correctness
+
+**Key property:** Two paths P_u and P_v share a node if and only if u and v are adjacent in G.
+
+*Proof of key property:*
+- The start and end nodes s_v, t_v are unique to path P_v, so they never cause sharing.
+- The only potentially shared nodes are the edge nodes n_e. Node n_e appears in path P_v if and only if edge e is incident to v. So n_e appears in both P_u and P_v if and only if e is incident to both u and v, which means e = {u, v} ∈ E, i.e., u and v are adjacent.
+
+**(Forward direction):** Suppose G has an independent set S ⊆ V with |S| ≥ k. Consider the set of paths {P_v : v ∈ S}. Since no two vertices in S are adjacent, no edge of G connects two vertices in S. By the key property, no two paths in {P_v : v ∈ S} share any node. We have selected |S| ≥ k paths with no shared nodes.
+
+**(Backward direction):** Suppose we can select at least k paths from {P_v : v ∈ V} such that no two selected paths share any node. Let S be the set of vertices corresponding to the selected paths. Then |S| ≥ k. We claim S is an independent set: if two vertices u, v ∈ S were adjacent (i.e., {u, v} ∈ E), then by the key property, P_u and P_v would share the node n_{{u,v}}, contradicting the selection constraint. So no two vertices in S are adjacent.
+
+**(Conclusion):** G has an independent set of size ≥ k if and only if we can select ≥ k node-disjoint paths in the constructed Path Selection instance. Since the reduction is polynomial-time, we have Independent Set ≤ₚ Path Selection. ∎
+
+---
+
+## Problem 4: 3-SAT ≤ₚ Half 3-SAT Satisfiability
+
+### Reduction
+
+Given a 3-SAT instance φ with n variables x₁, ..., x_n and m clauses C₁, ..., C_m, we construct a Half 3-SAT instance φ' as follows:
+
+- Introduce one fresh variable y (not appearing in φ).
+- φ' contains the following 2m clauses:
+ 1. The m original clauses C₁, C₂, ..., C_m (unchanged).
+ 2. m dummy clauses D₁, D₂, ..., D_m, where each D_i = (y ∨ y ∨ y).
+
+The formula φ' has n + 1 variables and 2m clauses. Since 2m is always even, the Half 3-SAT requirement that the number of clauses be even is satisfied.
+
+This reduction runs in O(n + m) time, which is polynomial.
+
+### Proof of Correctness
+
+**Preliminary lemma:** *If φ is unsatisfiable, then there is no assignment to x₁, ..., x_n that makes all m clauses of φ simultaneously false.*
+
+*Proof of lemma:* Suppose for contradiction that assignment α makes all m clauses false. Each clause C_i = (l_{i1} ∨ l_{i2} ∨ l_{i3}) being false means l_{i1} = l_{i2} = l_{i3} = false under α. Define α' by flipping every variable: α'(x_j) = ¬α(x_j) for all j. Under α', every literal that was false under α becomes true: if l = x_j was false (α(x_j) = F), then α'(x_j) = T so l is true; if l = ¬x_j was false (α(x_j) = T), then α'(x_j) = F so ¬x_j is true. Since all three literals in every clause were false under α, all three are true under α', making every clause true. So α' satisfies φ, contradicting the assumption that φ is unsatisfiable. ∎
+
+**Behavior of dummy clauses:** Under any assignment, all m dummy clauses D_i = (y ∨ y ∨ y) have the same truth value:
+- If y = true: all m dummy clauses are true.
+- If y = false: all m dummy clauses are false.
+
+**(Forward direction):** Suppose φ is satisfiable, with satisfying assignment α. Extend α to α' by setting y = false. Under α':
+- All m original clauses are true (since α satisfies φ).
+- All m dummy clauses are false (since y = false).
+- Total true clauses: m out of 2m, which is exactly half. ✓
+
+**(Backward direction):** Suppose there exists an assignment β to φ' that makes exactly m out of 2m clauses true. There are two cases:
+
+- *Case β(y) = false:* All dummy clauses are false, contributing 0 true clauses. So all m true clauses must come from the original clauses. This means all m original clauses are true under β, so β restricted to x₁, ..., x_n satisfies φ.
+
+- *Case β(y) = true:* All m dummy clauses are true. Since exactly m of 2m total clauses are true, exactly 0 original clauses are true. By the preliminary lemma (applied contrapositively), if all original clauses are simultaneously false under some assignment, then flipping all variables gives a satisfying assignment. So φ is satisfiable.
+
+In both cases, φ is satisfiable.
+
+**(No false positives for unsatisfiable φ):** If φ is unsatisfiable, we show no assignment to φ' achieves exactly m true clauses:
+- If y = false: all dummy clauses are false. Original true count j ≤ m - 1 (since φ is unsatisfiable). Total = j ≤ m - 1 < m.
+- If y = true: all dummy clauses are true (contributing m). Original true count j ≥ 1 (by the lemma, j = 0 is impossible for unsatisfiable φ). Total = j + m ≥ m + 1 > m.
+
+In neither case does the total equal m. So no assignment makes exactly half the clauses true.
+
+**(Conclusion):** φ is satisfiable if and only if φ' has an assignment making exactly half its clauses true. Since the reduction is polynomial-time, we have 3-SAT ≤ₚ Half 3-SAT. ∎
Sub-Model Usage
| Model | Input | Output | Cache Read | Cost |
|---|---|---|---|---|
| claude-opus-4-6 | 4 | 30.5K | 76.2K | $1.07 |
BSCS Bench