A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Vertex Cover and Set Cover Problems

College Depth 95 in the knowledge graph ☐ I know this ☆ Set as goal
2topics build on this
600prerequisites beneath it
See this on the map →
3-SAT and NP-Completeness via CNFNP-Completeness+2 more→→Fixed-Parameter Tractability (FPT)
graph-problems np-complete optimization

Core Idea

The vertex cover problem asks whether a graph has a set of k vertices such that every edge touches at least one vertex in the set. This classic NP-complete problem serves as a foundation for parameterized complexity. It demonstrates how many combinatorial optimization problems can be shown NP-hard through polynomial reductions from 3-SAT.

How It's Best Learned

Begin with small graphs and try to find vertex covers by hand. Then reduce 3-SAT to vertex cover: each clause becomes a triangle and variables are connected via gadgets.

Common Misconceptions

Explainer

A vertex cover of a graph is a set S of vertices such that every edge has at least one endpoint in S. Think of it as a guard-placement problem: you want to station guards at vertices so that every corridor (edge) is watched by at least one guard. The decision version asks: does graph G have a vertex cover of size at most k? From your work on NP-completeness and 3-SAT, you understand the framework — this problem is NP-complete, meaning it is in NP and every NP problem reduces to it in polynomial time.

The NP-hardness proof proceeds by reduction from 3-SAT. Given a 3-SAT formula with n variables and m clauses, you construct a graph as follows. Each variable x contributes two vertices (one for x, one for ¬x) connected by an edge — every vertex cover must include at least one of them, encoding a truth assignment. Each clause (a ∨ b ∨ c) contributes a triangle of three vertices, with edges connecting each triangle vertex to its corresponding literal vertex in the variable gadgets. A vertex cover of size n + 2m exists if and only if the formula is satisfiable: the n variable choices fix a truth assignment, and for each clause, the 2 remaining triangle vertices (not corresponding to a satisfied literal) round out the cover. Checking this bijection carefully is the reduction.

What makes vertex cover especially instructive is its starring role in parameterized complexity — analyzing how difficulty depends on a parameter k separate from input size n. Although vertex cover is NP-hard in general (k may grow with n), for small fixed k it admits algorithms far better than brute force. A simple search tree works: pick any edge, branch on whether to include its left or right endpoint in the cover, recurse on the remaining graph with k decremented. This gives an O(2k · n) algorithm — exponential in k but linear in n. More powerful kernelization algorithms reduce any instance to one with at most 2k² vertices in polynomial time: if a vertex has degree > k, it must be in the cover; include it and decrement k. If more than k² edges remain after removing high-degree vertices, the answer is "no." The resulting O(k²)-vertex kernel can then be solved by brute force in time depending only on k.

The Set Cover problem generalizes vertex cover: given a universe U and sets S₁, ..., Sₘ, find the minimum number of sets covering all of U. Vertex cover is the special case where U is the edge set and each set consists of edges incident to one vertex. Set cover inherits NP-hardness and also admits a classical greedy approximation — always pick the set covering the most uncovered elements — achieving a ratio of ln|U| + 1. This is tight: under ETH, you cannot approximate set cover within (1 − ε) ln|U| for any ε > 0 unless P = NP, demonstrating that the connection between NP-completeness proofs and approximation hardness runs deep. Vertex cover and set cover together are foundational examples connecting reduction-based hardness, parameterized tractability, and approximation algorithms.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Introduction to Propositional Logic → Introduction to Predicate Logic (First-Order Logic) → First-Order Logic Syntax → ZFC Axioms Overview → Axiom Schema of Separation → Axiom Schema of Replacement → Von Neumann Ordinals → Hereditarily Finite Sets → Recursive Definitions on Finite Sets → Well-Founded Relations and Transfinite Recursion → The Axiom of Choice and Equivalent Formulations → Axiom of Choice → Well-Ordering Theorem → Infinite Cardinal Numbers → Cantor's Theorem → Uncountability and the Diagonal Argument → The Cantor Set: An Uncountable Nowhere Dense Example → Uncountable Sets and Cantor Diagonalization → The Halting Problem → Computability Reductions → Polynomial-Time Reductions → Lower Bounds Techniques in Computational Complexity → NP-Completeness → The Cook-Levin Theorem → 3-SAT and NP-Completeness via CNF → Clique Problem and Its Variants → Vertex Cover and Set Cover Problems

Longest path: 96 steps · 600 total prerequisite topics

Prerequisites (4)

Leads To (1)