Build clause gadgets, add conflict edges, choose the threshold, and prove both directions.
1 Source formula 2 Occurrence vertices 3 Clause gadgets 4 Conflict edges 5 Set the threshold 6 Select a witness 7 Why the reduction works
φ = (x ∨ y ∨ z) ∧ (¬x ∨ y ∨ w) ∧ (¬y ∨ z ∨ w)
3SAT to Independent Set construction Three 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. C1 x ∨ y ∨ z source clause C2 ¬x ∨ y ∨ w source clause C3 ¬y ∨ z ∨ w source clause
Same-clause edge Complement conflict
Flip every non-edge into an edge, keep the same vertex set and threshold, and read an independent set as a clique.
1 Source graph 2 Independent set 3 Build the complement 4 Read the clique 5 Keep k 6 Why it works
Independent Set to Clique via graph complement A path on four vertices is complemented; an independent pair becomes a clique while the threshold stays k. Source G 1 2 3 4 Complement Ḡ 1 2 3 4
Original edge (removed) Complement edge (added)
Keep the same graph, complement the chosen vertex set, and send the threshold k to |V|−k.
1 Source graph 2 Independent set 3 Complement the set 4 Vertex cover 5 Move the threshold 6 Why it works
Independent Set to Vertex Cover via set complement An independent set on a path is complemented to a vertex cover while the threshold becomes n minus k. Same graph G 1 2 3 4
Split a long CNF clause into an equisatisfiable chain of triples using fresh variables, without exponential distributivity.
1 Long clause 2 Fresh variables 3 Build the chain 4 Pad short clauses 5 Equisatisfiability 6 Polynomial size
Source clause (a ∨ b ∨ c ∨ d ∨ e)
SAT to 3SAT by clause splitting A five-literal clause is replaced by three overlapping triples linked by two fresh variables. Source clause Fresh variable Output triple
Place literal vertices, cut every variable pair, score two edges per clause triangle, and meet threshold n+2m.
1 NAE formula 2 Literal vertices 3 Variable edges 4 Clause triangles 5 Set K = n+2m 6 Read a cut 7 Why it works
Source NAE-3CNF (x ∨ y ∨ z) ∧ (¬x ∨ y ∨ ¬z)
NAE-3SAT to multigraph Max-Cut Literal vertices with variable edges and clause triangles; a cut of size n+2m encodes an NAE assignment. Source NAE-3CNF
Variable edge Clause edge
Complete the graph, price original edges 1 and missing edges 2, set the budget B = n, and read a cheap tour back as a Hamiltonian cycle.
1 Source graph 2 Complete the graph 3 Price the edges 4 Set the budget 5 Read the tour 6 Why it works
Hamiltonian Cycle to TSP on five vertices A pentagon of five original cost-1 edges is completed by a pentagram of five cost-2 chords; the pentagon itself is a tour of cost five, exactly the budget B = n = 5. Source G — 5 vertices, 5 edges 1 2 3 4 5
Original edge of G — cost 1
Input Five vertices and one question The source instance is the pentagon on n = 5 vertices: only the five edges 1-2, 2-3, 3-4, 4-5, 5-1 exist. Does G have a Hamiltonian cycle?
Add the markers S+T and 2S−T so an equal split of the new total 4S must separate them and expose a subset of sum T.
1 Source instance 2 Total S 3 Add the markers 4 Balance the pans 5 Separate the markers 6 Why it works
A = {3, 5, 6, 11} T = 14
Subset Sum to Partition via two added markers Bars proportional to 3, 5, 6, 11 and to the markers 39 and 36 fill two pans that each total 50. Numbers drawn to scale 3 5 6 11
Original number
Input Start from the Subset Sum instance The same instance feeds the Subset Sum dynamic program: A = {3, 5, 6, 11} with target T = 14 . Every number is positive, and the bars are drawn to scale.
Check reduction direction and follow hardness through a chain of canonical problems.
1 Direction test 2 Preserve yes and no 3 Reduction chain 4 Detailed middle link 5 Compose reductions
Known-hard A source instance x
→ f(x) total polynomial compiler
→ Target B solver hypothetical fast algorithm
The solver's yes/no answer decides A
Direction Start from the hard problem To prove B hard, transform an instance of known-hard A and call a hypothetical B solver. This requires A ≤ₘᵖ B , not the reverse.
Explore the course reduction network and the transformation carried by every edge.
1 Logic source 2 Graph compatibility 3 Route problems 4 Cuts and colors 5 Arithmetic branch 6 Read the network
Canonical NP-complete reduction network SAT flows to 3SAT, then branches into compatibility graphs, route problems, cut and coloring problems, and arithmetic encodings. Every edge names its concrete transformation. Tseitin + clause splitting SAT 3SAT Logic / compatibility
Visible branch: Logic source 1 labeled transformations
Logic Create the reusable source Cook–Levin supplies SAT . Tseitin variables and clause splitting produce an equisatisfiable 3SAT instance without exponential CNF expansion.
The pages this was written from 1 page These pages were chosen by word overlap between the text here and the page's transcription — nobody has verified them. Treat them as a lead to check, not a citation.
Lecture 7 · page 2 משפט קוק-לוין Shared words קוק · לוין · ורק · משפט
Turn a bounded computation into Boolean constraints using local tableau windows.
1 Start configuration 2 Build the tableau 3 Name cell variables 4 Exactly one symbol 5 Start and accept 6 Check a local window 7 Count and decode
Input x = 10 · time bound T = 3 · tableau width S = 5
Configuration Fix the real start row Row zero records the input, blanks, and one state-marked tape symbol. Unit clauses will force this exact configuration.
Encode variable choices and clause satisfaction in no-carry digit columns.
1 Reserve digit columns 2 Add truth choices 3 Mark satisfied clauses 4 Add clause slack 5 Reach the target 6 Prove size and iff
φ = (x₁ ∨ ¬x₂) ∧ (¬x₁ ∨ x₂)
Layout Reserve variables and clauses The first two columns will force one truth choice per variable. The final two columns will certify that each clause receives a true literal.
The pages this was written from 2 pages These pages were chosen by word overlap between the text here and the page's transcription — nobody has verified them. Treat them as a lead to check, not a citation.
Lecture 11 · page 4 אלגוריתמי קירוב וסכום תת קבוצה Shared words בבסיס · הם · ספרות · גדול · המספרים · וסכום
Lecture 12 · page 3 SubsetSum Shared words להוסיף · הספרות · האחרונות · מספקת
Walk the construction and both directions of the proof.
1 Input & vertices 2 Black edges 3 Blue edges 4 Red edges 5 Forward direction 6 Backward direction 7 Why NAE
Input φ (x ∨ y ∨ z) ∧ (¬x ∨ y ∨ ¬z)
3NAE to 3-colouring: N, literal vertices and clause triangles A special vertex N is joined by black edges to six literal vertices; blue edges join each literal to its negation; each of the two clauses owns a red triangle whose vertices are linked to the literals of that clause. N N — burns colour 1 x ¬x y ¬y z ¬z literal vertices — 2n = 6 1:x 1:y 1:z 2:¬x 2:y 2:¬z C₁ = (x ∨ y ∨ z) C₂ = (¬x ∨ y ∨ ¬z) clause vertices — 3m = 6
Input A 3CNF formula, asked in the NAE sense Take φ = (x ∨ y ∨ z) ∧ (¬x ∨ y ∨ ¬z) with n = 3 variables and m = 2 clauses. The question is whether some assignment gives every clause both a true literal and a false one.
The output is a graph alone — no number is attached, because k = 3 is part of the target problem's DNA.
Vertices: one per literal (2n = 6), one special vertex N , and three vertices of its own for each clause (3m = 6). A clause vertex is labelled by the literal it will be joined to — but it is a separate object, not that literal.
Walk the construction and both directions of the proof.
1 Input G 2 Add v̂ 3 Forward direction 4 Backward direction 5 Identity fails 6 Isolated vertex fails 7 Correct on K₄
3-colouring to 4-colouring: adding one universally joined vertex The left panel shows the input graph with a colouring; the right panel shows the same graph plus a new vertex joined to every original vertex, with its colouring. Later steps swap the input for K₄ and compare the identity map, an isolated extra vertex and the real construction. Input instance of 3COL G = C₅ v₁ 1 v₂ 2 v₃ 1 v₄ 2 v₅ 3 C₅ ∈ 3COL ✓
edge of G (kept) colour 1 (dashed) colour 2 (solid) colour 3 (dotted)
Input A concrete 3-colourable graph Take G = C₅ , the 5-cycle. Odd cycles are not 2-colourable, but three colours suffice: 1, 2, 1, 2, 3 around the rim.
So G ∈ 3COL, and the reduction must send it to a graph that is in 4COL — and must send every non-3-colourable graph to one that is not.
Walk the construction and both directions of the proof.
1 Input ⟨G,k⟩ 2 Add v_xy 3 Delete isolated 4 Forward ⇒ 5 A witness from the sky 6 Repair map 7 Cost and consequence
⟨G, k = 2⟩ ∈ VC ?
Vertex Cover to Dominating Set: an edge vertex for every edge, isolated vertices deleted The source graph G with vertices a, b, c, d and an isolated vertex z sits on the left. On the right the graph Ĝ adds one vertex per edge joined to both endpoints, deletes z, and carries the same threshold k. Highlights show the cover U reused as a dominating set, a dominating set containing a new vertex, and the repair map that sends that new vertex back to an original one. G — the source graph a b c d z isolated original vertex of V
Input A cover of size 2, plus one isolated vertex Ask whether G has a vertex cover of size k = 2 . Its edges are ab, bc, bd, cd , and the vertex z is isolated.
The answer is YES: U = {b, c} meets all four edges. Note that z touches no edge, so it is never needed in a cover — remember that, it is about to matter.
Walk the construction and both directions of the proof.
1 The graph 2 Vertex numbers 3 Edge numbers 4 Target & no carrying 5 Forward 6 Why 0 is fatal 7 Backward 8 Value vs length
G = P₅: |V| = 5, m = |E| = 4 K = 3
The input path beside a chart of the edge-column totals On the left a path of five vertices and four edges, each edge carrying a badge with how many of its endpoints were chosen. On the right one bar per edge column, split into the part contributed by chosen vertices and the part contributed by that edge's own number, against guide lines at the target 2, the maximum 3, and the carry threshold 10. G — the input graph Edge-column totals cⱼ e₁ e₂ e₃ e₄ v₁ v₂ v₃ v₄ v₅ 0 2 3 10 e₁ e₂ e₃ e₄
Vertex number a_v
One row per constructed number; one column for d and one for each edge; the last rows give the column totals and the target. number d e₁ e₂ e₃ e₄ value
Step 0 — at most K becomes exactly K If K > |V| replace K by |V|. A cover of size ≤ K always pads up to size exactly K, so forcing K in column d is harmless.
Input A graph, an edge numbering, and K Take the path on five vertices, with m = |E| = 4 edges numbered e₁ = (v₁,v₂), e₂ = (v₂,v₃), e₃ = (v₃,v₄), e₄ = (v₄,v₅) , and ask for a vertex cover of size at most K = 3 .
Step 0 of the algorithm: if K > |V|, replace K by |V|. After that the construction may safely force exactly K instead of at most K — adding vertices to a cover keeps it a cover, so a smaller cover pads up to size exactly K, and if K > |V| the answer is yes anyway.
The reduction builds its numbers from G and K alone. It never looks for a cover — phrasing a construction in terms of the solution is the same grave sin rejected in 3COL ≤p 4COL.
Walk the construction and both directions of the proof.
1 Occurrences 2 Clause cliques 3 Negation edges 4 Forward ∃ 5 Forward ∀ 6 Backward 7 Cost & consequence
φ = (x₁ ∨ ¬x₂) ∧ (¬x₁ ∨ x₂ ∨ x₃) ∧ (¬x₂ ∨ ¬x₃) m = 3 clauses
The graph G-phi built from a three-clause CNF formula Seven 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 occurrence x₁ ¬x₂ ¬x₁ x₂ x₃ ¬x₂ ¬x₃ ¬x₂ occurs twice → two vertices
Vertex = one literal occurrence
Input One vertex per literal occurrence Take the general CNF formula φ = (x₁ ∨ ¬x₂) ∧ (¬x₁ ∨ x₂ ∨ x₃) ∧ (¬x₂ ∨ ¬x₃) . Clauses may be of any size — nothing here needs 3CNF.
Create a vertex for every literal occurrence , not for every variable. ¬x₂ appears in C₁ and again in C₃, so it gets two separate vertices. With 2 + 3 + 2 occurrences the graph has 7 vertices.
Walk the construction and both directions of the proof.
1 The co-IS input 2 Plant k−1 3 Join to every old 4 Forward 5 Why not isolated? 6 Backward 7 Cost & consequence
⟨G, k⟩ = ⟨C₅, 4⟩ co-IS: does G have no independent set of size 4?
Complement lemma f reduces A to B ⇔ f reduces Ā to B̄ — so a reduction may start from co-IS.
A five-cycle with three planted vertices joined to every original vertex The original graph is a pentagon of five vertices. Three planted vertices stand in a column to its right, with no edges among themselves and one thin edge to each of the five original vertices. In the comparison step the same graph is shown twice, once with those join edges and once without. G = C₅ — the input graph v₁ ✓ v₂ v₃ ✓ v₄ v₅ α(G) = 2 ≤ k − 1 = 3, but not necessarily equal
Original vertex of V Solid: original edge of G Independent set under discussion, ✓ ringed
Input Start from the complement question The complement lemma (lesson 21): a polynomial-time f is a reduction from A to B iff it is a reduction from Ā to B̄, since x ∈ A ⇔ f(x) ∈ B is logically the same as x ∉ A ⇔ f(x) ∉ B . That is what licenses starting from co-IS.
Take ⟨G, k⟩ = ⟨C₅, 4⟩ . The question is the negative one: is it true that G has no independent set of size 4? Yes — the largest independent set in a 5-cycle is a non-adjacent pair, so α(G) = 2 .
Notice the gap the construction has to close. Knowing that no set of size 4 exists only tells us the maximum is at most k−1 = 3 — here it is 2. MaxIS asks for exactly k−1, so something must pin the maximum down.
Walk the construction and both directions of the proof.
1 Input ⟨G,k⟩ 2 Inflate to size 3 3 A legal instance 4 Forward ⇒ 5 A cover from the sky 6 Repair map 7 Cost and consequence
⟨G, k = 2⟩ ∈ VC ?
Vertex Cover to 3-uniform hypergraph cover: each edge is inflated by a fresh vertex The source graph G with vertices a, b, c, d and edges ab, ac, bc, cd is shown on one side. On the other side the hypergraph H keeps those four vertices, adds a square vertex for each edge, and draws every hyperedge as a shaded area covering exactly three vertices. Highlights show the cover U reused unchanged, a hypergraph cover that contains a new vertex, and the repair map trading that new vertex for one of its two real endpoints. G — the source graph (edges of size 2) ab ac bc cd a b c d original vertex of V (circle)
Input The nearest problem — but the wrong arity The graph G has edges ab, ac, bc, cd and we ask for a cover of size k = 2 . The answer is YES: U = {a, c} meets all four edges.
Reduce from VC because it is the nearest problem: a vertex cover of a hypergraph is defined word for word as for a graph, and an ordinary graph is just a 2-uniform hypergraph.
The only obstacle is arity. The output must be 3-uniform, while every edge here is a set of size 2 — each edge has to be inflated to size 3 without moving the answer.
Walk the construction and both directions of the proof.
1 Multigraph G 2 Subdivide 3 Why G′ is simple 4 The threshold 5 Forward 6 Parity 7 Backward
|E| = 4 k = 3
Max-Cut on a multigraph reduced to Max-Cut on a simple graph On the left a multigraph with two parallel edges and a loop; on the right the simple graph in which every edge became a path of length three through two private vertices, with the cut sides, the crossing edges and the parity cases marked. G — multigraph e₁ e₂ e₃ e₄ a b c G′ — simple graph V′ starts as V original vertex of V
Input Parallel edges and a loop The input is ⟨G, k⟩ with G a multigraph on V = {a, b, c} : two parallel edges e₁, e₂ between a and b, one edge e₃ = {b, c} , and a loop e₄ = {c, c} . So |E| = 4 .
The question: does G have a cut with at least k = 3 crossing edges? Its best cut is U = {a, c}: e₁, e₂ and e₃ all cross, the loop never does.
Ordinary Max-Cut cannot even read this input — a simple graph has no parallel edges and no loops. That is what the reduction has to repair.
Walk the construction and both directions of the proof.
1 Input ⟨G,k⟩ 2 Why a leaf? 3 Add the leaves 4 Forward ⇒ 5 A set from the sky 6 Repair map 7 Cost and consequence
⟨G, k = 3⟩ ∈ VC ? modest ⇔ every degree ≤ 1
Vertex Cover to modest graph: a pendant leaf on every original vertex The source graph G, a triangle a, b, c with a pendant vertex d on c, is shown on one side. On the other side the graph G prime hangs a small leaf vertex on each of a, b, c and d. Degree badges appear next to every surviving vertex, deleted vertices are struck through, and highlights show the cover U reused as a deletion set, a deletion set that wastes a unit on a leaf, and the repair map that swaps that leaf for the vertex it hangs from. G — the source graph a b c d original vertex of V (large circle) original edge of E
Input Modest means maximum degree at most 1 Call a graph modest when its maximum degree is at most 1 — that is, when it is a disjoint union of isolated vertices and isolated edges. MODEST asks whether at most k vertices can be removed so that what is left is modest.
Our instance: G is the triangle a, b, c with a pendant d hanging off c, and k = 3 . The set U = {b, c} is a vertex cover: it meets ab, bc, ca and cd.
k is deliberately generous — 3 rather than the minimum 2 — because the backward direction has to survive a sloppy solution, not only an optimal one.
Walk the construction and both directions of the proof.
1 Directed G 2 Triples 3 Arcs 4 Degree 2 5 Forward 6 Direction spreads 7 Read it off
Directed Hamiltonian Cycle reduced to Undirected Hamiltonian Cycle On the left a directed graph on four vertices; on the right each vertex is expanded into an in, mid and out vertex arranged around a circle, so that the Hamiltonian cycle runs along the ring and the degree-two middle vertices force a uniform direction. G — directed 1→2 2→3 3→4 4→1 3→1 1 2 3 4 G′ — undirected each vertex is about to become a triple
Input A directed graph, and what erasing the arrows costs The input is a directed graph G on V = {1, 2, 3, 4} with the arcs 1→2, 2→3, 3→4, 4→1 and the extra arc 3→1 . Does G have a directed Hamiltonian cycle?
It does: 1 → 2 → 3 → 4 → 1 . The arc 3→1 is a genuine shortcut of G that this cycle does not take.
Simply erasing the arrowheads would be wrong: an undirected edge {u, v} may be walked from v to u even when only u→v exists. The construction has to encode the direction in the shape of the graph itself.
Walk the construction and both directions of the proof.
1 Input formula 2 Add the fresh z 3 Forward direction 4 Complement symmetry 5 Backward direction 6 Why z is shared 7 Consequence
φ = (x₁ ∨ x₂ ∨ x₃) ∧ (¬x₁ ∨ x₂ ∨ ¬x₃) ∧ (x₁ ∨ ¬x₂ ∨ ¬x₃)
3SAT to 4NAE: clause table with the appended literal z Each row is a clause and each cell a literal, coloured by its value under the current assignment. The fourth column holds the shared fresh literal z. Verdict pills on the right say whether the clause is satisfied and whether it is not-all-equal. φ under v = (1,1,1) — satisfied, but clause 1 is all-true C₁ x₁ = 1 x₂ = 1 x₃ = 1 satisfied ✓ all equal ✗ C₂ ¬x₁ = 0 x₂ = 1 ¬x₃ = 0 satisfied ✓ NAE ✓ C₃ x₁ = 1 ¬x₂ = 0 ¬x₃ = 0 satisfied ✓ NAE ✓ x₁ = 1 x₂ = 1 x₃ = 1
literal value 1 literal value 0
Input Satisfiable is not the same as NAE-satisfiable Take φ = (x₁ ∨ x₂ ∨ x₃) ∧ (¬x₁ ∨ x₂ ∨ ¬x₃) ∧ (x₁ ∨ ¬x₂ ∨ ¬x₃) and the satisfying assignment v = (1,1,1) .
Every clause has a true literal, so v satisfies φ. But clause 1 reads (1,1,1): all its literals agree, so v does not NAE-satisfy φ. NAE demands a true literal and a false one in every clause.
The reduction has to supply that missing false literal without disturbing satisfiability.
Walk the construction and both directions of the proof.
1 4CNF input 2 Split each clause 3 Cost and the trap 4 Forward 5 All the cases 6 Backward 7 Consequence
4NAE reduced to 3NAE by splitting every clause Two four-literal clauses are each split into two three-literal clauses joined by a fresh variable and its negation; literal values are shown as circles for true and squares for false, followed by the three forward cases and the backward extraction of a true and a false literal. φ — 4CNF, read under NAE C₁ x ℓ₁ y ℓ₂ z ℓ₃ ¬w ℓ₄ C₂ ¬x ℓ₁ w ℓ₂ z ℓ₃ y ℓ₄ each clause is about to be split in two each clause is about to be split in two
Input NAE semantics: every clause needs both values The input is the 4CNF φ = (x ∨ y ∨ z ∨ ¬w) ∧ (¬x ∨ w ∨ z ∨ y) .
The question is not ordinary satisfiability. An assignment NAE-satisfies φ when every clause holds at least one true literal and at least one false literal — “not all equal”.
That is a strictly stronger demand than satisfiability, and it is exactly why the SAT ≤ₚ 3SAT proof cannot simply be quoted here.
Walk the construction and both directions of the proof.
1 Input formula 2 Length 3 3 Length 2 4 Length 1 5 The truth table 6 Fresh per clause 7 Why it works
v: x₁ = F, x₂ = F, x₃ = T
Padding short clauses up to exactly three literals The three input clauses of lengths three, two and one are mapped to seven output clauses: the full clause is copied, the two-literal clause becomes two clauses using a fresh variable, and the unit clause becomes four clauses using two fresh variables. φ — input, at most 3 literals f(φ) — output, exactly 3 literals built clause by clause |C₁| = 3 · keep C₁ x₁ ∨ ¬x₂ ∨ x₃ |C₂| = 2 · pad with y₂ C₂ ¬x₁ ∨ x₂ |C₃| = 1 · pad with y₃, y₃′ C₃ x₃
Literal of φ
Input One clause of each length In 3SAT a clause holds at most three literals. Take φ = (x₁∨¬x₂∨x₃) ∧ (¬x₁∨x₂) ∧ (x₃) — lengths 3, 2 and 1.
The target problem 3SAT= demands exactly three literals in every clause, so only the two short clauses need work.
φ is satisfiable: the assignment x₁=F, x₂=F, x₃=T satisfies all three clauses. Keep it in mind — it will be reused verbatim on the output.