Presentation is loading. Please wait.

Presentation is loading. Please wait.

04/12/2005Tucker, Sec. 4.41 Applied Combinatorics, 4 th Ed. Alan Tucker Section 4.4 Algorithmic Matching Prepared by Joshua Schoenly and Kathleen McNamara.

Similar presentations


Presentation on theme: "04/12/2005Tucker, Sec. 4.41 Applied Combinatorics, 4 th Ed. Alan Tucker Section 4.4 Algorithmic Matching Prepared by Joshua Schoenly and Kathleen McNamara."— Presentation transcript:

1 04/12/2005Tucker, Sec. 4.41 Applied Combinatorics, 4 th Ed. Alan Tucker Section 4.4 Algorithmic Matching Prepared by Joshua Schoenly and Kathleen McNamara

2 04/12/2005Tucker, Sec. 4.42 Some Definitions X-Matching - All vertices in X are used Maximal Matching - The largest possible number of independent edges Note: an X-matching is necessarily maximal. Matching - a set of independent edges X Y Note: independent edges refer to edges that do not share a common vertex

3 04/12/2005Tucker, Sec. 4.43 More Definitions Edge Cover A set of vertices so that every edge is incident to at least one of them R(A) Range of a set A of vertices R(A) is the set of vertices adjacent to at least one vertex in A A = red, R(A) = green

4 04/12/2005Tucker, Sec. 4.44 Matching Network z a All edges infinite capacity All edges capacity 1 By converting the bipartite graph to a network, we can use network flow techniques to find matchings.

5 04/12/2005Tucker, Sec. 4.45 Matching Network Matching a – z flow z a X – matching saturation at a z a

6 04/12/2005Tucker, Sec. 4.46 Matching Network Maximal matching Maximal flow z a

7 04/12/2005Tucker, Sec. 4.47 Matching Network Edge cover Finite a – z cut z a A = red on left, B = red on right S = red vertices, an edge cover P = a, black on left, red on right P = z, red on left, black on right Edge cover means that all edges have at least one red endpoint: P to P, to, to P. Thus only uncovered edges, would go from P to.

8 04/12/2005Tucker, Sec. 4.48 Matching Network Not an edge cover Infinite a – z cut z a A = red on left, B = red on right S = red vertices, NOT an edge cover P = a, black on left, red on right P = z, red on left, black on right An infinite cut would go through an edge with two black endpoints, which corresponds to an uncovered edge.

9 04/12/2005Tucker, Sec. 4.49 Theorem 1 Recall Corollary 2a from Section 4.3: The size of a maximal flow is equal to the capacity of a minimal cut. Since…. Then, The size of a maximal matching is equal to the size of a minimal edge cover. Edge cover Finite a – z cut Matchinga – z flow and

10 04/12/2005Tucker, Sec. 4.410 Finding Matchings z a Take any matching, convert to a network, and then use the augmenting flow algorithm to find a maximal flow, hence a maximal matching.

11 04/12/2005Tucker, Sec. 4.411 An easy way to think about it 1.Start with any matching. 2.From an unmatched vertex in X, alternate between non- matching and matching edges until you hit an unmatched vertex in Y. 3.Then switch between the non-matching and matching edges along to path to pick up one more matching edge. 4.Continue this until no unmatched vertex in X leads to an unmatched vertex in Y.

12 04/12/2005Tucker, Sec. 4.412 Example Start with any matching Find an alternating path Start at an unmatched vertex in X End at an unmatched vertex in Y Switch matching to non- matching and vice versa A maximal matching! Note: if this does not result in a maximal matching, start from step one and do it again.

13 04/12/2005Tucker, Sec. 4.413 Theorem 2 Hall’s Marriage Theorem A bipartite graph has an X-matching if and only if for every subset A of X, the number of vertices in R(A) is greater than or equal to the number of vertices in A. X – matching True for all A in X A is the set of red vertices R(A) is the set of blue vertices

14 04/12/2005Tucker, Sec. 4.414 Proof of Hall’s Marriage Theorem “ ”: An X-matching implies that for every subset A of X, |R(A)| is greater than or equal to |A|. X – matching For any A, the X – matching gives at least one vertex in R(A) for every vertex in A.

15 04/12/2005Tucker, Sec. 4.415 Proof of Hall’s Marriage Theorem “ ”: If |R(A)| is greater than or equal to |A| for every subset A of X, then there is an X-matching. First note that if M is a maximal matching, then. Taking A = X, we have that since the range of X is contained in Y. Thus. Also, by Theorem 1, if S is a minimal edge cover, then.Theorem 1 Note that if, then M must be an X – matching. Thus, it suffices to show that for all edge covers S.

16 04/12/2005Tucker, Sec. 4.416 Since,. Now let A be the vertices in X but not in S, so that. Thus,. Now, S is an edge-cover, so if it doesn’t contain on the X side, it must contain all the vertices a goes to on the Y side in order to cover the edges in between. Thus, so. Thus, But, hence, so as needed. QED Proof of Hall’s Marriage Theorem “ ”: Continued… we need to show that for all edge covers S. A S R(A) R(A)

17 04/12/2005Tucker, Sec. 4.417 Class Problem Problem #7 In the following table of remaining games, is it possible for the Bears to be champions (or co-champions) if they win all remaining games? Build the appropriate network model. TeamWins to Date Games to Play With Bears With Lions With Tigers With Vampires Bears2614--446 Lions3454--01 Tigers32840--4 Vampires2911614--

18 04/12/2005Tucker, Sec. 4.418 Class Problem Problem #7 In the following table of remaining games, is it possible for the Bears to be champions (or co-champions) if they win all remaining games? Build the appropriate network model. TeamWins to Date Games to Play With Bears With Lions With Tigers With Vampires Bears2614--446 Lions3414--01 Tigers32440--4 Vampires295614--

19 04/12/2005Tucker, Sec. 4.419 Solution to Class Problem 6,1 8,0 11,4 ∞,0 1,1 4,4 0,0 ∞,1 ∞,0 ∞,4 a z TV LV LT L T V

20 04/12/2005Tucker, Sec. 4.420 Solution to Class Problem 6,1 8,0 11,4 ∞,0 1,1 4,4 0,0 ∞,1 ∞,0 ∞,4 a z TV LV LT L T V Yay! There is still hope for the Bears!


Download ppt "04/12/2005Tucker, Sec. 4.41 Applied Combinatorics, 4 th Ed. Alan Tucker Section 4.4 Algorithmic Matching Prepared by Joshua Schoenly and Kathleen McNamara."

Similar presentations


Ads by Google