Maximum Bipartite Matching - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Maximum Bipartite Matching

Description:

For each xy E(G), include y in T and include w in S, where yw E(G). Mark x and Goto Step 2. ... graph produces a matching and a vertex cover of equal size ... – PowerPoint PPT presentation

Number of Views:528
Avg rating:3.0/5.0
Slides: 15
Provided by: gra102
Category:

less

Transcript and Presenter's Notes

Title: Maximum Bipartite Matching


1
Maximum Bipartite Matching
  • In a graph G, if no M-augmenting path exists,
    then M is a maximum matching in G.
  • In a bipartite graph, we iteratively seek
    augmenting paths to enlarge the current matching.
    If we dont find an augmenting path, we can find
    a vertex cover with the same size as the current
    matching, then the current matching has maximum
    size.

2
Algorithm 3.2.1
  • Input An X,Y-bigraph G, a matching M in G, and
    the set U of M-unsaturated vertices in X.
  • Output Output an M-augmenting path or a vertex
    cover of size M.

3
Algorithm 3.2.1
  • Exploring M-alternating paths from U, letting S?X
    and T?Y be the sets of vertices reached. Marking
    vertices of S that have been explored for path
    extensions.

4
Algorithm 3.2.1 (2/2)
  • 1. SU and T?.
  • 2. If S has no unmarked vertex, stop and report
    T?(X-S) as a minimum cover and M as a maximum
    matching.
  • 3. Explore alternating path from an unmark x?S.
  • 3.1. If there exists unsaturated y?N(x) such
    that xy?M, then stop and report an M-augmenting
    path from U to y.
  • 3.2. For each xy?E(G), include y in T and
    include w in S, where yw?E(G). Mark x and Goto
    Step 2.

5
Theorem 3.2.2
  • Repeatedly applying Algorithm 3.2.1 to a
    bipartite graph produces a matching and a vertex
    cover of equal size
  • 1. Let QT?(X-S) and M be the matching when
    algorithm 3.2.1 stops at step 2.
  • 2. No edge joins S to Y-T. ? Q is a vertex cover.
  • 3. Each y?T is M-saturated.
  • 4. Each vertex of X-S is M-saturated.
  • 5. No edge in M joins T to X-S.
  • 3.4. 5. ? M has at least TX-S edges. ? Q is
    a minimum vertex cover and M is a maximum
    matching.

6
Time Complexity of Algorithm 3.2.1
  • Let G be an X,Y-bigraph with n vertices and m
    edges.
  • 1. Algorithm 3.2.1 executes at most n/2 times
    since ?(G)ltn/2.
  • 2. Each execution of Algorithm 3.2.1 considers
    each edge at most once.
  • ? The execution time of Algorithm 3.2.1 is O(mn).

7
Maximum Weighted Bipartite Matching and Minimum
Weighted Cover (Dual Problems)
  • A farming company owns n farms and n processing
    plants. The profit that results from sending the
    output of farm i to plant j is wi,j. The company
    wants to select edges forming a matching to
    maximize total profit.
  • The government will pay ui if the company agrees
    not to use farm i and vj if it agrees not to use
    plant j. The government must offer amounts such
    that uivjgtwi,j for all i, j. Otherwise, the
    company makes more by using edge xiyj than taking
    the government payments for those vertices. The
    government wants to minimize ?ui?vj.

8
Lemma 3.2.7
  • For a perfect matching M and weighted cover (u,v)
    in a weighted bipartite graph G, (1)
    c(u,v)gtw(M), and (2) c(u,v) w(M) iff M consists
    of edges xiyj such that uivjwi,j. In (2), M and
    (u,v) are optimal.
  • (1) c(u,v)gtw(M) since uivjgtwi,j for all i, j.
  • (2) Trivial.

9
Equality Subgraph
  • Equality Subgraph The equality subgraph Gu,v for
    a weighted cover (u,v) is the spanning subgraph
    of Kn,n whose edges are the pairs xiyj such that
    uivjwi,j. In the cover, the excess for i,j is
    uivj-wi,j.

10
Algorithm 3.2.9
  • Input A matrix of weights on the edges of Kn,n
    with bipartition X,Y.
  • Output A maximum weighted matching.
  • Idea Iteratively adjusting the cover (u,v) until
    the equality subgraph Gu,v has a perfect
    matching.
  • Initialization Let (u,v) be a cover, such that
    uimaxj wi,j and vj0.

11
Algorithm 3.2.9
12
Algorithm 3.2.9
  • 1. Find a maximum matching M in Gu,v. If M is
    perfect matching, stop and report M as a maximum
    weighted matching.
  • 2. Let Q be a vertex cover of size M in Gu,v.
    Let RX?Q and TY?Q. Leteminuivj- wi,j
    xi?X-R, yj?Y-T.
  • 3. Decreases ui byefor xi ?X-R, and increases vj
    byefor yj ?Y.
  • 4. Form the new equality graph and Goto Step 1.

13
Theorem 3.2.11
  • Algorithm 3.2.9 finds a maximum weight matching
    and a minimum cost cover
  • 1. Let (u,v) be the current cover and suppose
    that the equality subgraph has no perfect
    matching. Let (u,v) be the new lists of numbers
    assigned to the vertices.
  • (1) uivj uivj for edges xiyj from X-R to
    T or from R to Y-T.
  • (2) uivj uivje for edges xiyj from R to
    T.
  • (3) uivj uivj-e for edges xiyj from X-R
    to Y-T.
  • ? (u,v) is a cover since eminuivj- wi,j
    xi?X-R, yj?Y-T.

14
Theorem 3.2.11
  • 2. It terminates only when the equality subgraph
    has a perfect matching. ? equal value for the
    current matching and cover.
  • 3. M is not a perfect matching. ? QMltX. ?
    RTltX-RR. ? TltX-R. ? at each
    iteration the cost of the cover is reduced at
    least e. ? algorithm 3.2.9 terminates since the
    cost starts at some value and is bounded below by
    the weight of a perfect matching.
Write a Comment
User Comments (0)
About PowerShow.com