All28 The SAT family6 Graph problems13 Numeric problems4 Paths and cycles3 Inapproximability barriers2
Any source Lesson23 Exercise13 Exam18
All With visualization27 Without1
computation tableau, 2×3 windows Visual
Every language A ∈ N P A\in\mathrm{NP} A ∈ NP satisfies A ≤ p S A T A\le_p\mathrm{SAT} A ≤ p SAT . This is the Cook–Levin theorem: S A T \mathrm{SAT} SAT is NP-hard, and since S A T ∈ N P \mathrm{SAT}\in\mathrm{NP} SAT ∈ NP as well, it is NP-complete. L9 Lesson Exercise Exam
the identity map
3 S A T ≤ p S A T \mathrm{3SAT}\le_p\mathrm{SAT} 3SAT ≤ p SAT , and therefore 3 S A T ∈ N P \mathrm{3SAT}\in\mathrm{NP} 3SAT ∈ NP .L8 Lesson
clause splitting with a fresh variable Visual
S A T ≤ p 3 S A T \mathrm{SAT}\le_p\mathrm{3SAT} SAT ≤ p 3SAT , hence 3 S A T \mathrm{3SAT} 3SAT is NP-complete.L8 Lesson Exercise Exam
padding short clauses Visual
Let 3 S A T = \mathrm{3SAT}^{=} 3SAT = be the variant in which every clause holds exactly three literals. Then 3 S A T ≤ p 3 S A T = \mathrm{3SAT}\le_p\mathrm{3SAT}^{=} 3SAT ≤ p 3SAT = , so 3 S A T = \mathrm{3SAT}^{=} 3SAT = is NP-complete too. L8 Lesson
a shared fourth literal Visual
3 S A T ≤ p 4 N A E \mathrm{3SAT}\le_p\mathrm{4NAE} 3SAT ≤ p 4NAE , so 4 N A E \mathrm{4NAE} 4NAE is NP-hard. A formula is NAE-satisfiable if some assignment gives every clause both a true literal and a false one.L10 Lesson Exam
NAE clause splitting with a fresh variable Visual
4 N A E ≤ p 3 N A E \mathrm{4NAE}\le_p\mathrm{3NAE} 4NAE ≤ p 3NAE , so 3 N A E \mathrm{3NAE} 3NAE is NP-hard.L10 Lesson Exam
graph complement Visual
I S ≤ p C L I Q U E \mathrm{IS}\le_p\mathrm{CLIQUE} IS ≤ p CLIQUE : a polynomial algorithm for C L I Q U E \mathrm{CLIQUE} CLIQUE would also solve I S \mathrm{IS} IS .L7 Lesson Exercise
graph complement, the other way Visual
C L I Q U E ≤ p I S \mathrm{CLIQUE}\le_p\mathrm{IS} CLIQUE ≤ p IS — the very same reduction , passing to the complement, works in the reverse direction too.L7 Lesson Exam
same graph, complement the set Visual
I S ≤ p V C \mathrm{IS}\le_p\mathrm{VC} IS ≤ p VC , hence V C \mathrm{VC} VC is NP-complete.L10 Lesson Exercise Exam
a vertex per satisfying assignment, an edge per conflict Visual
3 S A T ≤ p I S \mathrm{3SAT}\le_p\mathrm{IS} 3SAT ≤ p IS , hence I S \mathrm{IS} IS is NP-complete.Exercise Exam
variable edges, clause triangles, threshold n+2m Visual
3 N A E ≤ p M A X C U T \mathrm{3NAE}\le_p\mathrm{MAXCUT} 3NAE ≤ p MAXCUT (over multigraphs), so M A X C U T \mathrm{MAXCUT} MAXCUT is NP-hard.L10 Lesson Exercise Exam
a vertex N that burns a colour, a triangle per clause Visual
3 N A E ≤ p 3 C O L \mathrm{3NAE}\le_p\mathrm{3COL} 3NAE ≤ p 3COL , hence 3 C O L \mathrm{3COL} 3COL is NP-complete.L10 Lesson
one new vertex joined to everything Visual
3 C O L ≤ p 4 C O L \mathrm{3COL}\le_p\mathrm{4COL} 3COL ≤ p 4COL , hence 4 C O L \mathrm{4COL} 4COL is NP-complete. The same idea gives 3 C O L ≤ p k C O L \mathrm{3COL}\le_p k\mathrm{COL} 3COL ≤ p k COL for every constant k ≥ 3 k\ge3 k ≥ 3 .L11 · L10 Lesson
a vertex per edge, same k Visual
V C ≤ p D S \mathrm{VC}\le_p\mathrm{DS} VC ≤ p DS , so D S \mathrm{DS} DS (dominating set) is NP-complete.L19 Lesson Exam
clause cliques, literal–negation edges, threshold m Visual
S A T ≤ p M a x I S \mathrm{SAT}\le_p\mathrm{MaxIS} SAT ≤ p MaxIS , so M a x I S \mathrm{MaxIS} MaxIS is NP-hard. Here M a x I S \mathrm{MaxIS} MaxIS is the language of pairs ⟨ G , k ⟩ \langle G,k\rangle ⟨ G , k ⟩ for which the maximum independent set has size exactly k k k .L22 Lesson Exam
plant k−1 vertices joined to every old one Visual
I S ‾ ≤ p M a x I S \overline{\mathrm{IS}}\le_p\mathrm{MaxIS} IS ≤ p MaxIS , so M a x I S \mathrm{MaxIS} MaxIS is coNP-hard.L22 Lesson
inflate each edge to size 3 Visual
V C ≤ p 3 H - V C \mathrm{VC}\le_p\mathrm{3H\text{-}VC} VC ≤ p 3H - VC , so vertex cover on 3-uniform hypergraphs is NP-hard. A 3-uniform hypergraph is a pair H = ( V , E ) H=(V,E) H = ( V , E ) in which every hyperedge is a 3 3 3 -element subset of V V V .L25 Lesson Exercise
subdivide each edge into a path of length 3 Visual
M a x - C u t - M u l t i ≤ p M a x - C u t \mathrm{Max\text{-}Cut\text{-}Multi}\le_p\mathrm{Max\text{-}Cut} Max - Cut - Multi ≤ p Max - Cut — the hardness of max cut does not come from parallel edges; it survives on simple graphs.Exam
a leaf on every vertex Visual
Call a graph modest if its maximum degree is at most 1 1 1 . The problem "can at most k k k vertices be removed so the remainder is modest" is NP-complete, via V C ≤ p M O D E S T \mathrm{VC}\le_p\mathrm{MODEST} VC ≤ p MODEST . Exam
one digit column per edge, no carrying Visual
V C ≤ p S U B S E T - S U M \mathrm{VC}\le_p\mathrm{SUBSET\text{-}SUM} VC ≤ p SUBSET - SUM , hence S U B S E T - S U M \mathrm{SUBSET\text{-}SUM} SUBSET - SUM is NP-complete.L11 Lesson Exercise
variable columns and clause columns, with slack digits Visual
3 S A T ≤ p S U B S E T - S U M \mathrm{3SAT}\le_p\mathrm{SUBSET\text{-}SUM} 3SAT ≤ p SUBSET - SUM — the classical form of the reduction, encoding the choice of assignment and the satisfaction of clauses in carry-free digit columns.Exam
a single padding element, |2S−T| Visual
S U B S E T - S U M ≤ p P A R T I T I O N \mathrm{SUBSET\text{-}SUM}\le_p\mathrm{PARTITION} SUBSET - SUM ≤ p PARTITION , so P A R T I T I O N \mathrm{PARTITION} PARTITION is NP-hard.L12 Lesson Exercise Exam
normalize by half the total, capacity 1, two bins Visual
P A R T I T I O N ≤ p B I N - P A C K I N G \mathrm{PARTITION}\le_p\mathrm{BIN\text{-}PACKING} PARTITION ≤ p BIN - PACKING , so B I N - P A C K I N G \mathrm{BIN\text{-}PACKING} BIN - PACKING is NP-hard — and stays hard even when the number of bins is the constant k = 2 k=2 k = 2 .L12 Lesson Exercise Exam
a triple v_in, v_mid, v_out per vertex Visual
D H C ≤ p U H C DHC\le_p UHC D H C ≤ p U H C — a Hamiltonian cycle in a directed graph reduces to one in an undirected graph, by encoding the orientation inside the graph's structure.Exam
a cycle of four reductions instead of twelve Visual
Between any two of the four problems D H P DHP D H P , D H C DHC D H C , U H P UHP U H P , U H C UHC U H C there is a polynomial-time reduction; they are polynomially equivalent , and hence all NP-hard. L12 · L12 Lesson Exam
complete the graph, weights 1 and 2, budget |V| Visual
U H C ≤ p T S P UHC\le_p TSP U H C ≤ p T S P , so T S P TSP T S P is NP-hard (and with membership in NP, NP-complete).L12 Lesson Exercise Exam
a huge weight α|V|+1 on missing edges Gap Visual
For every α ≥ 1 \alpha\ge1 α ≥ 1 : if the optimization version of general T S P TSP T S P admits an α \alpha α -approximation, then P = N P \mathrm{P}=\mathrm{NP} P = NP . In fact this is an equivalence: some approximation exists ⟺ P = N P \iff \mathrm{P}=\mathrm{NP} ⟺ P = NP . L13 Lesson Exercise
the gap between OPT = 2 and OPT = 3 Gap Visual
If a polynomial algorithm for bin packing achieves an absolute approximation ratio below 3 2 \tfrac32 2 3 — in particular ratio 1.49 1.49 1.49 — then P = N P \mathrm{P}=\mathrm{NP} P = NP . L25 · L12 Lesson Exercise