clause cliques, literal–negation edges, threshold m

SAT ≤p MaxIS

SAT≤pMaxIS\mathrm{SAT}\le_p\mathrm{MaxIS}, so MaxIS\mathrm{MaxIS} is NP-hard. Here MaxIS\mathrm{MaxIS} is the language of pairs ⟨G,k⟩\langle G,k\rangle for which the maximum independent set has size exactly kk.

The construction

On a general CNF formula φ\varphi with mm clauses — not necessarily 3CNF; clauses may be of any size. Build Gφ=(V,E)G_\varphi=(V,E):

  1. Vertices. One vertex per literal occurrence in each clause. A literal appearing in several clauses gets several vertices, one per occurrence: a vertex represents an occurrence, not a variable.
  2. Red edges (within a clause). For each clause, join every two vertices born from it — each clause becomes a clique.
  3. Black edges (a literal and its negation). Join every vertex of a literal to every vertex of its negation.
  4. Return ⟨Gφ,m⟩\langle G_\varphi,m\rangle.

What each colour does. The red edges ensure an independent set takes at most one vertex per clause — this is what caps the maximum at mm. The black edges ensure a literal and its negation are never both chosen — so the choice is consistent and translates into a legal assignment.

Visualization

Guided construction

SAT → MaxIS

Step 1 of 7
φ = (x₁ ∨ ¬x₂) ∧ (¬x₁ ∨ x₂ ∨ x₃) ∧ (¬x₂ ∨ ¬x₃)m = 3 clauses
The graph G-phi built from a three-clause CNF formulaSeven vertices grouped in three clause columns. Solid red edges make each clause a clique; dashed dark edges join each literal to its negation. Three chosen vertices, one per clause, form an independent set of size three.G_φ — one vertex per literal occurrenceC₁ = (x₁ ∨ ¬x₂)C₂ = (¬x₁ ∨ x₂ ∨ x₃)C₃ = (¬x₂ ∨ ¬x₃)x₁¬x₂¬x₁x₂x₃¬x₂¬x₃¬x₂ occurs twice → two vertices
Vertex = one literal occurrence

Correctness — both directions

SAT ∈ ⟹ MaxIS ∈

Suppose φ∈SAT\varphi\in\mathrm{SAT}; some assignment V\mathcal V satisfies it, i.e. for every clause there exists a literal valued 11. (Quantifier order matters: not "there exists a literal for every clause", which is far stronger and simply false.)

Let UU consist of one such vertex per clause. With mm clauses and vertices of distinct clauses being distinct, ∣U∣=m|U|=m.

UU is independent. Let x,y∈Ux,y\in U be distinct.

  • A red edge? UU holds exactly one vertex per clause, so x,yx,y came from different clauses; red edges join only same-clause vertices.
  • A black edge? By choice, V\mathcal V values both corresponding literals 11. But a literal and its negation are never both 11, so x,yx,y are not a literal and its negation.

We are not done — that was only the "exists" half. The "for all" half is also needed:

Claim (maximality bound): every independent set in GφG_\varphi has size ≤m\le m. Let U^\hat U be independent. Any two vertices of one clause are joined by a red edge, so U^\hat U holds no two from one clause; there are mm clauses, so ∣U^∣≤m|\hat U|\le m. Note the claim holds for every φ\varphi, satisfiable or not — it depends only on the red edges.

Combining: an independent set of size mm exists, and every independent set has size ≤m\le m. So α(Gφ)=m\alpha(G_\varphi)=m, i.e. ⟨Gφ,m⟩∈MaxIS\langle G_\varphi,m\rangle\in\mathrm{MaxIS}.

MaxIS ∈ ⟹ SAT ∈

Suppose ⟨Gφ,m⟩∈MaxIS\langle G_\varphi,m\rangle\in\mathrm{MaxIS}, i.e. α(Gφ)=m\alpha(G_\varphi)=m; then some independent UU has ∣U∣=m|U|=m.

  1. UU is independent, so no two of its vertices carry a red edge; hence UU holds at most one vertex per clause.
  2. Since ∣U∣=m|U|=m and there are exactly mm clauses, with at most one per clause — by pigeonhole (in the tight direction) UU holds exactly one vertex per clause.

(These are two separate arguments: the first from independence, the second from counting.)

  1. UU is independent, so no black edge joins its vertices; hence UU holds no two vertices for a literal and its negation.
  2. The literals corresponding to UU's vertices are therefore consistent: no variable occurs both positively and negatively. So there exists an assignment V\mathcal V satisfying all of them — give each variable occurring in the collection the value satisfying its occurrence, and the rest arbitrary values.
  3. By item 2, UU holds a vertex from every clause, so V\mathcal V satisfies at least one literal in each clause, i.e. it satisfies φ\varphi.

Hence φ∈SAT\varphi\in\mathrm{SAT}.

Cost of the reduction

TimeO(|φ|²)
SpaceO(|φ|²)
Output size|V| ≤ |φ|, |E| = O(|φ|²)

Creating the vertices is a single pass, O(∣φ∣)O(|\varphi|), and in particular ∣V∣≤∣φ∣|V|\le|\varphi| — each vertex is born of one literal occurrence. The edges require a pass over all pairs, (∣V∣2)=O(∣V∣2)=O(∣φ∣2)\binom{|V|}{2}=O(|V|^2)=O(|\varphi|^2), each decision being a constant-time local test. Total O(∣φ∣2)O(|\varphi|^2).

Note that here, unlike 3SAT≤pIS\mathrm{3SAT}\le_p\mathrm{IS}, clause length need not be bounded: the vertex count is the number of literal occurrences, linear in formula length whatever the clause sizes.

What it buys

MaxIS\mathrm{MaxIS} is NP-hard. With IS‾≤pMaxIS\overline{\mathrm{IS}}\le_p\mathrm{MaxIS} it is coNP-hard too, and the two together give the unusual result: MaxIS∈NP∪coNP\mathrm{MaxIS}\in\mathrm{NP}\cup\mathrm{coNP} if and only if NP=coNP\mathrm{NP}=\mathrm{coNP}.

Pitfalls

  • The forward direction needs two claims, not one. For IS\mathrm{IS} it suffices to exhibit a set of size mm; for MaxIS\mathrm{MaxIS} one must also rule out a larger one. That is exactly where the SAT≤pIS\mathrm{SAT}\le_p\mathrm{IS} homework stops and the work here begins.

  • A "for all" claim opens with "let". The maximality bound is a statement about every independent set, so the proof must open "let U^\hat U be independent" — only once the variable is introduced may one argue by contradiction.

  • "There exists an assignment", not "the assignment can be determined". There is no uniqueness: a variable not occurring in UU takes a free value, so several assignments fit. The proof also stops being algorithmic at this point — it proves existence implies existence, and an algorithmic argument is only one way to do that.

The chain

Where this was read from

  • Lesson 22משפט 2: SAT≤pMaxIS\mathrm{SAT}\le_p\mathrm{MaxIS}, ולכן MaxIS\mathrm{MaxIS} היא NP-קשה
  • 2025"Define MAX-ISMAX\text{-}IS as the decision problem asking whether the maximum independent set has size exactly kk. Prove MAX-ISMAX\text{-}IS is NPNP-hard."