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

Graph Matching and Hall's Marriage Theorem

College Depth 81 in the knowledge graph ☐ I know this ☆ Set as goal
15topics build on this
396prerequisites beneath it
See this on the map →
Bipartite Graphs and 2-Colorability→→Network Flows: Maximum Flow and Minimum Cut
graph-theory matching halls-theorem

Core Idea

A matching is a set of edges with no common vertices. A perfect matching covers all vertices. Hall's Marriage Theorem: a bipartite graph G = (X ∪ Y, E) has a matching covering all vertices in X if and only if for every subset S ⊆ X, |N(S)| ≥ |S|, where N(S) is the neighborhood of S.

Explainer

From your study of bipartite graphs, you know that a bipartite graph separates its vertices into two independent sets X and Y, with edges only running between the sets — never within them. Imagine X represents a set of job applicants and Y represents job openings, with an edge meaning "this applicant is qualified for this job." A matching is an assignment of applicants to jobs where no two applicants share a job and no applicant holds multiple jobs — formally, a set of edges with no repeated vertices. A perfect matching from X to Y assigns every applicant in X to a distinct job.

The obvious question is: when does such an assignment exist? Hall's Marriage Theorem gives a clean, complete answer. The condition is intuitively natural: for every group S of applicants, there must be at least |S| distinct jobs they are collectively qualified for. If five applicants are all only qualified for the same two jobs, no assignment can work — three will be left out. Formally, for every subset S ⊆ X, the neighborhood N(S) (all vertices in Y adjacent to at least one vertex in S) must satisfy |N(S)| ≥ |S|. This is called Hall's condition.

What makes the theorem remarkable is that it is both necessary *and* sufficient. It's obvious that Hall's condition is necessary (if some S violates it, you can't match those vertices). The deep part is sufficiency: if Hall's condition holds for *every* possible subset S, then a perfect matching is guaranteed to exist. You don't need to construct the matching explicitly to know it exists — the condition alone certifies it. The proof proceeds by strong induction on |X|, considering whether the graph is "tight" (some S achieves |N(S)| = |S|) or "loose" everywhere.

Hall's theorem is a template for a broader class of existence results. Whenever you want to show that a combinatorial assignment exists without constructing it explicitly, you look for a condition analogous to Hall's that eliminates the obvious obstructions and then proves no others can occur. This same logic underlies network flow algorithms and Latin square completions. In practice, if you can verify Hall's condition algorithmically, you can also *find* a maximum matching using augmenting path algorithms — the theorem tells you what to look for, and the algorithm finds it.

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 → Set Operations: Union, Intersection, and Complement → Proof by Cases → Proving by Cases and Exhaustion → Vacuous Truth and Trivial Cases → Proof by Cases (Proof by Exhaustion) → Mathematical Induction → Graph Paths, Cycles, and Connectivity → Trees and Spanning Trees → Planar Graphs and Euler's Formula → Graph Coloring and the Chromatic Number → Graph Coloring and Chromatic Numbers → Bipartite Graphs and Matching Problems → Bipartite Graphs and 2-Colorability → Graph Matching and Hall's Marriage Theorem

Longest path: 82 steps · 396 total prerequisite topics

Prerequisites (1)

Leads To (1)