HALL`S MATCHING THEOREM Definition 1. A graph G = (V,E

HALL’S MATCHING THEOREM
Definition 1. A graph G = (V, E) consists of a set V of vertices and a set E of edges. Each
edge e ∈ E consists of two linked vertices x and y, and is denoted by e = xy. The order of
the vertices does not matter in this notation; so the edge e can also be written as e = yx.
The vertices x and y are called the ends of e, and e is said to be incident to x and y.
For example, our card trick can be represented by a graph T whose vertices are the
combinations in 8 C3 together with the permutations in 8 P2 . The combination {1, 2, 4} would
be linked to permutation (4, 2) by an edge {1, 2, 4}(4, 2), because (4, 2) can be formed from
some of the elements of {1, 2, 4}. More generally, the set of edges E consists of the linked
pairs of vertices of the form {c1 , c2 , c3 }(p1 , p2 ), where
{p1 , p2 } ⊆ {c1 , c2 , c3 } ⊆ {1, 2, . . . , 8}.
Definition 2. A graph G = (V, E) is said to be bipartite if the vertex set V can be divided
into two parts C and P so that no two vertices of C are linked (by an edge in E) and no
two vertices of P are linked. In this case G is said to be a C, P -bigraph.
Notice that T is a 8 C3 , 8 P2 ,-bigraph.
Definition 3. A matching in a graph G = (V, E) is a set M ⊆ E of edges such that no
two edges in M are incident to the same vertex. A vertex is said to be M -matched if it is
the end of an edge in M ; otherwise it is M -unmatched. A set of vertices X ⊆ V is said to
be M -matched if every x ∈ X is M -matched. Let V (M ) be the set of M matched vertices.
A maximal matching of G is a matching that cannot be enlarged by adding an edge. A
maximum matching is a matching that has at least as many edges as any other matching.
For example, the goal for the card trick was to create a matching M (pairs of vertices
fastened with a paperclip) in T so that 8 C3 was M -matched. To accomplish this goal you
first used the greedy or First-Fit algorithm to construct a maximal matching. Then you
applied a different strategy to enlarge your matching to a maximum matching.
Definition 4. Let G = (V, E) be a graph. A path Q = v1 v2 . . . vn in G is a sequence of
vertices of G such that each pair vi vi+1 is an edge of G. We write V (Q) = {v1 , . . . vn } for
the vertices of Q and E(Q) = {v1 v2 , v2 v3 , . . . vn−1 vn } for the edges of Q. Now let M be
a matching in G. An M -alternating path is a path P such that each vertex v ∈ V (P ) is
incident to at most one edge in E(P ) r M . Such a path is M -augmenting if its ends v1 and
vn are M -unmatched.
When you constructed your matching for the card trick, you improved your current maximal matching M by first building an M -alternating path starting form an unmatched vertex
(combination) of 8 C3 , until you reached an unmatched vertex (permutation) in 8 P2 . This
resulted in an M -augmenting path Q. Then you added the edges of E(Q) r M and deleted
the edges E(Q) ∩ M . This resulted in a new matching with one more edge than M .
Lemma 5. If G is a graph with a matching M , and G has an M -augmenting path, then M
is not maximum.
1
Proof. If P is an M -augmenting path in G then
(M r (E(Q) ∩ M )) ∪ (E(Q) r M )
is a larger matching than M .
The following theorem, and its proof, show exactly when the procedure above will work.
The corollary to the theorem shows for which card tricks the theorem works. We need a
little more notation for a graph G = (V, E) and a matching M . For a vertex v ∈ V we write
N (v) = {x ∈ V : vx ∈ E} and NM (x) = {x ∈ V : vx ∈ M }.
Theorem 6 (Hall’s Theorem [1935]). A C, P -bigraph G = (V, E) has a matching M such
that P is M -matched if and only if
[
(0.1)
|X| ≤ |
N (v)| for all X ⊆ C.
v∈X
Proof. First suppose that M is a matching of G such that P is M -matched. For any X ⊆ C,
X
X
[
[
|X| =
1=
|NM (v)| = |
NM (v)| ≤ |
N (v)|.
v∈X
v∈X
v∈X
v∈X
So (0.1) holds.
Now suppose that no matching matches every vertex of C, and let M be a maximum
matching (all that we will use about M is that
S it has no M -augmenting path). We shall
construct a subset X ⊆ C such that |X| > | v∈X N (v)|. Let u be an M -unmatched vertex
in C. Let A ⊆ V (G) be the set of vertices v such that there exists an alternating path
v0 v1 . . . vn with u = v0 and v = vn . Set X = A ∩ C and Y = A ∩ P . Then u ∈ X (witnessed
by the trivial path). Let v1 . . . vn be an alternating path. For each index i, if i is even then
vi ∈ X, and if i is odd then vi ∈ Y ; moreover vi−1 vi ∈ M if and only if i is even. (The last
sentence uses that G isSa C, P -bigraph.
S
We first show that v∈X N (v) ⊆ Y : Suppose z ∈ v∈X N (v); say wz ∈ E(G) for some
w ∈ X. Then w is the end of an M -alternating path Q = y0 . . . yn with y0 = u, w = yn ,
and yn−1 yn ∈ M . Either
z ∈ V (Q) or Qwz is an alternating path. In either case, z ∈ Y . So
S
N (X) ⊆ Y . Thus | v∈X N (v)| ≤ |Y |.
To finish, it suffices to show that |Y | < |X|. Every vertex yn ∈ Y is the end of an
M -alternating path Q = uy1 . . . yn , where n is odd. Since M is maximum, Q is not an
M -augmenting path. Thus yn is M -matched; say yn x ∈ M . So x ∈ C r {u} and Qyx =
uy1 . . . yn−1 yx is an M -alternating path. Thus x ∈ X r {u}. So
[
[
X
|Y | ≤ |
NM (v)| = |
NM (v)| ≤
1 ≤ |X| − 1 < |X|.
v∈X
v∈Xr{u}
v∈Xr{u}
If G = (V, E) is a graph and X, Y ⊆ V then the set of edges of G with one end in X and
one end in Y is denoted by
E(X, Y ) = {xy ∈ E : x ∈ X ∧ y ∈ Y }.
Corollary 7. Suppose G = (V, E) is a C, P -bigraph that satisfies |N (x)| ≥ |N (y)| for all
vertices x ∈ C and y ∈ P . Then G has a matching M such that C is M -matched.
2
Proof. Suppose the hypothesis holds. Then there exists an integer n such that |N (x)| ≥ n ≥
|N (y)| for all vertices x ∈ C and y ∈ P . Using Hall’s Theorem, it suffices to check (0.1).
Consider any subset X ⊆ C. Then
[
[
n|X| ≤ |E(X, P )| = |E(X,
N (v)| ≤ n|
N (v)|.
v∈X
Dividing by n we have |X| ≤ |
S
v∈X
N (v)|. So (0.1) holds.
3
v∈X