Reductions, Independent Set, and NP-Completeness

Reduction from 3SAT to Independent Set: Problem Formulation and Graph Construction

  • Reduction Objective and Target:

    • Establish that 3SAT is polynomial-time reducible to Independent Set (3SAT≤pIndependent Set\text{3SAT} \le_p \text{Independent Set}).
    • Given an arbitrary Boolean formula ϕ\phi in 3-Conjunctive Normal Form (3CNF), construct an undirected graph G=(V,E)G = (V, E) and an integer threshold kk in polynomial time such that ϕ\phi is satisfiable if and only if GG contains an independent set of size at least kk.
  • Structure of the Input 3CNF Formula ϕ\phi:

    • Let ϕ\phi consist of kk clauses conjoined by AND operators (∧\land):     ϕ=C1∧C2∧⋯∧Ck\phi = C_1 \land C_2 \land \dots \land C_k
    • Each clause contains exactly three literals conjoined by OR operators (∨\lor). Clause ii is represented generically as:     Ci=(ai∨bi∨ci)C_i = (a_i \lor b_i \lor c_i)
    • A literal is defined as a variable (e.g., yy) or the logical negation of a variable (e.g., yˉ\bar{y}).
    • Literals can appear multiple times across different clauses or within the same clause.
    • Indexing convention: The subscript ii designates clause ii, and letters a,b,ca, b, c uniquely identify the first, second, and third literal positions within that clause.
  • Threshold Selection:

    • The threshold parameter kk for the Independent Set instance is chosen to be exactly equal to the number of clauses in ϕ\phi.
  • Graph Vertex Set Construction:

    • Create exactly one vertex in VV for every literal occurrence appearing in ϕ\phi.
    • Because there are kk clauses and each clause contains exactly 3 literals, the total number of vertices in GG is precisely 3k3k (∣V∣=3k|V| = 3k).
    • Vertices are labeled by their corresponding literal. If a literal appears multiple times in ϕ\phi, distinct nodes are created for each individual occurrence.
    • Vertices are partitioned into kk disjoint triples, where each triple corresponds to the three literals of a single clause.
  • Graph Edge Set Construction:

    • The graph GG is undirected. An edge (u,v)(u, v) is added between two distinct vertices u,v∈Vu, v \in V if and only if at least one of the following two rules applies:
    • Edge Type 1 (Clause Triples): Vertices uu and vv correspond to literals within the same clause (the same triple). Connecting all three pairs within each triple forms a 3-clique (K3K_3 or triangle).
    • Edge Type 2 (Conflicting Literals): Vertices uu and vv represent opposing literals for the same underlying variable across different clauses (e.g., uu is labeled by variable xx and vv is labeled by xˉ\bar{x}).
    • No edges are placed between identical literals belonging to different clauses (e.g., no edge connects yy to yy).
  • Concrete Construction Example:

    • Consider a formula ϕ\phi with k=3k = 3 clauses and 2 variables (x,yx, y):     ϕ=(x∨x∨y)∧(xˉ∨yˉ∨yˉ)∧(y∨y∨xˉ)\phi = (x \lor x \lor y) \land (\bar{x} \lor \bar{y} \lor \bar{y}) \land (y \lor y \lor \bar{x})
    • Vertex set: Contains 3×3=93 \times 3 = 9 total vertices partitioned into three triples:
    • Triple 1: Vertices labeled xx, xx, and yy, mutually connected by Type 1 edges.
    • Triple 2: Vertices labeled xˉ\bar{x}, yˉ\bar{y}, and yˉ\bar{y}, mutually connected by Type 1 edges.
    • Triple 3: Vertices labeled yy, yy, and xˉ\bar{x}, mutually connected by Type 1 edges.
    • Inter-triple edges (Type 2): Added between every vertex labeled xx and every vertex labeled xˉ\bar{x}, and between every vertex labeled yy and every vertex labeled yˉ\bar{y}.
  • Computational Complexity of the Construction:

    • Generating ∣V∣=3k|V| = 3k vertices requires linear time O(k)O(k) relative to the formula length.
    • Determining the edge set requires inspecting all pairs of vertices. For n=3kn = 3k vertices, there are (n2)=O(n2)\binom{n}{2} = O(n^2) candidate pairs.
    • Verifying whether two nodes belong to the same clause triple or possess contradictory labels takes O(1)O(1) time per pair.
    • The overall reduction runs in quadratic time O(n2)O(n^2), satisfying the requirement for polynomial-time execution.

Correctness of the Reduction: Forward Direction

  • Theorem (Forward Implication):

    • If the 3CNF formula ϕ\phi is satisfiable, then the graph GG contains an independent set of size kk.
  • Structural Properties of Output Graphs:

    • The reduction function is not onto (surjective). It does not map to arbitrary graphs, but rather to a specialized family of graphs whose vertex count is a multiple of 3, organized into disjoint triangles with specific cross-clause conflict edges.
  • Forward Direction Proof:

    • Assume ϕ\phi is satisfiable. By definition, there exists a truth assignment WW assigning binary values (00 or 11) to all variables such that ϕ\phi evaluates to true.
    • Under assignment WW, at least one literal in each of the kk clauses evaluates to true.
    • Construct a vertex candidate set S⊆VS \subseteq V by selecting exactly one vertex from each clause triple whose corresponding literal is true under WW.
    • If a clause has more than one true literal, select one true literal arbitrarily to break the tie.
    • In the example ϕ=(x∨x∨y)∧(xˉ∨yˉ∨yˉ)∧(y∨y∨xˉ)\phi = (x \lor x \lor y) \land (\bar{x} \lor \bar{y} \lor \bar{y}) \land (y \lor y \lor \bar{x}), the assignment x=0x = 0 and y=1y = 1 satisfies ϕ\phi.
    • Clause 1 is satisfied by y=1y = 1; select vertex yy.
    • Clause 2 is satisfied by xˉ=1\bar{x} = 1 (since x=0x = 0); select vertex xˉ\bar{x}.
    • Clause 3 is satisfied by both y=1y = 1 and xˉ=1\bar{x} = 1; select either vertex arbitrarily.
    • Size Verification: Because exactly one vertex is picked from each of the kk clauses, the cardinality of SS is precisely ∣S∣=k|S| = k.
    • Independence Verification:
    • Type 1 Edges: No two vertices in SS are connected by a Type 1 edge because SS contains exactly one vertex from each clause triple, and Type 1 edges exist exclusively within the same triple.
    • Type 2 Edges: No two vertices in SS can be connected by a Type 2 edge. A Type 2 edge connects a variable xx to its complement xˉ\bar{x}. Under any valid truth assignment WW, a variable and its negation cannot simultaneously evaluate to true. Because all vertices in SS correspond strictly to literals evaluated as true under WW, SS cannot contain both xx and xˉ\bar{x}.
    • Since no two vertices in SS share an edge of Type 1 or Type 2, SS forms an independent set of size kk in GG.

Correctness of the Reduction: Reverse Direction

  • Theorem (Reverse Implication):

    • If the graph GG contains an independent set of size kk, then the 3CNF formula ϕ\phi is satisfiable.
  • Proof Strategy Formulation:

    • An if-and-only-if statement requires proving both directions. The reverse direction can be established either directly (GG has a kk-independent set   ⟹  ϕ\implies \phi is satisfiable) or via the contrapositive (ϕ\phi is unsatisfiable   ⟹  G\implies G has no kk-independent set).
    • Direct proof is preferable because the existence of an explicit kk-element independent set provides concrete structural constraints that translate directly into a truth assignment.
  • Reverse Direction Proof:

    • Let SS be an independent set in GG with ∣S∣=k|S| = k.
    • Clause Coverage Constraint:
    • The graph contains kk disjoint clause triangles. Within each triangle, all three vertices are pairwise adjacent via Type 1 edges.
    • An independent set can contain at most one vertex from any clique. Consequently, SS can contain at most one vertex from each clause triangle.
    • Since ∣S∣=k|S| = k and there are exactly kk clause triangles, by the pigeonhole principle, SS must contain exactly one vertex from every clause triangle.
    • Assignment Construction Rule:
    • For every variable aa, set a=truea = \text{true} if a vertex labeled aa is in SS.
    • Set a=falsea = \text{false} if a vertex labeled aˉ\bar{a} is in SS.
    • If neither aa nor aˉ\bar{a} appears as a label on any vertex in SS, assign aa an arbitrary truth value (e.g., a=truea = \text{true} or a=falsea = \text{false}).
    • Consistency / Well-Definedness of Assignment:
    • Suppose for contradiction that the rule attempts to assign a variable aa to be both true and false. This would require SS to contain both a node labeled aa and a node labeled aˉ\bar{a}.
    • By the definition of Type 2 edges, an edge connects any node labeled aa to any node labeled aˉ\bar{a}.
    • Because SS is an independent set, no two vertices in SS can be adjacent, precluding both aa and aˉ\bar{a} from belonging to SS.
    • Thus, at most one of aa or aˉ\bar{a} is in SS, ensuring the truth assignment is completely consistent and well-defined.
    • Clause Satisfaction Verification:
    • Because SS contains exactly one node from every clause triangle, each clause has at least one literal whose corresponding vertex is in SS.
    • Under the constructed assignment, every literal present in SS evaluates to true.
    • Therefore, each clause contains at least one true literal, meaning the truth assignment satisfies the entire 3CNF formula ϕ\phi.

Methodological Principles and Sanity Checks in Reductions

  • Formal Definition of Polynomial-Time Reduction (A≤pBA \le_p B):

    • A language or decision problem AA is polynomial-time reducible to language BB (A≤pBA \le_p B) if there exists a polynomial-time computable function ff such that for all inputs xx:     x∈A  ⟺  f(x)∈Bx \in A \iff f(x) \in B
    • xx is a yes-instance of AA if and only if f(x)f(x) is a yes-instance of BB.
  • Algorithmic Implications:

    • If A≤pBA \le_p B and B∈PB \in \text{P}, then A∈PA \in \text{P}.
    • Let MBM_B be a polynomial-time decider for BB. A polynomial-time decider for AA is formed by computing f(x)f(x) and passing it directly as a tail call to MBM_B, returning MB(f(x))M_B(f(x)).
    • Contrapositive implication: If A≤pBA \le_p B and A∉PA \notin \text{P}, then B∉PB \notin \text{P}.
    • Reductions are primarily deployed in this contrapositive fashion: assuming 3SAT is not in P, the reduction 3SAT≤pIndependent Set\text{3SAT} \le_p \text{Independent Set} proves that Independent Set is also not in P.
  • Sanity Check on Reduction Algorithms:

    • The reduction function ff does not decide or evaluate whether x∈Ax \in A.
    • The reduction is a purely mechanical, syntax-level transformation of the input instance.
    • In the reduction from 3SAT to Independent Set, the algorithm mechanically translates clauses into triples and conflicting literals into edges. At no point does the algorithm determine whether ϕ\phi is satisfiable or whether GG has an independent set.
    • If an attempted reduction relies on determining whether the input is a yes-instance or a no-instance, the reduction is conceptually invalid.

NP-Hardness and NP-Completeness Foundations

  • NP-Hardness Definition:

    • A language or decision problem BB is NP-hard if every language A∈NPA \in \text{NP} is polynomial-time reducible to BB:     ∀A∈NP,A≤pB\forall A \in \text{NP}, \quad A \le_p B
  • NP-Completeness Definition:

    • A language or decision problem BB is NP-complete if it satisfies two conditions:
    1. B∈NPB \in \text{NP} (membership in NP: solutions can be verified in polynomial time by a deterministic verifier given a certificate/witness).
    2. BB is NP-hard (∀A∈NP,A≤pB\forall A \in \text{NP}, A \le_p B).
  • Significance of NP-Complete Problems:

    • NP-complete problems represent the hardest problems in NP.
    • Theorem: If any NP-complete problem BB belongs to P, then P=NP\text{P} = \text{NP}.
    • Proof:
    • Assume BB is NP-complete and B∈PB \in \text{P}.
    • To show P=NP\text{P} = \text{NP}, it suffices to demonstrate NP⊆P\text{NP} \subseteq \text{P} (since P⊆NP\text{P} \subseteq \text{NP} is established: any polynomial-time decider can act as a verifier by ignoring the witness).
    • Let AA be an arbitrary problem in NP.
    • Because BB is NP-hard, A≤pBA \le_p B.
    • Because B∈PB \in \text{P} and A≤pBA \le_p B, AA must also possess a polynomial-time algorithm (A∈PA \in \text{P}).
    • Since AA was an arbitrary problem in NP, all problems in NP are in P. Thus, P=NP\text{P} = \text{NP}.
    • Contrapositive Corollary: If P≠NP\text{P} \ne \text{NP}, then no NP-complete problem can be decided in polynomial time (B∉PB \notin \text{P} for all NP-complete BB).

Transitivity of Reductions and Proving NP-Completeness

  • Transitivity Theorem of Polynomial-Time Reductions:

    • If problem AA is polynomial-time reducible to problem BB (A≤pBA \le_p B via function ff) and problem BB is polynomial-time reducible to problem CC (B≤pCB \le_p C via function gg), then AA is polynomial-time reducible to problem CC (A≤pCA \le_p C).
    • Proof: Define the composite reduction function h(x)=g(f(x))h(x) = g(f(x)). Since the composition of two polynomial functions remains a polynomial, hh is computable in polynomial time. Furthermore, x∈A  ⟺  f(x)∈B  ⟺  g(f(x))∈Cx \in A \iff f(x) \in B \iff g(f(x)) \in C.
    • Algorithmic representation:
    • Given input x, compute y = f(x).
    • Compute z = g(y).
    • Feed z to polynomial-time decider decider_C(z) and return its output.
  • Standard Technique for Proving NP-Hardness:

    • Theorem: If problem BB is NP-hard and B≤pCB \le_p C, then problem CC is NP-hard.
    • Proof:
    • Let AA be an arbitrary problem in NP.
    • Since BB is NP-hard, A≤pBA \le_p B.
    • By transitivity, since A≤pBA \le_p B and B≤pCB \le_p C, it follows that A≤pCA \le_p C.
    • Because this holds for every A∈NPA \in \text{NP}, CC satisfies the definition of NP-hardness.
    • If it is additionally demonstrated that C∈NPC \in \text{NP}, then CC is proven to be NP-complete.
    • Critical Directionality Warning: To show CC is NP-hard, one must reduce from a known NP-hard problem BB to the new target problem CC (B≤pCB \le_p C). Reducing the new problem to the known problem (C≤pBC \le_p B) is a common error that fails to demonstrate that CC is NP-hard.
  • Historical Foundation and Reduction Chains:

    • Cook-Levin Theorem (1971): Proved directly that SAT (Boolean Satisfiability) is NP-complete by converting an arbitrary polynomial-time Turing machine verifier into a Boolean formula / Boolean circuit simulating the computation.
    • Once a foundational problem is established as NP-complete, other problems are proven NP-complete without appealing to arbitrary NP problems, via reduction chains:
    • Cook established that SAT≤p3SAT\text{SAT} \le_p \text{3SAT}, making 3SAT NP-complete.
    • Using 3SAT≤pIndependent Set\text{3SAT} \le_p \text{Independent Set}, Independent Set is proven NP-complete.
    • Using Independent Set≤pClique\text{Independent Set} \le_p \text{Clique}, Clique is proven NP-complete.
    • Selection heuristics: When proving a problem NP-complete, search first for an existing NP-complete problem with similar characteristics. If none is obvious, 3SAT serves as an exceptionally versatile base problem due to its simple, rigid clause structure.

Reduction from 3SAT to Subset Sum: Formulation and Integer Construction

  • Subset Sum Problem Definition:

    • Input: A multiset of positive integers CC and a target integer tt.
    • Question: Does there exist a sub-multiset S⊆CS \subseteq C whose elements sum exactly to tt?     ∑s∈Ss=t\sum_{s \in S} s = t
    • Allowing CC to be a multiset (containing multiple identical integers) simplifies the reduction. (The variation where CC is restricted to a standard set is also NP-complete).
  • Reduction Setup (3SAT≤pSubset Sum\text{3SAT} \le_p \text{Subset Sum}):

    • Given a 3CNF formula ϕ\phi with mm variables (x1,x2,…,xmx_1, x_2, \dots, x_m) and ll clauses.
    • Construct a multiset of integers CC and a target integer tt such that ϕ\phi is satisfiable if and only if a sub-multiset of CC sums to tt.
  • Structure of Multiset CC:

    • The multiset CC contains exactly 2m+2l2m + 2l integers, partitioned into two groups:
    • Variable Integers: For each variable xix_i (1≤i≤m1 \le i \le m), create a pair of integers, yiy_i and ziz_i (mm pairs total, representing the positive and negative assignments of xix_i).
    • Clause Slack Integers: For each clause jj (1≤j≤l1 \le j \le l), create a pair of integers, gjg_j and hjh_j (ll pairs total, used to absorb excess true literals in clause jj). Specifically, gj=hjg_j = h_j.
  • Positional Digit Encoding (Base 10 / Base 4):

    • Integers are structured with m+lm + l decimal digit positions (no carries occur if interpreted in base 10 or base 4):
    • The leading mm digits correspond to variables x1x_1 through xmx_m.
    • The trailing ll digits correspond to clauses 11 through ll.
    • Digit Assignments for Variable Integers (yi,ziy_i, z_i):
    • In the variable column corresponding to xix_i, both yiy_i and ziz_i have a digit 11. In all other variable columns, they have 00.
    • In the clause column corresponding to clause jj:
      • yiy_i contains a 11 if literal xix_i appears in clause jj; otherwise 00.
      • ziz_i contains a 11 if literal xˉi\bar{x}_i appears in clause jj; otherwise 00.
    • Digit Assignments for Slack Integers (gj,hjg_j, h_j):
    • All mm variable digit positions are 00.
    • In the clause column for clause jj, both gjg_j and hjh_j contain a 11. In all other clause columns, they have 00.
    • Target Integer tt:
    • The leading mm variable digits are all set to 11.
    • The trailing ll clause digits are all set to 33.
    • Target tt is the only number in the construction containing digits other than 00 and 11.
  • Concrete Numerical Example:

    • Consider a 3CNF formula with m=4m = 4 variables (x1,x2,x3,x4x_1, x_2, x_3, x_4) and l=3l = 3 clauses, yielding 7-digit integers in base 10:
    • Integer y1y_1 is represented as 1,000,1011{,}000{,}101.
    • Integer z1z_1 is represented as 1,000,0101{,}000{,}010.

Questions & Discussion

  • Comprehension Check on 3SAT to Independent Set Reduction:
    • Prompt: Are there questions regarding the underlying mechanics of how 3SAT reduces to Independent Set before moving forward into NP-completeness and Subset Sum?
    • Clarification & Rationale: Ensuring firm mastery of the bidirectional argument—how a satisfying assignment isolates an independent set across clause triangles and conflict edges, and how an independent set of size kk translates back into a well-defined truth assignment—is essential, as similar reduction methodologies are central to complexity theory problem solving.