1 / 108

Chapter 3

Chapter 3. Matchings and Covers Algorithms and Applications Matchings in General Graph. Matchings and Factors. Matching 3.1.1. A matching in a simple graph G is a set of edges with no shared endpoints.

lavada
Télécharger la présentation

Chapter 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 3 Matchings and Covers Algorithms and Applications Matchings in General Graph Matchings and Factors Ch. 3. Matchings and Factors

  2. Matching 3.1.1 • A matching in a simple graph G is a set of edges with no shared endpoints. • The vertices incident to the edges of a matching Mare said to be saturated by M; the others are unsaturated. • Aperfect matching in a graph is a matching that saturates every vertex. Saturated Unsaturated A matching in bipartite graph A matching in general graph Ch. 3. Matchings and Factors

  3. Matching 3.1.1 • Aperfect matching in a graph is a matching that saturates every vertex. Perfect Matching Maximum Matching Not a perfect matching Ch. 3. Matchings and Factors

  4. Example: Perfect matching in Kn,n3.1.2 • ConsiderKn,nwith partite sets X={x1,…, xn} andY={y1,…, yn}. • A perfect matching defines a bijection from X to Y. • Successively finding mates for x1, x2,… yieldsn! perfect matchings. • Each matching is represented by a permutation of [n], mappingitojwhenxiis matched to yj. Ch. 3. Matchings and Factors

  5. Example: Perfect matching in Kn,n3.1.2 • ForK3,3, there are: 123, 132, 213, 231, 312, 321. • 312: (x1-y3) (x2-y1) (x3-y2) Ch. 3. Matchings and Factors

  6. 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 1 Example: Perfect matching in Kn,n3.1.2 • We can express the matchings as matrices. • WithXandYindexing the rows and columns, we let positioni, j be 1 for each edge xiyjin a matchingMto obtain the corresponding matrix. • There is one 1 in each row and each column. Y1 Y2 Y3 Y4 X1 X2 X3 X4 X1 X2 X3 X4 X Y Y1 Y2 Y3 Y4 Ch. 3. Matchings and Factors

  7. Perfect Matchings in Complete graphs • K2n+1has no perfect matching, Consider K2n. • Let fnbe the number of ways to pair up 2ndistinct people in K2n • There are 2n-1 choices for partner of v2n, and for each such choices there are fn-1ways to complete the matching (see example in the next page) • Hencefn=(2n-1)fn-1forn1. Withf0=1, it follows by induction thatfn=(2n-1)·(2n-3) · · ·(1). Ch. 3. Matchings and Factors

  8. Example: Perfect Matchings in K6 • ForK6 , n=3, • f3is the number of perfect matchings • f3= (2n-1) * f2 = 5* f2=5*3*f1 Ch. 3. Matchings and Factors

  9. Maximal Matching and Maximum Matching 3.1.4 • A maximum matchingin a graph is matching that can not be enlarged by adding an edge. • A maximum matchingis a matching of maximum size among all matchings in the graph. • A matchingM is maximal if every edge not in Mis incident to an edge already in M. • Every maximum matching is a maximal matchings, but the converse need not hold. Ch. 3. Matchings and Factors

  10. Maximal  Maximum 3.1.5 • The smallest graph having a maximal matching that is not a maximum matching is P4. • If we take the middle edge, then we can add no other, but the two end edges form a larger matching. • Below we show this phenomenon in P4. Maximal Maximum Ch. 3. Matchings and Factors

  11. Alternating path & Augmenting path 3.1.6 • Given a matching M, anM-alternating pathis a path that alternate between edges in Mand edges not inM. • AnM-alternating path whose endpoints are unsaturated byMis aM-augmenting path. B A C D B A C D Augmenting path: 1) E-B-F-D 2) A-F-B-G-C-H F E H G F E H G Ch. 3. Matchings and Factors

  12. Symmetric Difference 3.1.7 • If GandHare graphs with vertex set V, then thesymmetric differenceGHis the graph with vertex setVwhose edges are those edges appearing in exactly one ofGand H. • We also use this notation for sets of edges ; in particular, if MandM’are matchings, then MM’ = (M-M’)(M’-M). • Very similar to Exclusive-OR Ch. 3. Matchings and Factors

  13. Example of Symmetric Difference M M’ B B A C A C D E F G D E F G I I H K L M N H K L M N J J B A C D E F G MM’ I H K L M N J Ch. 3. Matchings and Factors

  14. Lemma: Every component of the symmetric difference of two matchings is a path or an even cycle3.1.9 Proof: • Let Mand M’ be matchings, and F beMM’. • SinceMandM’ are matchings, every vertex has at most one incident edge from each of them • ThusFhas at most two edges at each vertex. • Since (F)2, every component of Fis a path or a cycle.  B A C D E F G MM’ I H K L M N J Ch. 3. Matchings and Factors

  15. Lemma: Every component of the symmetric difference of two matchings is a path or an even cycle3.1.9 Proof: (continue) • Furthermore, every path or cycle inFalternates between edgesM-M’and edges of M’-M. • Thus each cycle has even length, with an equal number of edges from Mand from M’. Ch. 3. Matchings and Factors

  16. Theorem: A matching M in a graph G is a maximum matching in G if and only if G has no M-augmenting path. 3.1.10 Proof: • We prove the contrapositive of each direction; Ghas a matching larger than Mif and only ifGhas anM-augmenting path. • (sufficiency) It is seen that an M-augmenting path can be used to produce a matching larger than M. Ch. 3. Matchings and Factors

  17. Theorem: A matching M in a graph G is a maximum matching in G if and only if G has no M-augmenting path. 3.1.10 Proof: (continue) • (necessity) For the converse, • Let M’be a matching in Glarger than M • LetF=MM’. By Lemma 3.1.9, Fconsists of paths and even cycles; the cycles have the same number of edges fromMandM’ • Since |M’|>|M|, Fmust have a component with more edges of M’ than of M. Such a component can only be a path that starts and ends with an edge of M’; thus it is a M-augmenting path in G. Ch. 3. Matchings and Factors

  18. Theorem: An X,Y-bigraph G has a matching that saturates X if and only if |N(S)|  |S| for all SX. 3.1.11 • Necessity.The |S| vertices matched to Smust lie in N(S). • Sufficiency.To prove that Hall’s Condition is sufficient, we prove the contra-positive: If Mis a maximum matching in Gand Mdoes not saturate X, then there is a set SX such that |N(S)|<|S|. Ch. 3. Matchings and Factors

  19. Theorem: An X,Y-bigraph G has a matching that saturates X if and only if |N(S)|  |S| for all SX. 3.1.11 Sufficiency • LetuXbe a vertex unsaturated by M. • Among all the vertices reachable from ubyM-alternating paths in G, letSconsist of those in X, and that Tconsist of those in Y. → S Given u, Let ‘~’ represent alternating Let R ={v| (v,u) M~Pathexists} S={v|vX and vR} T={v|vY and vR} X u Y T=N(S) Ch. 3. Matchings and Factors

  20. Theorem 3.1.11Continue SufficicyContinue • We claim that MmatchesTwithS-{u}. TheM-alternating paths from ureachYalong edges not in Mand return to Xalong edges inM. • Hence every vertex of S-{u} is reached by an edge in Mfrom a vertex in T. S X u Y T=N(S) Ch. 3. Matchings and Factors

  21. Theorem 3.1.11Continue Sufficiencycontinue • Since there is no M-augmenting path, every vertex of Tis saturated; thus anM-augmenting path reaching yTextends via Mto a vertex of S. • Hence these edges ofMyield a bijection fromTto S-{u}, and we have |T|=|S-{u}|. S X u Y T=N(S) Ch. 3. Matchings and Factors

  22. Theorem 3.1.11Continue Sufficiencycontinue • With T=N(S), we have proved that |N(S)|=|T|=|S|-1<|S| for this choice of S. This completes the proof of the contrapositive. S X u Y T=N(S) Ch. 3. Matchings and Factors

  23. Corollary: for k>0, every k-regular bipartite graph has a perfect matching. 3.1.13 Proof : • LetGbe ak-regular X,Y- bigraph • Counting the edges by endpoints in Xand by endpoints inYshows thatk|X| = k|Y| • So|X|=|Y|. • Hence it suffices to verify Hall’s Condition; a matching that saturatesXwill also saturate Yand be perfect matching. ► Ch. 3. Matchings and Factors

  24. Corollary: for k>0, every k-regular bipartite graph has a perfect matching. 3.1.13 Proof : Continued • ConsiderSX. Letmbe the number of edges from StoN(S) • Since Gisk-regular, m=k|S|. Thesemedges are incident toN(S), somk|N(S)| N(S) S m=k|S|, mk|N(S)| Ch. 3. Matchings and Factors

  25. Corollary: for k>0, every k-regular bipartite graph has a perfect matching. 3.1.13 Proof : Continued • Hencek|S|k|N(S)|, which yields |N(S)||S| whenk>0. • Having chosen SXarbitrarily, we have established Hall’s condition. N(S) S m=k|S|, mk|N(S)| Ch. 3. Matchings and Factors

  26. Vertex Cover 3.1.14 • A vertex cover of a graph Gis a set QV(G) that contains at least one endpoint of every edge. The vertices inQcover E(G). Ch. 3. Matchings and Factors

  27. Vertex Cover 3.1.14 • In a graph that represents a road network (with straight roads and no isolated vertices). • Finding a minimum vertex cover = Placing the minimum number of policemen to guard the entire road network.   Ch. 3. Matchings and Factors

  28. Matchings and Vertex covers • In the graph underneath • We mark a vertex cover of size 2 and show a matching of size 2 in bold. • |vertex cover|  | matching| Ch. 3. Matchings and Factors

  29. Matchings and Vertex covers • As the graph illustrated underneath • the optimal values differ by 1 for an odd cycle • The difference can be arbitrarily large Ch. 3. Matchings and Factors

  30. Theorem: 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. 3.1.16 Green: Vertex cover Red: Matching |Q||M| B B A C A C F F E E D D G G Ch. 3. Matchings and Factors

  31. Theorem 3.1.16 Proof : • LetGbe an X, Y-bigraph. • Since distinct vertices must be used to cover the edges of a matching, |Q|  |M| wheneverQis a vertex cover andMis a matching in G • Given a smallest vertex cover Qof G, we construct a matching of size |Q| to prove that equality can always be achieved. Ch. 3. Matchings and Factors

  32. Theorem 3.1.16 Continue • PartitionQby letting R=QXand T=QY. • LetHandH’ be the subgraphs of Ginduced by R(Y-T) andT(X-R), respectively. R X H H’ Y T Ch. 3. Matchings and Factors

  33. Theorem 3.1.16 Continue • We use Hall’s Theorem to show that Hhas a matching that saturatesRintoY-TandH’ has a matching that saturated T. • SinceHandH’ are disjoint, the two matchings together form a matching of size |Q| inG. R X H H’ Y T Ch. 3. Matchings and Factors

  34. Theorem 3.1.16 Continue • SinceRTis a vertex cover, Ghas no edge from Y-TtoX-R. • Otherwise, an edge between Y-TtoX-Ris not covered X S R H H’ Y T NH(S) Ch. 3. Matchings and Factors

  35. Theorem 3.1.16 Continue • For each SR, we consider NH(S), which is contained in Y-T. • If |NH(S)|<|S|, then we can substitute NH(S) for S in Q to obtain a smaller vertex cover • since NH(S) cover all edges incident toSthat are not covered by T R |NH(S)||S| X S H H’ Y T NH (S) Ch. 3. Matchings and Factors

  36. Theorem 3.1.16 continue • The minimality of Qthus yields Hall’s Condition in H, and hence Hhas a matching that saturates R • Applying the same argument toH’yields the matching that saturates T R X S H H’ Y T NH(S) A matching exists in H of size |R| A matching exists in H’ of size |T| Ch. 3. Matchings and Factors

  37. Min-Max relation 3.1.17 • A min-max relationis a theorem stating equality between the answers to a minimization problem and maximization problem over a class of instances. • The Konig-Egervary Theorem is such a relation for vertex covering and matching in bipartite graphs. Ch. 3. Matchings and Factors

  38. Min-Max relation 3.1.17 • For the discussions in this text, we think of a dual pair of optimization problems • as a maximization problemMand minimization problemN, defined on the same instances (such as graphs), • such that for every candidate solutionMtoMand every candidateNtoN, the number of Mis less than or equal to the value of N. • Often the “value” is cardinality, as above where Mis maximum matching and Nis minimum vertex cover. Ch. 3. Matchings and Factors

  39. Independent sets and covers • The independence number of a graph is the maximum size of an independent set of vertices. • The independence number of a bipartite graph does notalways equal the size of a partite set. • In the graph bellow, both partite sets have size 3, but we have marked an independent set of size 4. Ch. 3. Matchings and Factors

  40. Edge cover 3.1.19 • An edge coverof Gis a set Lof edges such that every vertex of Gis incident to some edge ofL. • The four bold edges in thee following graph form an edge cover. Ch. 3. Matchings and Factors

  41. Definitions • For the optimal sizes of the sets of the independence and covering problems we have defined, we use the notation below. • Maximum size of independent set(G) • Maximum size of matching’(G) • Minimum size of vertex cover (G) • Minimum size of edge cover ’(G) Ch. 3. Matchings and Factors

  42. Lemma: In a graph G, SV(G) is an independent set if and only if Ŝ is a vertex cover, and hence (G)+ (G) = n(G).3.1.21 Proof : • IfSis an independent set, then every edge is incident to at least one vertex of Ŝ. • Conversely, if Ŝcovers all the edges, then there are no edges joining vertices of S.   Independent set Ch. 3. Matchings and Factors

  43. Graph Theory Lemma: In a graph G, SV(G) is an independent set if and only if Ŝ is a vertex cover, and hence (G)+ (G) = n(G).3.1.21 Proof : continued Hence every maximum independent set is the complement of a minimum vertex cover, and (G)+(G)=n(G) (G) = 4 (G) = 2 n(G) = 6 43 Ch. 3. Matchings and Factors

  44. Theorem: If G is a graph without isolated vertices, then α’(G)+ β’(G) =n(G).3.1.22’(G): Maximum size of matching ’(G): Minimum size of edge cover Proof: • From a maximum matching M, we will construct an edge cover of sizen(G)-|M|.(see next page) • Since a smallest edge cover is not bigger than this cover, this will imply that ’(G)n(G)-’(G). • Also, from a minimum edge cover L, we will construct a matching of sizen(G)-|L|.(see next page) • Since a largest matching is not smaller than this matching, this will imply that ’(G)n(G)-’(G). • These two inequalities complete the proof. (detail) Ch. 3. Matchings and Factors

  45. Theorem 3.1.22 Continue • GivenM, we construct an edge cover of size n(G)-|M|. • Add to Mone edge incident to each unsaturated vertex. • We have used one edge for each vertex, except that each edge ofMtakes care of two vertices, • So the total size of this edge cover isn(G)-|M|, as desired.  Select one edge for each unsaturated vertex |(unsaturated Vertices)| = n(G)-2|M| Ch. 3. Matchings and Factors

  46. Theorem 3.1.22 Continue • Given a minimum edge cover L, we construct a matching of sizen(G)-|L|. • If both ends of an edge e belong to edges in Lother thane, theneL, sinceL-{e} is also an edge cover. • Hence each component formed by edges of Lhas at most one vertex of degree exceeding 1 and is a star (a tree with at most one non-leaf).  can be deleted Assume k components, then |L|=n(G)-k Impossible case Onecomponent Ch. 3. Matchings and Factors

  47. Theorem 3.1.22 Continue • Letkbe the number of these components • SinceLhas one edge for each non-central vertex in each star, we have |L|=n(G)-k • We form a matching Mof size k =n(G)-|L| by choosing one edge from each star inL Ch. 3. Matchings and Factors

  48. Maximum Bipartite Matching3.2 • To find a maximum matching, we iteratively seek augmenting paths to enlarge the current matching. • Given a matching Min an X, Y –bigraph G, we search forM-augmenting paths from each M-unsaturated vertex in X. Ch. 3. Matchings and Factors

  49. Augmenting Path Algorithm – for matching 3.2.1 Input:AnX, Y-bigraph G, a matching MinG, and the setUofM-unsaturated vertices in X. Ideal: • ExploreM-alternating paths from U • LetSXandTYbe the sets of vertices reached • Mark vertices ofSthat have been explored for path extensions • As a vertex is reached, record the vertex from which it is reached Ch. 3. Matchings and Factors

  50. Augmenting Path Algorithm – for matching 3.2.1 Initialization:S=UandT=. Iteration: • IfS has no unmarked vertex, stop and report • T(X-S)as a minimum cover and • M as a maximum matching  Ch. 3. Matchings and Factors

More Related