1 3.1 Matchings and Factors: Matchings and Covers

This copyrighted material is taken from Introduction to , 2nd Ed., by Doug West; and is not for further distribution beyond this course.

These slides will be stored in a limited-access location on an IIT server and are not for distribution or use beyond Math 454/553. 2 Matchings

3.1.1 Definition A in a graph G is a set of non-loop edges with no shared endpoints. The vertices incident to the edges of a matching M are saturated by M (M-saturated); the others are unsaturated (M-unsaturated). A in a graph is a matching that saturates every .

perfect matching

M-unsaturated

M-saturated

M Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 3 Perfect Matchings in Complete Bipartite Graphs

a 1 The perfect matchings in a complete b 2 X,Y-bigraph with |X|=|Y| exactly c 3 correspond to the bijections

d 4 f: X -> Y e 5 Therefore Kn,n has n! perfect f 6 matchings.

g 7

Kn,n

The Kn has a perfect matching iff…

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 4 Perfect Matchings in Complete Graphs

The complete graph Kn has a perfect matching iff n is even. So instead of Kn consider K2n.

We count the perfect matchings in K2n by: (1) Selecting a vertex v (e.g., with the highest label) one choice u v (2) Selecting a vertex u to match to v K2n-2 2n-1 choices

(3) Selecting a perfect matching on the rest of the vertices.

Define f(n) = # of perfect matchings on K2n. Then:

f(n) = (2n-1) * f(n-1) = (2n-1) * (2n-3) * f(n-2) = (2n-1) * (2n-3) * …* 3 * 1 = (2n)! / (2n n!).

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 5 Maximal versus Maximum Matchings

3.1.4 Definition A maximal matching in a graph is a matching that cannot be enlarged by adding an edge. A maximum matching is a matching of maximum size among all matchings in the graph.

All are maximal matchings

maximum matchings M

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 6 Alternating and Augmenting Paths

3.1.6 Definition 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 unsaturated by M is an M-augmenting path.

f i g j k a b h c a' b' b’’ d a’’ e M-alternating paths: a,b a’,b’ a’’,b’’ c,d,e f,g,h

M M-augmenting paths: f,g,h i,j,k

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 7 Augmenting Paths => Larger Matchings

Observation If a graph has a matching M and an M-augmenting path P, then it has a larger matching M’.

P = i,j,k i a' j k b'

M = {j} M’ = M - { e ∈ P : e ∈ M } + { e ∈ P : e ∉ M }

|M’| = |M| + 1

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 8 Symmetric Difference of Two Matchings

3.1.7 Definition. For graphs G and H, the symmetric difference GΔH is the subgraph of G U H with edge set E(G)ΔE(H). The symmetric difference of two matchings M and M’ is M Δ M’ = (M - M’) U (M’ - M)

M M’

G M Δ M’

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 9 Symmetric Difference of Two Matchings

3.1.9 Lemma. Every component of the symmetric difference of two matchings is a path or an even cycle.

G M Δ M’

The paths will be red-blue alternating but might look like: red – blue – … – red (odd path with both end-edges red) red – blue – … – blue (even length paths) blue – red – … – blue (odd path with both end-edges blue)

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. Hall’s Matching Condition for Bipartite Graphs 10

3.1.11 Theorem (Hall’s Theorem—P. Hall [1935]). An X,Y-bigraph G has a matching that saturates X if and only if |N(S)| ≥ |S| for all S ⊆ X.

[Proof in class.]

3.1.13 Corollary. For k > 0, every k-regular has a perfect matching.

[Proof in class.]

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 11 Vertex Covers

3.1.14 Definition A of a graph G is a set Q ⊆ V(G) that contains at least one endpoint of every edge. The vertices in Q cover E(G).

Non-minimum vertex covers

Q

Minimum vertex covers

Use of images authorized by Creative Commons license: see http://en.wikipedia.org/wiki/Vertex_cover

Minimal but not minimum vertex cover

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 12 Vertex Covers and Matchings

Observation Given a matching M of G, every vertex cover Q must include at least one endpoint of every edge of G.

Q minimum, M maximum Q minimal, M maximum

Q M

Q minimum, M maximum Q minimal, M maximal

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 13 Independent Sets, Matchings, Vertex Covers, Edge Covers

3.1.16 Theorem. (König [1931], Egerváry [1931]) If G is a bipartite graph, then the maximum size of a matching in G equals the minimum size of a vertex cover of G. [Proof in class]

3.1.19 Definition An of G is a set L of edges such that every vertex of G is incident to some edge of L.

3.1.20 Definition For the optimal sizes of the sets in the independence and we have defined, we used the notation below.

maximum size of independent set α(G) S maximum size of matching α’(G) M minimum size of vertex cover β(G) Q minimum size of edge cover β'(G) L

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 14 Parameter Relationships

3.1.21 Lemma. In a graph G, S ⊆ V(G) is an independent set if and only if V(G) – S is a vertex cover, and hence α(G) + β(G) = n(G). [Proof in class]

3.1.22 Theorem. (Gallai [1959]) If G is a graph without isolated vertices, then α’(G) + β'(G) = n(G).

3.1.24 Corollary. (König [1916]) If G is a bipartite graph with no isolated vertices, then α(G) = β'(G). Proof. (by 3.1.21) (by 3.1.22) α(G) + β(G) = n(G) = α’(G) + β'(G) – ( β(G) = α’(G) ) (by 3.1.16) α(G) = β'(G)

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 15 Illustration of Corollary 3.1.24

3.1.24 Corollary. (König [1916]) If G is a bipartite graph with no isolated vertices, then α(G) = β'(G).

Q

Start with a minimum vertex cover Q.

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 16 Illustration of Corollary 3.1.24

3.1.24 Corollary. (König [1916]) If G is a bipartite graph with no isolated vertices, then α(G) = β'(G).

Q

Q is a vertex cover, so it’s complement S is an independent set. Goal: Find one edge from every yellow vertex which together make S an edge cover.

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 17 Illustration of Corollary 3.1.24

3.1.24 Corollary. (König [1916]) If G is a bipartite graph with no isolated vertices, then α(G) = β'(G).

Q M

The minimum vertex cover Q yields a maximum matching M

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 18 Illustration of Corollary 3.1.24

3.1.24 Corollary. (König [1916]) If G is a bipartite graph with no isolated vertices, then α(G) = β'(G).

Q M

The minimum vertex cover Q yields a maximum matching M which saturates the vertices of Q and |Q| vertices of S. S

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 19 Illustration of Corollary 3.1.24

3.1.24 Corollary. (König [1916]) If G is a bipartite graph with no isolated vertices, then α(G) = β'(G).

Q M

L The maximum matching M extends to a minimum edge cover L.

S

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 20 Illustration of Corollary 3.1.24

3.1.24 Corollary. (König [1916]) If G is a bipartite graph with no isolated vertices, then α(G) = β'(G).

Q M

L The maximum matching M extends to a minimum edge cover L. Every edge of L – M covers one vertex of S and one vertex of Q. S

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 21 Illustration of Corollary 3.1.24

3.1.24 Corollary. (König [1916]) If G is a bipartite graph with no isolated vertices, then α(G) = β'(G).

Q M All together we have a bijection between S and L. L

S

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553. 22 Illustration of Corollary 3.1.24

3.1.24 Corollary. (König [1916]) If G is a bipartite graph with no isolated vertices, then α(G) = β'(G).

Q M Question: How can this construction fail when G is not bipartite? L

S

Contains copyrighted material from Introduction to Graph Theory by Doug West, 2nd Ed. Not for distribution beyond IIT’s Math 454/553.