0% found this document useful (0 votes)
45 views4 pages

Mathematical Foundations of Computer Science Lecture Outline

The document outlines key concepts in graph matchings and bipartite matchings: 1) It defines different types of matchings such as maximal matchings, maximum matchings, and perfect matchings. 2) It introduces alternating paths and augmenting paths which are used to prove properties of maximum matchings. 3) It states Hall's theorem, which provides necessary and sufficient conditions for the existence of a matching saturating all vertices in one part of a bipartite graph.

Uploaded by

Chenyang Fang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views4 pages

Mathematical Foundations of Computer Science Lecture Outline

The document outlines key concepts in graph matchings and bipartite matchings: 1) It defines different types of matchings such as maximal matchings, maximum matchings, and perfect matchings. 2) It introduces alternating paths and augmenting paths which are used to prove properties of maximum matchings. 3) It states Hall's theorem, which provides necessary and sufficient conditions for the existence of a matching saturating all vertices in one part of a bipartite graph.

Uploaded by

Chenyang Fang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Mathematical Foundations of Computer Science

Lecture Outline
November 6, 2018

Matchings
A matching in a graph is a set of edges with no shared end-points. The vertices incident
on the edges of a matching M are called M-saturated, the others are called M-unsaturated.
A perfect matching in a graph is a matching that saturates every vertex in the graph.

A maximal matching in a graph is a matching that is not contained in a larger matching.


A maximum matching is a matching of maximum size among all matchings in the graph.
Every maximum matching is a maximal matching, but the converse is not true. Figure 1
illustrates some of these definitions.

(a) (b)

Figure 1: (a) a graph G with the bold edges representing a maximal matching, (b) the bold
edges represent a maximum matching in G that is also perfect.

Given a matching, M , an M-alternating path is a path that alternates between edges in M


and edges not in M . An M -alternating path whose endpoints are M -unsaturated is called
an M-augmenting path. Given an M -augmenting path P , we can replace the edges of M in
P with the edges in E(P ) \ M to obtain a new matching with one more edge. Thus, when
M is a maximum matching there is no M -augmenting path.

For graphs G and H, the symmetric difference G⊕H is a subgraph of G∪H whose edges are
the edges of G ∪ H that appear in either G or H, but not both. We also use the notation for
set of edges; in particular, if M and M 0 are matchings then M ⊕ M 0 = (M \ M 0 ) ∪ (M 0 \ M ).
2 Lecture Outline November 6, 2018

Example. Prove that a matching M in G is maximum iff G contains no M -augmenting


path.

Solution. We will prove the necessary condition by proving its contrapositive, i.e., we will
prove that if G contains an M -augmenting path then M is not a maximum matching. Sup-
pose that G contains a M -augmenting path v0 v1 v2 . . . v2m+1 (Note that an M -augmenting
path must be of odd length). Define M 0 ⊆ E by

M 0 = M \ {(v1 , v2 ), (v3 , v4 ), . . . , (v2m−1 , v2m )} ∪ {(v0 , v1 ), (v2 , v3 ), . . . , (v2m , v2m+1 )}

Then M 0 is a matching in G and |M 0 | = |M | + 1. Thus M is not a maximum matching.

We will prove the converse by proving the contraposition. Assume that M is not a maximum
matching. Let M 0 be a maximum matching in G. Then |M 0 | > |M |. Set H = G[M ⊕ M 0 ].
Figure 2 illustrates this operation. Observe that every vertex in H has either degree one
or degree two in H, since it can be incident with at most one edge of M and one edge of
M 0 . Thus each component of H is either an even cycle with edges alternating in M and
M 0 or else a path with edges alternating in M and M 0 . Since |M 0 | > |M |, H contains more
edges of M 0 than of M , and H must contain a component which is a path, P , that starts
and ends with edges in M 0 . Since the start vertex and end vertex of P are M 0 -saturated
in H they must be M -unsaturated in G. Thus, P is an M -augmenting path in G. This
completes the proof.

(a) (b) (c)

Figure 2: (a) a graph G with a matching M represented by the bold edges, (b) the dashed
edges represent a matching M 0 in G, (c) G[M ⊕ M 0 ]

Matching in Bipartite Graphs


An independent set of a graph is a set of pair-wise non-adjacent vertices. A bipartite graph,
(U, V, E), is a graph whose vertex set is U ∪ V and for each edge e = (u, v) ∈ E, u ∈ U
and v ∈ V . In other words, U and V are independent sets and each edge in E connects a
November 6, 2018 Lecture Outline 3

vertex in U to a vertex in V .

Now consider the following scenario. There is a set of girls and a set of boys. Each
girl likes some boys and dislikes others. What conditions would guarantee that each girl
is paired-up with a boy that she likes and that no two girls are paired-up with the same boy.

We can model this situation using a bipartite graph, (X, Y, E), where each vertex in X
represents a girl, each vertex in Y represents a boy and and edge (g, b) ∈ E means that girl
g likes boy b. We are interested in the conditions that would guarantee a matching that
saturates every vertex in X.
Hall’s theorem gives the necessary and sufficient conditions for the existence of such match-
ings in bipartite graphs.

Example. [Hall’s Theorem] Let G = (X, Y, E) be a bipartite graph. For any set S of
vertices, let NG (S) be the set of vertices adjacent to vertices in S. Prove that G contains a
matching that saturates every vertex in X iff |NG (S)| ≥ |S|, ∀S ⊆ X. The condition “For
all S ⊆ X, |N (S)| ≥ |S|” is called Hall’s condition.

Solution. We prove that Hall’s condition is necessary as follows. Suppose G contains a


matching M that saturates every vertex in X. Let S be a subset of X. Since each vertex
in S is matched under M to a distinct vertex in NG (S), |NG (S)| ≥ |S|.

We will now prove the sufficiency of Hall’s conditon, i.e., if |NG (S)| ≥ |S|, ∀S ⊆ X then G
contains a matching that saturates every vertex in X. We prove this by induction on the
size of X.

Base Case: |X| = 1. If the only vertex in X is connected to at least one vertex in Y then
clearly a matching exists.
Induction Hypothesis: Assume that Hall’s condition is sufficient when |X| = j, for all j
such that 1 ≤ j ≤ k.
Induction Step: We want to prove that the sufficiency of Hall’s condition when |X| = k + 1.
Let G = (X, Y, E) be a graph with k + 1 vertices in X such that ∀S ⊆ X, |NG (S)| ≥ |S|.
We consider the following two cases.
Case I: For every non-empty proper subset W ⊂ X, |NG (W )| > |W |. In this case, we
pair-up an arbitrary vertex x ∈ X with one of its neighbors, say y ∈ Y . Now consider the
subgraph G0 = (X 0 , Y 0 , E 0 ), where X 0 = X \ {x}, Y 0 = Y \ {y}, and E 0 = E \ {(x, y)}).
After the removal of y, the neighborhood of any subset, S 0 ⊆ X 0 in G0 is at most one less
than its neighborhood in G. But since |NG (S 0 )| > |S 0 |, after removal of y, it must be that
|NG0 (S 0 )| ≥ |S 0 |. Thus, Hall’s condition holds for G0 . By induction hypothesis, G0 contains
a matching M 0 that saturates every vertex in X 0 . Hence, M 0 ∪ {(x, y)} is a matching that
saturates every vertex in X.
Case II: For some non-empty proper subset W ⊂ X, |N (W )| = |W |. For all S 0 ⊆ W ,
we have NG (S 0 ) ⊆ NG (W ). Hence, Hall’s condition holds for the subgraph induced by
4 Lecture Outline November 6, 2018

W ∪ N (W ). By induction hypothesis, there is a matching M1 that matches every vertex


in W to a vertex in NG (W ). Note that M1 is a perfect matching. Consider the subgraph
G0 = (X 0 , Y 0 , E 0 ), where X 0 = X \ W , Y 0 = Y \ N (W ), and E 0 consists of all edges
between X 0 and Y 0 . If we can prove that Hall’s condition holds for G0 then by induction
hypothesis, G0 has a matching M2 that saturates every vertex in X 0 . Then, M1 ∪ M2 is
clearly a matching in G that saturates every vertex in X. It now remains to prove that
∀T ⊆ X 0 , |NG0 (T )| ≥ |T |. Note that NG (W ∪ T ) = NG (W ) ∪ NG0 (T ), |NG (W )| = |W |, W
and T are disjoint, and NG (W ) and NG0 (T ) are disjoint. Then,

|NG (W ∪ T )| ≥ |W ∪ T | (follows because ∀S ⊆ X, |NG (S)| ≥ |S|)


|NG (W )| + |NG0 (T )| ≥ |W | + |T |
|W | + |NG0 (T )| ≥ |W | + |T |
|NG0 (T )| ≥ |T |

This proves the sufficiency of Hall’s condition.

You might also like