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

Matchings in Bipartite Graphs

Graduate Depth 76 in the knowledge graph ☐ I know this ☆ Set as goal
3topics build on this
387prerequisites beneath it
See this on the map →
Bipartite Graphs and Matchings→→Hall's Marriage Theorem
graph-theory matching bipartite

Core Idea

A matching is a set of edges with no shared vertices; in bipartite graphs, matchings model assignments between two sets. A maximum matching uses the most edges; a perfect matching covers all vertices. Bipartite matching is fundamental to applications like job assignment, resource allocation, and network optimization.

Explainer

Your prerequisite on bipartite graphs established that a bipartite graph has two disjoint vertex sets L and R, with all edges running between L and R (never within a side). Think of L as a set of workers and R as a set of jobs, with an edge meaning "this worker is qualified for this job." The question of interest is: how many workers can we assign to jobs simultaneously, with each worker doing at most one job and each job going to at most one worker? This is the matching problem.

A matching is a subset of edges in which no vertex appears more than once — each worker is assigned at most one job, and each job is filled by at most one worker. A maximum matching is the largest such set. A perfect matching goes further: every vertex on both sides is matched, so the assignment is total with no unmatched workers or jobs. Perfect matchings are only possible when |L| = |R| and the structure of the graph permits it. The upcoming topic Hall's Marriage Theorem gives the exact condition: a perfect matching from L into R exists if and only if for every subset S ⊆ L, the neighborhood of S (jobs reachable from S) has |N(S)| ≥ |S|. Intuitively, no group of workers can "crowd" a smaller pool of jobs.

The standard algorithm for finding a maximum matching uses augmenting paths. An augmenting path starts at an unmatched vertex in L, alternates between unmatched and matched edges, and ends at an unmatched vertex in R. Following such a path and flipping which edges are in the matching (matched edges become unmatched, unmatched become matched) increases the matching size by one. This process repeats until no augmenting path exists, at which point the matching is maximum. The algorithm runs in O(V·E) time.

The breadth of applications is remarkable. Bipartite matching models medical residency assignments, school scheduling (teachers to classrooms), network flow routing, and even database query optimization. Extending from matchings to weighted matchings — where each assignment has a cost and you want minimum or maximum total cost — leads to the Hungarian algorithm and the theory of optimal transport. The bipartite case is the cleanest entry point to a rich family of combinatorial optimization problems that appear throughout operations research and theoretical computer science.

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 → Bipartite Graphs and Matchings → Matchings in Bipartite Graphs

Longest path: 77 steps · 387 total prerequisite topics

Prerequisites (1)

Leads To (1)