Discrete Mathematics and Combinatorics

Hall's Marriage Theorem Explained

Learn the condition that decides when everyone on one side can be matched, follow its proof, and apply it to puzzles.

Key takeaways

  • Hall's condition says every group of members on one side has at least as many combined neighbors as it has members.
  • The condition is both necessary and sufficient for matching one whole side of a finite bipartite graph.
  • To show a matching is impossible, it is enough to exhibit one overcrowded group.
  • Every regular bipartite graph of positive degree satisfies the condition and so has a perfect matching.
  • The theorem needs care for infinite collections, where the finite condition can hold without any matching.

Hall's marriage theorem answers a simple question: when can every member of one group be given a different partner from an acceptable list? The answer is that it is possible exactly when every collection of k members, taken together, has at least k acceptable partners between them, for every k.

It is obvious that this is needed. Three applicants who between them are suited to only two jobs cannot all be hired into different jobs. The surprise is that this kind of shortage is the only thing that can ever go wrong.

The precise statement

Model the situation as a bipartite graph: vertices split into two sides X and Y, with edges only between the sides. For a set S of vertices in X, write N(S) for its neighborhood, the set of all vertices in Y joined to at least one member of S. Write |S| for the number of elements in S.

A matching that saturates X gives each vertex of X its own partner in Y, with no partner shared.

Hall's theorem (finite case):
There is a matching saturating X
    if and only if
|N(S)| ≥ |S| for every subset S of X.

Philip Hall published the result in 1935, in the language of choosing distinct representatives from a list of sets. The "marriage" wording came from a traditional framing in terms of pairing people, but jobs, rooms or time slots serve equally well.

An example that fails

Four volunteers sign up for shifts:

Volunteer Acceptable shifts
Ana 1, 2
Ben 1
Cal 2
Dee 1, 2, 3, 4

Everyone has at least one choice and there are four shifts. Still, look at S = {Ana, Ben, Cal}. Their combined choices are just {1, 2}. Three people need three shifts and only two are on offer, so no complete assignment exists.

Dee's long list does not help, because Dee's flexibility adds nothing to what those three can do. If Cal also accepted shift 3, you would find Ben on 1, Ana on 2, Cal on 3 and Dee on 4.

Checking the condition directly means testing every nonempty subset: 15 of them for four volunteers, and 2ⁿ − 1 for n. That is hopeless for large n. In practice you search for a matching using augmenting paths, as described in bipartite graphs and matching. When the search gets stuck, it hands you an overcrowded set S as proof.

Why the condition is enough

The proof uses strong induction on the number of vertices in X. With one vertex, the condition says it has a neighbor, so match it. For larger X, assume Hall's condition holds and split into two cases.

Case 1: there is always slack. Suppose every nonempty subset S smaller than X has |N(S)| ≥ |S| + 1. Match any vertex x to any neighbor y and delete both. Each remaining subset loses at most one neighbor, namely y, so it still has at least as many neighbors as members. By induction the rest can be matched.

Case 2: some group is exactly tight. Suppose a nonempty subset S smaller than X has |N(S)| = |S|. By induction, S can be matched into N(S), using all of N(S). Now consider the other vertices of X, with N(S) removed from Y. Take any set T of them. Then:

new neighbors of T  =  |N(S ∪ T)| − |N(S)|
                    ≥  |S ∪ T| − |S|          (Hall for S ∪ T, and S tight)
                    =  |T|                    (S and T are disjoint)

So Hall's condition survives, and induction matches the rest. Combining the two partial matchings finishes the proof.

Structure of the induction proof
1 Assume Hall Every group has enough combined neighbors 2 Slack case Match any one pair, remove it, and recurse 3 Tight case Match the tight group first into its own neighbors 4 Remainder The others still satisfy the condition, so recurse Assume Hall Every group has enough combined neighbors 1 Slack case Match any one pair, remove it, and recurse 2 Tight case Match the tight group first into its own neighbors 3 Remainder The others still satisfy the condition, so recurse 4

Distinct representatives

Hall's original setting involved sets. Suppose several committees must each send one of their own members to a council, and no person may represent two committees. Such a choice is called a system of distinct representatives.

committee P = {Kim, Lee}
committee Q = {Lee, Mo}
committee R = {Kim, Mo}
committee T = {Mo, Nia, Oz}

The condition says that any k committees must together contain at least k different people. The first three contain exactly Kim, Lee and Mo, a tight group. They can be served, for example by Kim for P, Lee for Q and Mo for R. Committee T must then look elsewhere, and Nia or Oz will do.

Notice how the tight case of the proof appears here. Once a set of three committees needs exactly those three people, you know that none of them can be spared for anyone else. You settle that block first and remove its members from every other list.

If committee T had consisted of only Kim and Lee, the four committees together would contain just three people, and no choice could work.

A sufficient shortcut: count the degrees

Checking every subset is rarely needed. A common shortcut compares degrees. Suppose there is a number d ≥ 1 such that every vertex in X has at least d neighbors, while every vertex in Y has at most d neighbors.

Then for any S in X, at least d·|S| edges leave S. They all land in N(S), which can receive at most d·|N(S)| edges. Dividing by d gives |N(S)| ≥ |S|, so a matching saturating X exists.

For example, say each of 20 students lists at least 3 project topics, and no topic appears on more than 3 lists. Every student can get a different listed topic, whatever the exact lists are. This is counting the same thing two ways doing the work of a million subset checks.

The shortcut is only sufficient. Many graphs that fail it still satisfy Hall's condition.

Regular graphs and a card puzzle

A bipartite graph is k-regular if every vertex has exactly k edges. Take k ≥ 1 and any set S on one side. There are k·|S| edges leaving S, and all of them arrive in N(S), which can absorb at most k·|N(S)| edges. So |S| ≤ |N(S)|, and Hall's condition holds automatically. The two sides also have equal size, so the matching is perfect.

Here is a pleasing consequence. Deal a shuffled deck of 52 cards into 13 piles of 4. You can always pick one card from each pile so that you end up with exactly one of each rank, ace through king.

Make a graph with piles on one side and ranks on the other, adding an edge for every card, from its pile to its rank. Repeated edges are fine for the counting. Each pile has 4 edges and each rank has 4 edges, so the graph is 4-regular and a perfect matching exists.

The same idea shows that a partly filled Latin rectangle, with r complete rows of n symbols and no symbol repeated in any row or column, can always be extended by another row when r < n. See Latin squares and Sudoku.

How far from complete?

When the condition fails, the theorem still measures the damage. The deficiency of a set S is |S| − |N(S)|. The size of a maximum matching equals |X| minus the largest deficiency over all subsets, counting the empty set, whose deficiency is 0.

In the volunteer table, {Ana, Ben, Cal} has deficiency 1, and no set is worse. So at most 4 − 1 = 3 shifts can be filled, and 3 can in fact be achieved: Ben on 1, Ana on 2 and Dee on 3.

Relatives of the theorem

Hall's theorem belongs to a family of results where a maximum equals a minimum.

  • Kőnig's theorem says that in a bipartite graph the largest matching equals the smallest set of vertices touching all edges.
  • Max-flow min-cut extends the idea to capacities, as in network flows.
  • Menger's theorem relates the number of independent routes between two points to the number of points needed to separate them.
  • The Birkhoff–von Neumann theorem says that a square table of nonnegative numbers whose rows and columns each sum to 1 is a weighted average of permutation matrices, tables with a single 1 in each row and column. Hall's theorem supplies the key step.

The infinite trap

Let X contain people x₀, x₁, x₂ and so on, and let Y be the positive integers. Person x₀ will accept any positive integer. For each i ≥ 1, person xᵢ accepts only the number i.

Every finite group satisfies Hall's condition. Yet no complete matching exists: each xᵢ takes i, leaving nothing for x₀. The theorem does extend to infinitely many people when each of them has only finitely many acceptable partners. This version is usually credited to Marshall Hall Jr., a different mathematician from Philip Hall.

Using it well

  1. Identify the two sides and decide which one must be fully matched.
  2. To prove a matching exists, argue about an arbitrary set S, often by counting edges from S into N(S).
  3. To disprove it, find one specific overcrowded set.
  4. Remember that the condition applies to all subsets. Checking single members and the whole group is not enough, as the volunteers showed.

Hall's theorem gives no ranking of partners. If people have preferences, you need the ideas behind stable matching.

Written for 4Mathematics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 45 articles in Discrete Mathematics and Combinatorics →

Latest news on this topic