Agent Work: Homework7
Claude Sonnet 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: Efficient Recruiting [25 points]
Claim: Vertex Cover ≤ₚ Efficient Recruiting.
Reduction
Given a Vertex Cover instance (G = (V, E), k), we construct an Efficient Recruiting instance as follows:
- Sports: One sport for each edge e ∈ E (so there are |E| sports total).
- Applicants: One applicant for each vertex v ∈ V (so there are |V| applicants total).
- Qualifications: Applicant v is qualified in sport e if and only if v is an endpoint of e.
- Budget: k remains k (hire at most k counselors).
This construction runs in polynomial time (O(|V| + |E|)).
Proof of Correctness
(→) If G has a vertex cover S with |S| ≤ k, then the Efficient Recruiting instance has a solution.
Consider the set of applicants S (one applicant per vertex in S). We have |S| ≤ k. For every sport (edge) e = (u, v) ∈ E: since S is a vertex cover, at least one of u or v is in S. The corresponding applicant (u or v) is qualified in sport e (since that vertex is an endpoint of e). Therefore S covers all sports with at most k applicants.
(←) If the Efficient Recruiting instance has a solution A with |A| ≤ k, then G has a vertex cover of size ≤ k.
Let A be a set of at most k applicants covering all sports. Consider the corresponding set of vertices S = A ⊆ V. We have |S| ≤ k. For every edge e = (u, v) ∈ E: sport e must be covered by some applicant in A, and an applicant is qualified in sport e only if they correspond to an endpoint of e. Therefore either u ∈ S or v ∈ S. Since this holds for every edge, S is a vertex cover.
Since both directions hold, (G, k) ∈ Vertex Cover ⟺ the constructed instance ∈ Efficient Recruiting. ∎
---
Problem 2: Plot Fulfillment [25 points]
Claim: Hitting Set ≤ₚ Plot Fulfillment.
Reduction
Recall the Hitting Set problem: given sets S₁, ..., Sₙ over universe U = {u₁, ..., uₘ} and integer k, does there exist H ⊆ U with |H| ≤ k such that H ∩ Sᵢ ≠ ∅ for all i?
Given a Hitting Set instance (S₁, ..., Sₙ, U, k), we construct a Plot Fulfillment instance as follows:
Pages: Create the following pages:
- A start page s and an end page t.
- For each layer l ∈ {1, ..., k} and each element j ∈ {1, ..., m}, a page v_{l,j}.
(Total: km + 2 pages.)
Links (directed edges):
- s → v_{1,j} for all j ∈ {1, ..., m}.
- v_{l,j} → v_{l+1,j'} for all l ∈ {1, ..., k−1} and all j, j' ∈ {1, ..., m}.
- v_{k,j} → t for all j ∈ {1, ..., m}.
This forms a layered DAG where any trail from s to t visits exactly one page per layer.
Thematic elements: For each set Sᵢ (i = 1, ..., n), define $$T_i = \{ v_{l,j} : 1 \le l \le k,\; u_j \in S_i \}.$$
Start/End: s and t as defined above.
This construction runs in polynomial time (O(k·m·n) thematic elements and O(k·m²) links).
Proof of Correctness
Observation: The constructed hypertext graph is a layered DAG. Any trail from s to t must visit exactly one page from each layer 1 through k, say v_{1,j₁}, v_{2,j₂}, ..., v_{k,jₖ} for some indices j₁, ..., jₖ ∈ {1, ..., m}. Furthermore, any such sequence of indices yields a valid trail from s to t (all required links exist).
(→) If there is a hitting set H with |H| ≤ k, then there is a fulfilling trail.
Since |H| ≤ k, write H = {u_{j₁}, ..., u_{jₖ}} (padding with repetitions if |H| < k). Construct the trail: $$s \to v_{1,j_1} \to v_{2,j_2} \to \cdots \to v_{k,j_k} \to t.$$ For each thematic element Tᵢ: since H is a hitting set, some u_{jₗ} ∈ H ∩ Sᵢ. Then v_{l,jₗ} ∈ Tᵢ (by definition), and the trail visits v_{l,jₗ}. Thus the trail contains at least one page from every Tᵢ.
(←) If there is a trail from s to t visiting all Tᵢ, then there is a hitting set of size ≤ k.
Any such trail visits exactly one page per layer, say v_{1,j₁}, ..., v_{k,jₖ}. Define H = {u_{j₁}, ..., u_{jₖ}}. Then |H| ≤ k. For each set Sᵢ: the trail visits some page in Tᵢ, say v_{l,jₗ} ∈ Tᵢ. By definition of Tᵢ, u_{jₗ} ∈ Sᵢ, so H ∩ Sᵢ ∋ u_{jₗ} ≠ ∅. Thus H is a hitting set.
Since both directions hold, the Hitting Set instance is a YES-instance ⟺ the Plot Fulfillment instance is a YES-instance. ∎
---
Problem 3: Path Selection [25 points]
Claim: Independent Set ≤ₚ Path Selection.
Reduction
Given an Independent Set instance (G = (V, E), k), we construct a Path Selection instance as follows:
Directed graph H = (V_H, E_H):
- For each vertex v ∈ V: create unique nodes sᵥ (source) and tᵥ (sink).
- For each edge e ∈ E: create a unique node nₑ (edge node).
Paths: For each vertex v ∈ V, let e₁, e₂, ..., eₐ be the edges of G incident to v, listed in some fixed order (e.g., sorted by edge index). Define the path: $$P_v = s_v \to n_{e_1} \to n_{e_2} \to \cdots \to n_{e_a} \to t_v.$$ (If v is isolated, Pᵥ = sᵥ → tᵥ.) Add the directed edges of each Pᵥ to H.
Budget: k' = k (select at least k paths).
This construction runs in polynomial time: O(|V| + |E|) nodes and O(|V| · max_degree) edges.
Proof of Correctness
Key observation: Two paths Pᵤ and Pᵥ share a node if and only if (u, v) ∈ E.
*Proof of observation:*
- The nodes in Pᵤ are {sᵤ, tᵤ} ∪ {nₑ : e is incident to u}, and similarly for Pᵥ.
- Source/sink nodes are unique: sᵤ ≠ sᵥ and tᵤ ≠ tᵥ for u ≠ v.
- An edge node nₑ appears in Pᵤ iff e is incident to u, and in Pᵥ iff e is incident to v. For a simple graph, the only edge incident to both u and v is the edge e = (u,v) itself (if it exists).
- Therefore Pᵤ and Pᵥ share the node n_{(u,v)} iff (u, v) ∈ E, and share no nodes if (u, v) ∉ E. ∎
(→) If G has an independent set S with |S| ≥ k, then k node-disjoint paths can be selected.
Consider {Pᵥ : v ∈ S}. This is a set of |S| ≥ k paths. For any u, v ∈ S with u ≠ v: since S is independent, (u, v) ∉ E. By the key observation, Pᵤ and Pᵥ share no nodes. Thus these paths are pairwise node-disjoint.
(←) If k pairwise node-disjoint paths can be selected from {Pᵥ : v ∈ V}, then G has an independent set of size ≥ k.
Let {P_{v₁}, ..., P_{vₖ}} be pairwise node-disjoint paths, and let S = {v₁, ..., vₖ}. We have |S| = k. For any two distinct vᵢ, vⱼ ∈ S: since P_{vᵢ} and P_{vⱼ} are node-disjoint, by the key observation (contrapositive), (vᵢ, vⱼ) ∉ E. Therefore no two vertices of S are adjacent, so S is an independent set of size k.
Since both directions hold, (G, k) ∈ Independent Set ⟺ the constructed Path Selection instance is a YES-instance. ∎
---
Problem 4: Half 3-SAT Satisfiability [25 points]
Claim: 3-SAT ≤ₚ Half 3-SAT Satisfiability.
Key Lemma
Lemma: For any 3-CNF formula φ, if φ is unsatisfiable, then for every assignment A to the variables of φ, at least one clause of φ is satisfied by A.
Proof: Suppose for contradiction that some assignment A satisfies no clause of φ. Then for every clause (l₁ ∨ l₂ ∨ l₃) of φ, we have A(l₁) = A(l₂) = A(l₃) = 0. Consider the complementary assignment Ā defined by Ā(x) = 1 − A(x) for every variable x. For any literal l:
- If l = xⱼ: A(l) = A(xⱼ) = 0, so Ā(xⱼ) = 1, hence Ā(l) = 1.
- If l = ¬xⱼ: A(l) = 1 − A(xⱼ) = 0, so A(xⱼ) = 1 and Ā(xⱼ) = 0, hence Ā(¬xⱼ) = 1.
Thus Ā(l) = 1 for every literal l appearing in any clause of φ, which means Ā satisfies every clause of φ. This contradicts the assumption that φ is unsatisfiable. ∎
Reduction
Given a 3-SAT formula φ with m clauses C₁, ..., Cₘ (over variables x₁, ..., xₙ), construct a Half 3-SAT formula φ' with 2m clauses as follows:
- Variables: x₁, ..., xₙ (original) plus fresh variables w₁, w₂, w₃.
- Clauses: The original m clauses C₁, ..., Cₘ, plus m additional clauses D₁, ..., Dₘ, each equal to (¬w₁ ∨ ¬w₂ ∨ ¬w₃).
So φ' = C₁ ∧ ··· ∧ Cₘ ∧ (¬w₁ ∨ ¬w₂ ∨ ¬w₃) ∧ ··· ∧ (¬w₁ ∨ ¬w₂ ∨ ¬w₃) (2m clauses total, which is even).
This construction runs in polynomial time (O(m) additional clauses, O(1) additional variables).
Proof of Correctness
Observation: All m copies of (¬w₁ ∨ ¬w₂ ∨ ¬w₃) are satisfied or unsatisfied simultaneously. The clause (¬w₁ ∨ ¬w₂ ∨ ¬w₃) is false iff w₁ = w₂ = w₃ = true, and true otherwise.
Thus, the total number of satisfied clauses in φ' under any assignment is: $$\text{total} = (\text{# of } C_i \text{ satisfied}) + m \cdot \mathbf{1}[\neg w_1 \vee \neg w_2 \vee \neg w_3].$$
We need total = m (exactly half of 2m). There are two cases:
Case 1: w₁ = w₂ = w₃ = true. The indicator equals 0. Then total = (# of Cᵢ satisfied). For total = m, we need all m original clauses satisfied, i.e., φ is satisfiable.
Case 2: Not all of w₁, w₂, w₃ are true. The indicator equals 1. Then total = (# of Cᵢ satisfied) + m. For total = m, we need (# of Cᵢ satisfied) = 0, i.e., no clause of φ is satisfied.
(→) If φ is satisfiable: Take a satisfying assignment A* to x₁, ..., xₙ (so all m clauses Cᵢ are satisfied). Extend with w₁ = w₂ = w₃ = true. Then:
- All m clauses Cᵢ are satisfied.
- (¬w₁ ∨ ¬w₂ ∨ ¬w₃) = false, so all m clauses Dᵢ are unsatisfied.
- Total = m + 0 = m = 2m/2. ✓
So φ' ∈ Half 3-SAT Satisfiability.
(←) If φ is not satisfiable: We show no assignment achieves total = m in φ'.
- Case 1 (w₁ = w₂ = w₃ = true): total = (# of Cᵢ satisfied) ≤ m − 1 < m, since φ is unsatisfiable.
- Case 2 (not all true): total = (# of Cᵢ satisfied) + m. By the Key Lemma (since φ is unsatisfiable), (# of Cᵢ satisfied) ≥ 1. Therefore total ≥ m + 1 > m.
In both cases, total ≠ m. So φ' ∉ Half 3-SAT Satisfiability.
Since both directions hold, φ ∈ 3-SAT ⟺ φ' ∈ Half 3-SAT Satisfiability. ∎
Problem 1: Efficient Recruiting [25 points]
Score: 25/25 points
Assessment:
Approach: The student constructs the standard reduction from Vertex Cover to Efficient Recruiting — edges become sports, vertices become counselors, and endpoint incidence defines qualifications. This matches the reference solution.
Strengths:
- Clean, clearly stated reduction with explicit mappings
- Both directions of the proof are thorough and well-structured
- Polynomial time justification included
- Proper use of the equivalence structure: vertex cover ↔ counselor set
Errors/Gaps:
- None
Detailed Feedback: This is a textbook-quality reduction. The construction is identical to the reference solution, and both directions of the correctness proof are complete with no logical gaps. The student correctly identifies that covering all edges (vertex cover) corresponds exactly to covering all sports (recruiting), and the proof clearly explains why each direction holds.
Rubric Breakdown:
- Reduction construction: 10/10 — Correct mapping (edges→sports, vertices→counselors, endpoint→qualification)
- Forward direction (VC → ER): 6/6 — Complete and correct
- Backward direction (ER → VC): 6/6 — Complete and correct
- Polynomial time: 3/3 — Noted explicitly
---
Problem 2: Plot Fulfillment [25 points]
Score: 25/25 points
Assessment:
Approach: The student constructs a layered DAG with k layers and m nodes per layer (one per universe element), with complete bipartite connections between consecutive layers. Thematic elements encode the Hitting Set subsets across all layers. This matches the reference solution's approach.
Strengths:
- Excellent layered graph construction, clearly specified
- Thematic element sets correctly defined: T_i spans all layers for elements in S_i
- The "Observation" about trail structure is a valuable intermediate step that strengthens the proof
- Handles the case |H| < k elegantly via padding with repetitions
- Explicit polynomial time analysis
Errors/Gaps:
- None
Detailed Feedback: The student's reduction is essentially equivalent to the reference solution with more careful exposition. The key insight — that any trail from s to t picks exactly one node per layer, corresponding to choosing k elements (with possible repetition) — is clearly stated and used in both directions. The forward direction correctly handles the case where the hitting set has fewer than k elements by padding, and the backward direction correctly extracts a hitting set of size ≤ k from the trail's node selections. This is a thorough and rigorous proof.
Rubric Breakdown:
- Graph construction (layered DAG): 8/8 — Correct nodes, edges, and layer structure
- Thematic element definition: 4/4 — Correctly encodes hitting set subsets
- Forward direction (HS → PF): 5/5 — Complete, including padding argument
- Backward direction (PF → HS): 5/5 — Complete and correct
- Polynomial time: 3/3 — Explicit analysis provided
---
Problem 3: Path Selection [25 points]
Score: 25/25 points
Assessment:
Approach: The student constructs a different (and arguably cleaner) reduction than the reference. Rather than using a complete directed graph on edge-nodes, the student introduces dedicated source/sink nodes (s_v, t_v) for each vertex v, plus a shared edge-node n_e for each edge e. Each path P_v threads through the edge-nodes of v's incident edges, bookended by unique source/sink nodes.
Strengths:
- The "Key Observation" (P_u and P_v share a node ⟺ (u,v) ∈ E) is stated as a separate lemma with a careful proof — this is excellent mathematical practice
- The proof explicitly handles source/sink uniqueness and the edge-node sharing condition
- Both directions of the main proof are crisp and follow directly from the key observation
- Handles isolated vertices as a special case
- Construction is simpler and more intuitive than the reference's complete graph approach
Errors/Gaps:
- None
Detailed Feedback: This is an alternative reduction that differs from the reference solution but is entirely correct. The reference creates a complete directed graph on edge-nodes and defines paths by listing incident edges in order. The student instead creates a sparser graph with explicit source/sink nodes per vertex. The student's approach has the advantage that the key observation is cleaner to prove — since source and sink nodes are unique to each vertex, the only possible shared nodes are edge-nodes, and an edge-node n_e is shared by P_u and P_v if and only if e = (u,v). This makes the equivalence between independent sets and node-disjoint path selections transparent. The proof is rigorous and complete.
Rubric Breakdown:
- Reduction construction (graph + paths): 8/8 — Valid alternative construction, clearly specified
- Key observation / structural lemma: 4/4 — Carefully proved
- Forward direction (IS → PS): 5/5 — Complete and correct
- Backward direction (PS → IS): 5/5 — Complete and correct
- Polynomial time: 3/3 — Noted explicitly
---
Problem 4: Half 3-SAT Satisfiability [25 points]
Score: 25/25 points
Assessment:
Approach: The student uses a different (and cleaner) construction than the reference. Instead of one fresh variable y with 4m total clauses, the student introduces three fresh variables w₁, w₂, w₃ and appends m copies of (¬w₁ ∨ ¬w₂ ∨ ¬w₃), yielding 2m total clauses. A key lemma establishes that any unsatisfiable 3-CNF formula has at least one clause satisfied under every assignment.
Strengths:
- The Key Lemma is a clever and essential observation, proved rigorously via the complement assignment argument
- The construction is simpler than the reference (2m clauses vs 4m, achieving half = m)
- The case analysis in the backward direction is exhaustive and correct
- Clean separation into Case 1 (all w_i true) and Case 2 (not all true)
- The two-case structure makes it transparent why exactly m clauses can only be achieved when φ is satisfiable
Errors/Gaps:
- None
Detailed Feedback: This is an elegant alternative to the reference solution. The reference solution uses a single variable y with clauses T and F to create 4m total clauses, while the student uses three variables with m padding clauses to create 2m total clauses. The student's approach is arguably superior because it's more economical and the analysis is cleaner.
The critical element is the Key Lemma: for an unsatisfiable 3-CNF formula, every assignment satisfies at least one clause. The proof is correct — if some assignment satisfies zero clauses, the complement assignment satisfies all clauses (since flipping a variable flips every literal), contradicting unsatisfiability. This lemma is needed to rule out Case 2 in the backward direction, where the D-clauses contribute m satisfied clauses and we need zero from the C-clauses — but the lemma guarantees at least one C-clause is satisfied, making the total > m.
The forward direction is straightforward: set all w_i = true (making all D-clauses false) and use a satisfying assignment for φ (making all C-clauses true), giving exactly m = 2m/2 satisfied clauses. The backward direction's case analysis is airtight.
Rubric Breakdown:
- Reduction construction: 8/8 — Valid, clean construction with 2m clauses
- Key Lemma: 4/4 — Correct and rigorously proved
- Forward direction (3-SAT → Half 3-SAT): 5/5 — Complete and correct
- Backward direction (¬3-SAT → ¬Half 3-SAT): 5/5 — Both cases handled correctly
- Polynomial time: 3/3 — Noted explicitly
---
Overall Summary
| Problem | Score | Notes |
|---|---|---|
| 1 - Efficient Recruiting | 25/25 | Perfect reduction matching reference; both directions proved |
| 2 - Plot Fulfillment | 25/25 | Matches reference approach with excellent exposition; handles edge cases |
| 3 - Path Selection | 25/25 | Clean alternative construction with dedicated source/sink nodes; key observation proved as lemma |
| 4 - Half 3-SAT | 25/25 | Elegant alternative using 3 fresh variables and a well-proved key lemma; cleaner than reference |
| Total | 100/100 |
General Comments:
This is an outstanding submission. All four reductions are correct, complete, and rigorously proved. The student demonstrates deep understanding of NP-completeness reductions, consistently providing:
- Clear reduction constructions with explicit polynomial time justification
- Both directions of correctness proofs with no logical gaps
- Useful intermediate observations stated and proved as separate lemmas (especially Problems 3 and 4)
Problems 3 and 4 use alternative constructions that differ from the reference solutions but are equally (or more) correct and elegant. The Problem 4 solution is particularly noteworthy for its clean use of the complement-assignment lemma to handle the backward direction. This is graduate-level work of the highest quality.
Total: 100/100
diff --git a/writeup.md b/writeup.md
index 6069765..fa832dc 100644
--- a/writeup.md
+++ b/writeup.md
@@ -2,8 +2,176 @@
## Student Responses
-<!-- Write your solutions below. Add sections for each problem as needed. -->
-<!-- Use proper mathematical notation where applicable. -->
+---
-[Your solutions here]
+## Problem 1: Efficient Recruiting [25 points]
+**Claim:** Vertex Cover ≤ₚ Efficient Recruiting.
+
+### Reduction
+
+Given a Vertex Cover instance (G = (V, E), k), we construct an Efficient Recruiting instance as follows:
+
+- **Sports:** One sport for each edge e ∈ E (so there are |E| sports total).
+- **Applicants:** One applicant for each vertex v ∈ V (so there are |V| applicants total).
+- **Qualifications:** Applicant v is qualified in sport e if and only if v is an endpoint of e.
+- **Budget:** k remains k (hire at most k counselors).
+
+This construction runs in polynomial time (O(|V| + |E|)).
+
+### Proof of Correctness
+
+**(→) If G has a vertex cover S with |S| ≤ k, then the Efficient Recruiting instance has a solution.**
+
+Consider the set of applicants S (one applicant per vertex in S). We have |S| ≤ k. For every sport (edge) e = (u, v) ∈ E: since S is a vertex cover, at least one of u or v is in S. The corresponding applicant (u or v) is qualified in sport e (since that vertex is an endpoint of e). Therefore S covers all sports with at most k applicants.
+
+**(←) If the Efficient Recruiting instance has a solution A with |A| ≤ k, then G has a vertex cover of size ≤ k.**
+
+Let A be a set of at most k applicants covering all sports. Consider the corresponding set of vertices S = A ⊆ V. We have |S| ≤ k. For every edge e = (u, v) ∈ E: sport e must be covered by some applicant in A, and an applicant is qualified in sport e only if they correspond to an endpoint of e. Therefore either u ∈ S or v ∈ S. Since this holds for every edge, S is a vertex cover.
+
+Since both directions hold, (G, k) ∈ Vertex Cover ⟺ the constructed instance ∈ Efficient Recruiting. ∎
+
+---
+
+## Problem 2: Plot Fulfillment [25 points]
+
+**Claim:** Hitting Set ≤ₚ Plot Fulfillment.
+
+### Reduction
+
+Recall the Hitting Set problem: given sets S₁, ..., Sₙ over universe U = {u₁, ..., uₘ} and integer k, does there exist H ⊆ U with |H| ≤ k such that H ∩ Sᵢ ≠ ∅ for all i?
+
+Given a Hitting Set instance (S₁, ..., Sₙ, U, k), we construct a Plot Fulfillment instance as follows:
+
+**Pages:** Create the following pages:
+- A start page s and an end page t.
+- For each layer l ∈ {1, ..., k} and each element j ∈ {1, ..., m}, a page v_{l,j}.
+
+(Total: km + 2 pages.)
+
+**Links (directed edges):**
+- s → v_{1,j} for all j ∈ {1, ..., m}.
+- v_{l,j} → v_{l+1,j'} for all l ∈ {1, ..., k−1} and all j, j' ∈ {1, ..., m}.
+- v_{k,j} → t for all j ∈ {1, ..., m}.
+
+This forms a layered DAG where any trail from s to t visits exactly one page per layer.
+
+**Thematic elements:** For each set Sᵢ (i = 1, ..., n), define
+$$T_i = \{ v_{l,j} : 1 \le l \le k,\; u_j \in S_i \}.$$
+
+**Start/End:** s and t as defined above.
+
+This construction runs in polynomial time (O(k·m·n) thematic elements and O(k·m²) links).
+
+### Proof of Correctness
+
+**Observation:** The constructed hypertext graph is a layered DAG. Any trail from s to t must visit exactly one page from each layer 1 through k, say v_{1,j₁}, v_{2,j₂}, ..., v_{k,jₖ} for some indices j₁, ..., jₖ ∈ {1, ..., m}. Furthermore, any such sequence of indices yields a valid trail from s to t (all required links exist).
+
+**(→) If there is a hitting set H with |H| ≤ k, then there is a fulfilling trail.**
+
+Since |H| ≤ k, write H = {u_{j₁}, ..., u_{jₖ}} (padding with repetitions if |H| < k). Construct the trail:
+$$s \to v_{1,j_1} \to v_{2,j_2} \to \cdots \to v_{k,j_k} \to t.$$
+For each thematic element Tᵢ: since H is a hitting set, some u_{jₗ} ∈ H ∩ Sᵢ. Then v_{l,jₗ} ∈ Tᵢ (by definition), and the trail visits v_{l,jₗ}. Thus the trail contains at least one page from every Tᵢ.
+
+**(←) If there is a trail from s to t visiting all Tᵢ, then there is a hitting set of size ≤ k.**
+
+Any such trail visits exactly one page per layer, say v_{1,j₁}, ..., v_{k,jₖ}. Define H = {u_{j₁}, ..., u_{jₖ}}. Then |H| ≤ k. For each set Sᵢ: the trail visits some page in Tᵢ, say v_{l,jₗ} ∈ Tᵢ. By definition of Tᵢ, u_{jₗ} ∈ Sᵢ, so H ∩ Sᵢ ∋ u_{jₗ} ≠ ∅. Thus H is a hitting set.
+
+Since both directions hold, the Hitting Set instance is a YES-instance ⟺ the Plot Fulfillment instance is a YES-instance. ∎
+
+---
+
+## Problem 3: Path Selection [25 points]
+
+**Claim:** Independent Set ≤ₚ Path Selection.
+
+### Reduction
+
+Given an Independent Set instance (G = (V, E), k), we construct a Path Selection instance as follows:
+
+**Directed graph H = (V_H, E_H):**
+- For each vertex v ∈ V: create unique nodes sᵥ (source) and tᵥ (sink).
+- For each edge e ∈ E: create a unique node nₑ (edge node).
+
+**Paths:** For each vertex v ∈ V, let e₁, e₂, ..., eₐ be the edges of G incident to v, listed in some fixed order (e.g., sorted by edge index). Define the path:
+$$P_v = s_v \to n_{e_1} \to n_{e_2} \to \cdots \to n_{e_a} \to t_v.$$
+(If v is isolated, Pᵥ = sᵥ → tᵥ.) Add the directed edges of each Pᵥ to H.
+
+**Budget:** k' = k (select at least k paths).
+
+This construction runs in polynomial time: O(|V| + |E|) nodes and O(|V| · max_degree) edges.
+
+### Proof of Correctness
+
+**Key observation:** Two paths Pᵤ and Pᵥ share a node if and only if (u, v) ∈ E.
+
+*Proof of observation:*
+- The nodes in Pᵤ are {sᵤ, tᵤ} ∪ {nₑ : e is incident to u}, and similarly for Pᵥ.
+- Source/sink nodes are unique: sᵤ ≠ sᵥ and tᵤ ≠ tᵥ for u ≠ v.
+- An edge node nₑ appears in Pᵤ iff e is incident to u, and in Pᵥ iff e is incident to v. For a simple graph, the only edge incident to both u and v is the edge e = (u,v) itself (if it exists).
+- Therefore Pᵤ and Pᵥ share the node n_{(u,v)} iff (u, v) ∈ E, and share no nodes if (u, v) ∉ E. ∎
+
+**(→) If G has an independent set S with |S| ≥ k, then k node-disjoint paths can be selected.**
+
+Consider {Pᵥ : v ∈ S}. This is a set of |S| ≥ k paths. For any u, v ∈ S with u ≠ v: since S is independent, (u, v) ∉ E. By the key observation, Pᵤ and Pᵥ share no nodes. Thus these paths are pairwise node-disjoint.
+
+**(←) If k pairwise node-disjoint paths can be selected from {Pᵥ : v ∈ V}, then G has an independent set of size ≥ k.**
+
+Let {P_{v₁}, ..., P_{vₖ}} be pairwise node-disjoint paths, and let S = {v₁, ..., vₖ}. We have |S| = k. For any two distinct vᵢ, vⱼ ∈ S: since P_{vᵢ} and P_{vⱼ} are node-disjoint, by the key observation (contrapositive), (vᵢ, vⱼ) ∉ E. Therefore no two vertices of S are adjacent, so S is an independent set of size k.
+
+Since both directions hold, (G, k) ∈ Independent Set ⟺ the constructed Path Selection instance is a YES-instance. ∎
+
+---
+
+## Problem 4: Half 3-SAT Satisfiability [25 points]
+
+**Claim:** 3-SAT ≤ₚ Half 3-SAT Satisfiability.
+
+### Key Lemma
+
+**Lemma:** For any 3-CNF formula φ, if φ is unsatisfiable, then for every assignment A to the variables of φ, at least one clause of φ is satisfied by A.
+
+**Proof:** Suppose for contradiction that some assignment A satisfies no clause of φ. Then for every clause (l₁ ∨ l₂ ∨ l₃) of φ, we have A(l₁) = A(l₂) = A(l₃) = 0. Consider the complementary assignment Ā defined by Ā(x) = 1 − A(x) for every variable x. For any literal l:
+- If l = xⱼ: A(l) = A(xⱼ) = 0, so Ā(xⱼ) = 1, hence Ā(l) = 1.
+- If l = ¬xⱼ: A(l) = 1 − A(xⱼ) = 0, so A(xⱼ) = 1 and Ā(xⱼ) = 0, hence Ā(¬xⱼ) = 1.
+
+Thus Ā(l) = 1 for every literal l appearing in any clause of φ, which means Ā satisfies every clause of φ. This contradicts the assumption that φ is unsatisfiable. ∎
+
+### Reduction
+
+Given a 3-SAT formula φ with m clauses C₁, ..., Cₘ (over variables x₁, ..., xₙ), construct a Half 3-SAT formula φ' with 2m clauses as follows:
+
+- **Variables:** x₁, ..., xₙ (original) plus fresh variables w₁, w₂, w₃.
+- **Clauses:** The original m clauses C₁, ..., Cₘ, plus m additional clauses D₁, ..., Dₘ, each equal to (¬w₁ ∨ ¬w₂ ∨ ¬w₃).
+
+So φ' = C₁ ∧ ··· ∧ Cₘ ∧ (¬w₁ ∨ ¬w₂ ∨ ¬w₃) ∧ ··· ∧ (¬w₁ ∨ ¬w₂ ∨ ¬w₃) (2m clauses total, which is even).
+
+This construction runs in polynomial time (O(m) additional clauses, O(1) additional variables).
+
+### Proof of Correctness
+
+**Observation:** All m copies of (¬w₁ ∨ ¬w₂ ∨ ¬w₃) are satisfied or unsatisfied simultaneously. The clause (¬w₁ ∨ ¬w₂ ∨ ¬w₃) is **false** iff w₁ = w₂ = w₃ = true, and **true** otherwise.
+
+Thus, the total number of satisfied clauses in φ' under any assignment is:
+$$\text{total} = (\text{# of } C_i \text{ satisfied}) + m \cdot \mathbf{1}[\neg w_1 \vee \neg w_2 \vee \neg w_3].$$
+
+We need total = m (exactly half of 2m). There are two cases:
+
+**Case 1: w₁ = w₂ = w₃ = true.** The indicator equals 0. Then total = (# of Cᵢ satisfied). For total = m, we need all m original clauses satisfied, i.e., φ is satisfiable.
+
+**Case 2: Not all of w₁, w₂, w₃ are true.** The indicator equals 1. Then total = (# of Cᵢ satisfied) + m. For total = m, we need (# of Cᵢ satisfied) = 0, i.e., no clause of φ is satisfied.
+
+**(→) If φ is satisfiable:** Take a satisfying assignment A* to x₁, ..., xₙ (so all m clauses Cᵢ are satisfied). Extend with w₁ = w₂ = w₃ = true. Then:
+- All m clauses Cᵢ are satisfied.
+- (¬w₁ ∨ ¬w₂ ∨ ¬w₃) = false, so all m clauses Dᵢ are unsatisfied.
+- Total = m + 0 = m = 2m/2. ✓
+
+So φ' ∈ Half 3-SAT Satisfiability.
+
+**(←) If φ is not satisfiable:** We show no assignment achieves total = m in φ'.
+- **Case 1** (w₁ = w₂ = w₃ = true): total = (# of Cᵢ satisfied) ≤ m − 1 < m, since φ is unsatisfiable.
+- **Case 2** (not all true): total = (# of Cᵢ satisfied) + m. By the Key Lemma (since φ is unsatisfiable), (# of Cᵢ satisfied) ≥ 1. Therefore total ≥ m + 1 > m.
+
+In both cases, total ≠ m. So φ' ∉ Half 3-SAT Satisfiability.
+
+Since both directions hold, φ ∈ 3-SAT ⟺ φ' ∈ Half 3-SAT Satisfiability. ∎
Sub-Model Usage
| Model | Input | Output | Cache Read | Cost |
|---|---|---|---|---|
| claude-sonnet-4-6 | 8 | 29.5K | 273.9K | $1.14 |
BSCS Bench