Bipartite Graphs
and Matchings
Learn how graphs split into two independent sets, discover matchings that pair vertices optimally, and explore Hall's Marriage Theorem.
What Is a Graph?
A graph \( G = (V, E) \) consists of a set of vertices \( V \) and a set of edges \( E \). Each edge connects two vertices. Graphs model relationships: friendships, network connections, job assignments, and more.
What Makes a Graph Bipartite?
A graph \( G = (V, E) \) is bipartite if we can partition \( V \) into two disjoint sets \( L \) and \( R \) such that every edge connects a vertex in \( L \) to a vertex in \( R \). No edge runs within the same set.
Why Bipartite Graphs Matter
Bipartite graphs appear everywhere when two distinct categories need to be matched or connected.
The Two-Color Test
A graph is bipartite if and only if it contains no odd-length cycle. Equivalently, you can 2-color its vertices so that no edge has both endpoints the same color.
What Is a Matching?
A matching \( M \subseteq E \) is a set of edges with no shared endpoints. Each vertex is "used" by at most one edge in \( M \).
Maximum vs Perfect Matching
Hall's Marriage Theorem
The most important result about bipartite matchings. It gives a necessary and sufficient condition for a perfect matching (from \( L \) into \( R \)).
In plain language: every group of vertices on the left has enough distinct neighbors on the right to be matched. This condition is called Hall's condition.
Visualizing Hall's Condition
Matching vs Vertex Cover
| Matching | Vertex Cover | |
|---|---|---|
| What it is | A set of edges | A set of vertices |
| Constraint | No two edges share an endpoint | Every edge is "touched" by at least one vertex in the set |
| Goal | Maximize \( |M| \) | Minimize \( |C| \) |
| Relationship | By König's Theorem: max matching = min vertex cover in bipartite graphs | |
Finding a Maximum Matching
The augmenting path method finds a maximum matching step by step.
Augmenting Path Example
Example 1: Job Assignment
Three workers Alice, Bob, Carol can do certain jobs. Can every worker be assigned a distinct job?
Example 2: Hall's Condition Fails
Example 3: Larger Bipartite Graph
Common Mistakes
Summary of Key Concepts
| Concept | Definition | Key Fact |
|---|---|---|
| Bipartite Graph | \( V = L \cup R \), edges only between \( L \) and \( R \) | Exists iff no odd cycle |
| Matching | Edge set with no shared endpoints | Maximum found via augmenting paths |
| Perfect Matching | Matching that covers all vertices | Exists iff Hall's condition holds |
| Hall's Theorem | \( |N(S)| \geq |S| \) for all \( S \subseteq L \) | Necessary and sufficient |
| König's Theorem | Max matching \(=\) Min vertex cover | Only for bipartite graphs |
Question 1 of 5
A graph is bipartite if and only if it contains no cycle of what kind?
Question 2 of 5
In a bipartite graph with \(|L| = 4\) and \(|R| = 4\), what is the size of a perfect matching?
Question 3 of 5
Suppose \( L = \{x, y, z\} \) and the neighborhoods are \( N(x) = \{a, b\} \), \( N(y) = \{a\} \), \( N(z) = \{a, c\} \). Does a perfect matching from \( L \) exist?
Question 4 of 5
What does König's Theorem state about bipartite graphs?
Question 5 of 5
An augmenting path with respect to a matching \( M \) must: