Exercise

Reduce 3SAT to Independent Set

Build the occurrence graph and prove both directions of correctness.

Assignment sources

Semester A 2026 assignmentsOfficial assignmentexercise3.pdfQ4Authoritative course artifact
Noy 2025 high-quality exam preparation and community solutionsCommunity solutionפתרון מטלה 3 - סיבוכיות.pdfAssignment 3High-quality preparation and community solution — not official

Problem

Given a 3CNF formula φ=C1∧⋯∧Cm\varphi=C_1\land\cdots\land C_m, construct in polynomial time a graph GG such that φ\varphi is satisfiable iff GG has an independent set of size mm.

Hint 1

Create one vertex for each literal occurrence, not merely one per variable.

Hint 2

Prevent two kinds of incompatible choices: two occurrences from one clause, and complementary literals from different clauses.

Guided construction

3SAT → Independent Set

Step 1 of 7
φ =(x ∨ y ∨ z)∧(¬x ∨ y ∨ w)∧(¬y ∨ z ∨ w)
3SAT to Independent Set constructionThree clause panels become triangle gadgets. Solid edges join literals in one clause, dashed edges join complementary literals, and the final step selects x, y, and z as an independent set of size three.C1x ∨ y ∨ zsource clauseC2¬x ∨ y ∨ wsource clauseC3¬y ∨ z ∨ wsource clause
Same-clause edgeComplement conflict

Full solution

For each literal occurrence in each clause, create a vertex. Join every pair of vertices belonging to the same clause. Also join vertices labeled xx and ¬x\neg x, wherever those occurrences appear. Set k=mk=m.

If φ\varphi has a satisfying assignment, choose one true literal occurrence from each clause. No two chosen vertices are in one clause, and no chosen literals are complementary under one assignment, so they form an independent set of size mm.

Conversely, an independent set of size mm contains at most one vertex from each clause clique, hence exactly one from every clause. It contains no complementary pair. Assign every selected positive literal true and every selected negative literal false; consistency follows from the missing conflict edges. Extend unassigned variables arbitrarily. Each clause has its selected true literal, so φ\varphi is satisfied.

There are 3m3m vertices and at most O(m2)O(m^2) edges, so construction time and output size are polynomial.

Checkpoint

The converse must explain both “one per clause” and why selected literals extend to one consistent assignment.

Provenance note

This is an independently written presentation of a standard reduction. Student work is not treated as an authoritative source.

Common mistakes

  • Skipping a direction of correctness or an input-format edge case.
  • Measuring resources against a numeric value rather than encoded input length.
  • Treating an informal intuition as a proof of the stated bound.

Sources and verification

  • Merged summary, pp. 55-57
  • 2026 transcript 14 (graph-reduction context)
  • Sipser 3e, sec. 7.5
  • Garey-Johnson, GT20
  • Catalog mapping: data/exercises.json; statements and solutions are independently written; personal submissions are non-authoritative.