1 Matchings in Graphs
Total Page:16
File Type:pdf, Size:1020Kb
1 Matchings in Graphs JJ1 2 J 3 J4J 5 JJJ67 8 C C C C C1 C2 3 4 5 C6 7 C8 JJ1 2 J 3 J4J 5 JJJ67 8 C C C C C1 C2 3 4 5 C6 7 C8 1 Definition 1 Two edges are called independent if they are not adjacent in the graph. A set of mutually independent edges is called a matching. A matching is called maximal if no other matching contains it. maximum if its cardinality is maximal among all matchings perfect if every vertex of the graph is incident to an edge of the matching. maximal vs maximum How to construct a maximal matching? 2 Given a matching M in G, a path is called M-alternating if its edges are alternatively in M and not in M. a vertex x is called weak if no edge of M is incident to x. Using alternating path connecting weak vertices 3 The symmetric difference of two sets X and Y is the set of all ele- ments that belong to one but not the other of the sets. X ⊗ Y = (X ∪ Y ) − (X ∩ Y ) Theorem 1 A matching M is maximum iff there exists no al- ternating path between any two distinct weak vertices of G. Proof. For a proof, we will try to answer the following questions: • If a graph M is a matching, what is the maximum degree of a vertex in such a graph? • If the edge set E of a graph F is the symmetric difference of two matchings M1 and M2, then what is the maximal vertex degree of F ? • Consider a component C of F above. Can C be a path, a cycle, anything else? • If C is a cycle of F , can it have an odd length; an even length? Conclusion: Let M be a matching which is not maximum and let M ∗ be maximum. Then at least one connected component of M ⊗ M ∗ is an alternating path containing more edges from M ∗. That component is an augmenting path for M. 4 Definition 2 An edge cover of graph G is a set L of edges such that every vertex is an endpoint of an edge in L. β′(G) is the smallest size of an edge cover. α′(G) is the largest size of a matching in G. Theorem 2 For every graph G without isolated vertices, α′(G)+ β′(G)= n(G). Proof. β′(G) ≤ n(G) − α′(G). Starting with a matching, add one edge for every unsaturated vertex. The total is α′(G)+ n − 2α′(G) = n − α′(G), a cover size. maximum matching unsaturated vertices α′(G) ≥ n(G) − β′(G). Consider the minimal edge cover L and the subgraph H = (V, L). H doesn’t have paths of length > 2, since otherwise an edge in- side could be removed yielding a smaller edge cover. Thus, every connected component of H is a star. If k is the number of these stars, |L| = n(G) − k. Form a matching by picking one edge from each star. 5 2 Matchings in Bipartite Graphs Definition 3 A graph G(VE) is called bipartite if V can be partitioned into two subsets V1 and V2 so that E ⊆ V1 × V2. Proposition 1 A graph G is bipartite if and only if it has no cycles of odd length. Proof. If G is bipartite and C is a cycle of G then the vertices of C can be labeled by 0 and 1 depending to which part the vertex belongs to. This implies that the length of the cycle is even. Let now G be a graph without cycles of odd length. We want to prove that G is bipartite. Obviously, we may assume that G is con- nected. Then, consider an arbitrary vertex v ∈ V (G) and define Veven (resp. Vodd) to be the set of all vertices whose distance from v is even (resp. odd). If there were an edge connecting two vertices from Aeven (resp. two vertices from Aodd), then G would have an odd cycle. Thus, G is bipartite and (Veven,Vodd) is the partition. Definition 4 Given a matching M of a bipartite graph G = (V1,V2; E), V1(M) (resp. V2(M)) denotes the set of vertices in V1 (resp. V2) incident to the edges in M. 6 Definition 5 A matching M is said to saturate a vertex v, if there is an edge (v,w) ∈ M. Theorem 3 A bipartite graph G = (V1,V2,E) contains a match- ing with |V1| edges (a matching saturating all V1) iff ∀X ⊆ V1, |X|≤|E(X)|. (∗) Proof. First, we prove that the existence of a matching saturating all V1 implies |X|≤|E(X)|. Indeed, since M is a matching, the sets V1(M) and V2(M) have the same cardinality. For every x ∈ X there is a distinct vertex y ∈ E(X) for which (x,y) is in M. Now we prove that condition ∀X ⊆ V1, |X|≤|E(X)| (∗) implies the existence of a matching which saturates all V1. Applying (*) to X = V1, we get |V1|≤|V2|. Our goal is to prove that there is a matching which saturates all vertices in V1. Suppose M0 is a maximum matching and it doesn’t saturates all V1. We will show that this supposition leads to a contradiction to the condition (∗). The idea is illustrated in the next figure. 7 D T v S Let S = V1 − V1(M0) and T = V2 − V2(M0). If there were an edge (x,y) ∈ E such that x ∈ S and y ∈ T , the new matching is M0 ∪ {(x,y)} contrary to the maximality of M0. So, we assume that no vertex in S is adjacent to any vertex in T . Because of (*), for every vertex v ∈ S, there are edges incident to v. Consider any path in G satisfying the following conditions: 1. the first vertex of the path is in S; 2. the edges of the path alternate between edges not in M0 and edges in M0. Claim. No path satisfying (1) and (2) contains a vertex in T . Indeed, if such a path had a vertex in T , it would be its last vertex, and the path itself would be an M0-alternating path with two end- vertices that are not saturated by M0. Thus, the path would have been augmenting, yielding a matching M1 which is larger than M0 contrary to the maximality of M0. 8 Let v ∈ S and D be the set of all vertices reachable from v by M0-alternating paths. Because of the Claim, D ∩ T = ∅. Furthermore, |V1(M0) ∩ D| = |V2(M0) ∩ D|. Thus, for X = |V1(M0) ∩ D| ∪ {v}, |E(X)| = |V2(M0) ∩ D|, which implies that |E(X)| = |X|− 1. This contradicts the condition on G and thus proves that S = ∅. 9 Definition 6 Given a graph G(V,E), a subset C ⊆ V is called vertex cover, if every edge in E is incident to at least one vertex in C. Question: if C is a vertex cover for G, what kind of graph will be obtained if C is removed from G? Theorem 4 (Egerv´ari (1931); K¨onig (1931)) A maximum car- dinality of a matching in a bipartite graph G = (V1,V2,E) is equal to the minimum cardinality of a vertex cover. Proof. ⇒ Let c be the smallest size of a vertex cover and m be the largest size of a matching in G. Then c ≥ m, since in any cover, every edge in a matching must be “covered” by its own vertex. ⇐ Given a minimum vertex cover C, construct a matching of size |C|, which proves that m ≥ c. 10 C V 2 V 2 Split the graph intotwo subgraphs using the V1 minimum vertex cover C V1 V2 The left subgraph (resp. right) C V 2 satisfies the condition |X| <= |E(X)| V1 CV1 V2 The left subgraph (resp. right) C V 2 must have a matching which M1 M2 C V V1 saturates partition 1 CV 1 (resp.C V2) 11.