Lecture from: 04.03.2025 | Video: Homelab

Recap: Hall’s Marriage Theorem

In the previous lecture, we introduced Hall’s Marriage Theorem, a fundamental result in bipartite matching theory. Let’s briefly recap its statement and significance.

Hall’s Marriage Theorem: For a bipartite graph , there exists a matching that saturates (i.e., ) if and only if Hall’s condition holds:

Hall’s Condition: For every subset , the size of its neighborhood is at least as large as the size of :

This theorem provides a necessary and sufficient condition for the existence of a complete matching from set to set . It’s a powerful tool for determining whether a perfect matching is possible in a bipartite graph, especially when dealing with constraints on vertex neighborhoods.

For the proof of Hall’s Theorem, look at the video at the end of the previous lecture note…

Frobenius Theorem

A direct consequence of Hall’s Marriage Theorem is a result known as Frobenius’ Theorem, particularly relevant for regular bipartite graphs.

Corollary (Frobenius): For any positive integer , every -regular bipartite graph contains a perfect matching.

Explanation: A -regular bipartite graph is one where every vertex in both partitions and has a degree of exactly . In such a graph, must hold because the sum of degrees in must equal the sum of degrees in (Handshaking Lemma for bipartite graphs: ).

To see why Frobenius’ Theorem follows from Hall’s Theorem, consider a -regular bipartite graph . For any subset , let be the set of edges between and . By regularity, the number of edges leaving is . These edges must all land in . The sum of degrees of vertices in is at most . Since all edges from must go to :

Dividing by (since ), we get . This holds for all , so Hall’s condition is satisfied. By Hall’s Marriage Theorem, there exists a matching that saturates . Since , a matching saturating in a balanced bipartite graph is a perfect matching.

Important Note: The bipartiteness condition is crucial for both Hall’s Marriage Theorem and Frobenius’ Theorem. Regular graphs in general (non-bipartite) do not necessarily have perfect matchings.

Algorithms for Finding Maximum Matchings in Bipartite Graphs

While Hall’s theorem gives a condition for the existence of a matching, we now turn our attention to algorithms that can actually find maximum matchings, especially in bipartite graphs.

There are different kinds of matching algorithms:

Augmenting Paths: Revisited

As discussed previously, the concept of augmenting paths is central to finding maximum matchings.

Definition of -Augmenting Path: Given a matching , an -augmenting path is a path that:

  1. Alternates between edges not in and edges in .
  2. Starts and ends at vertices that are unmatched by .

Key Algorithm Idea

  1. Start with an initial matching (possibly empty).
  2. Repeatedly search for an augmenting path.
  3. If an augmenting path is found, augment the matching along this path, increasing the matching size by one.
  4. Continue until no more augmenting paths can be found. At this point, the matching is guaranteed to be maximum (by Berge’s Theorem).

Breadth-First Search (BFS) for Finding Augmenting Paths in Bipartite Graphs

In bipartite graphs, we can efficiently use Breadth-First Search (BFS) to find augmenting paths. Let be a bipartite graph and be a current matching.

BFS Algorithm for Alternating Paths

  1. Initialization:

    • : Set of all unmatched vertices in . These are the starting points for our search.
    • Mark all vertices in as visited.
    • Initialize level .
  2. Iterative Level Expansion: Repeat the following steps until no new vertices can be added to the current level:

    • If is odd (edges from to are not in ):

      • : Collect all unvisited neighbors of vertices in that are reached via edges not in the matching (i.e., edges in ).
    • Else if is even (edges from to are in ):

      • : Collect all unvisited neighbors of vertices in that are reached via edges in the matching .
    • Mark all vertices in as visited.

    • Increment .

  3. Augmenting Path Detection: During the BFS, if we reach an unmatched vertex in some level , we have found an augmenting path. We can reconstruct the path by backtracking from to a vertex in using the predecessor information maintained during BFS. Return the found augmenting path.

  4. No Augmenting Path: If the BFS completes and no unmatched vertex in is reached, then there are no augmenting paths starting from the current set of unmatched vertices in . In this case, the current matching is a maximum matching. Return that no augmenting path is found.

Level Interpretation: In this BFS, represents the set of vertices reachable from the initial unmatched vertices in via an alternating path of length . Specifically, is the set of vertices such that the shortest alternating path from an unmatched vertex in to has length .

In a bipartite graph, each BFS to find an augmenting path takes time, as we explore vertices and edges in a breadth-first manner.

Hopcroft-Karp Algorithm: Efficient Maximum Matching in Bipartite Graphs

The Hopcroft-Karp algorithm is a more advanced and efficient algorithm for finding maximum matchings in bipartite graphs. It improves upon the basic augmenting path algorithm by finding a maximal set of shortest augmenting paths in each iteration, rather than just a single augmenting path.

We’ll discuss this algorithm in depth next time…