3.2.1. Augmenting path algorithm Two theorems to recall: Theorem 3.1.10 (Berge). A matching M in a graph G is a maximum matching in G iff G has no M- augmenting path. Theorem 3.1.16 (König,Egerváry) If G is bipartite, then a maximum matching and a minimum vertex cover of G have the same size (’(G)=(G)). Augmenting path algorithm for maximum bipartite matching Input: X,Y-bigraph. Output: M,Q with |M|=|Q| Use modified breadth-first search to find augmenting paths. Initialize with empty matching and iteratively increase by 1. 1
3.2.1. Augmenting path algorithm. Two theorems to recall: Theorem 3.1.10 (Berge). A matching M in a graph G is a maximum matching in G iff G has no M- augmenting path. - PowerPoint PPT Presentation
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
3.2.1. Augmenting path algorithm
Two theorems to recall:Theorem 3.1.10 (Berge). A matching M in a graph G is a maximum matching in G iff G has no M-augmenting path.Theorem 3.1.16 (König,Egerváry) If G is bipartite, then a maximum matching and a minimum vertex cover of G have the same size (’(G)=(G)).
Augmenting path algorithm for maximum bipartite matchingInput: X,Y-bigraph. Output: M,Q with |M|=|Q|Use modified breadth-first search to find augmenting paths.Initialize with empty matching and iteratively increase by 1.Produce a vertex cover of same size to certify the output.
1
3.2.1. Augmenting path algorithm
Algorithm (Augmenting path algorithm)Input An X,Y-bigraph G, a (partial matching) M, andthe set U of M-unsaturated vertices of XIdea Explore augmenting paths to all possible vertices, marking explored vertices and their predecessors, and tracking reached vertices SµX and TµYInitialization S=U and T=;Iteration If S is all marked, stop and output M and Q=T[(X-S).Otherwise, explore from an unmarked x2S. For any edge xy2E(G)-M: (1) mark y and put y in T. (2) For any edge yw2M, mark w and put w in S.Stop if an unsaturated y is found; report an M-augmenting path.Otherwise continue exploring in this fashion.
Iteration 5: From x4, explore y2,y3 and their (distinct) matched neighbors.
SSS
T T
Augmenting path algorithm example
x1 x2 x3 x4 x5
y1 y2 y3 y4 y5
16
Iteration 5: From x1, and x3, explore to find y1 via non-matching edges. Explore back up to x2 via a matching edge.
SSS S
T TT
Augmenting path algorithm example
x1 x2 x3 x4 x5
y1 y2 y3 y4 y5
17
Termination: No vertex of S is unexplored.Output: maximum matching M={x1y2,x2y1,x3y3,x5y4}Minimum vertex cover Q=T[(X-S) ={x5,y1,y2,y3}.
SSS S
T TT
Q
QQQ
Maximum Weighted Transversal
0 0 0 0 0
6 4 4 4 3 6
4 1 1 4 3 4
5 1 4 5 3 5
9 5 6 4 7 9
8 5 3 6 8 3
Transversal: A set M of n entries of an n£n, matrix, no two in the same column or row. Its weight is the sum of the entries.Cover: A pair of vectors (u,v)=(u1,…,un;v1,…,vn) such that every entry wi,j of the matrix satisfies wi,j · ui+vj.
u
v
w(M)=23
w(u,v)=32
3.2.7. Maximum Transversal = Minimum Cover
3.2.7. Lemma. (Duality of weighted matching and weighted cover problems) For a perfect matching M and a weighted cover (u,v) in a weighted bipartite graph G, c(u,v)¸w(M). Also, c(u,v)=w(M) iff M consists of edges xiyj such that ui+vj=wi,j. In this case, M and (u,v) are optimal.
Algorithm (Hungarian Algorithm)Input An n£n matrix of nonnegative edge weights of Kn,n
Idea Iteratively adjust the cover (u,v) until the equality subgraph Gu,v has a perfect matching Initialization Any cover (u,v), such as ui=maxi wi,j and vj=0Iteration Find a maximum matching M in Gu,v. If M is a perfect matching, stop and output M and (u,v) as a maximum weight matching and minimum weight cover.Otherwise:Let = smallest excess in Gu,v of an edge from X-R to Y-T.Replace uià ui- for all xi2 X-R.Replace vjà vj+ for all yj2 Y-T.Form the new equality subgraph Gu,v and repeat.