Download presentation
Presentation is loading. Please wait.
1
Chapter 5. Optimal Matchings
2
5.1 Matchings and Alternating Paths
A matching in ๐บ=(๐, ๐ธ) is a set ๐ of edges such that no node of ๐บ is incident with more than one edge in ๐. Given a matching ๐, we say that ๐ covers a node ๐ฃ (or ๐ฃ is ๐-covered) if some edge of M is incident with v. Otherwise ๐ฃ is called ๐-exposed. The number of ๐-covered nodes is 2|๐| and the number of ๐-exposed nodes is ๐ โ2|๐|. Let ๏ฎ(๐บ) : the cardinality of a maximum matching of ๐บ ๐๐๐(๐บ) : minimum number of exposed nodes for any matching of ๐บ (deficiency of ๐บ, def(๐บ) =|๐|โ2๏ฎ(๐บ) ) For bipartite graphs, finding a maximum matching reduces to maximum flow problem and finding a minimum-weight perfect matching reduces to minimum-cost flow problem For general graphs? Will consider perfect matching โ max cardinality matching โ min weight perfect matching โ max weight matching Combinatorial Optimization 2016
3
Integer programming formulation of maximum weight matching:
maximize ( ๐ ๐ ๐ฅ ๐ :๐โ๐ธ) (min for perfect matching) subject to ๐ฅ(๐ฟ ๐ฃ )โค1, for all ๐ฃโ๐ (=1 for perfect matching) ๐ฅ ๐ โ{0,1}, for all ๐โ๐ธ. LP relaxation of the above formulation does not necessarily provide integer optimal solution. However the following formulation gives integer optimal solution. maximize ( ๐ ๐ ๐ฅ ๐ :๐โ๐ธ) subject to ๐ฅ(๐ฟ ๐ฃ )โค1, for all ๐ฃโ๐ ๐ฅ(๐พ ๐ )โค( ๐ โ1)/2, for all ๐โ๐, ๐ โฅ3, ๐ odd ๐ฅ ๐ โฅ0, for all ๐โ๐ธ. For perfect matching, minimize ( ๐ ๐ ๐ฅ ๐ :๐โ๐ธ) subject to ๐ฅ ๐ฟ ๐ฃ =1, for all ๐ฃโ๐ ๐ฅ(๐ท)โฅ1, for all ๐ทโโ (where โ is the set of odd cuts of ๐บ that are not of the form ๐ฟ(๐ฃ)) Combinatorial Optimization 2016
4
Weighted matching algorithm solves the previous formulations using combinatorial reasoning and complementary slackness optimality conditions. Given a matching ๐ of ๐บ, a path P is ๐-alternating if its edges are alternately in and not in ๐. If, in addition, the end nodes of ๐ are both ๐-exposed and distinct, then ๐ is an ๐-augmenting path. (by taking the symmetric difference of the edges on a ๐-augmenting path, we obtain a bigger matching.) For sets ๐ and ๐, the symmetric difference ๐โณ๐ is the set of elements belonging to one, but not both, of ๐, ๐. Combinatorial Optimization 2016
5
Thm 5.1: (Augmenting Path Theorem of Matchings)
A matching ๐ in a graph ๐บ=(๐, ๐ธ) is maximum if and only if there is no ๐-augmenting path. (Pf) ๐ ๐โณ๐ธ(๐) ( => ) ๐:๐๐๐ก ๐๐๐ฅ ๐๐๐ก๐โ๐๐๐ ๐: max ๐๐๐ก๐โ๐๐๐ ๐ฝ=๐โณ๐ ( <= ) Combinatorial Optimization 2016
6
(Odd Circuits and the Tutte-Berge Formula)
Recall that the cardinality of a cover provides an upper bound on the size of any matching. But, for odd circuits, the bound is not tight. (Bipartite case โ Kรถnig Th) To find tighter bound, find a lower bound on the # of ๐-exposed nodes in ๐บ. Note that |๐|= 1 2 ( ๐ โ number of ๐-exposed nodes) Let ๐ดโ๐ and ๐บโ๐ด has ๐ components ๐ป1, โฆ, ๐ป๐ having odd number of nodes. ๐ป2 ๐ป1 ๐ป๐ ๐ด Even components Combinatorial Optimization 2016
7
โ For any ๐ดโ๐, ๏ฎ(๐บ)โค1/2(|๐|โ(๐๐(๐บ\A)โ|๐ด|) )
( ๐๐(๐ป) is the number of odd components of a graph ๐ป) Special cases: If we choose a cover as ๐ด, we have |๐|โ|๐ด| odd components. So the bound is |๐ด|, same as the cover bound For odd circuit of length 2๐+1, take ๐ด=โ
โ bound is ๐. Thm 5.2: (Tutte-Berge Formula) For a graph ๐บ=(๐, ๐ธ) we have max { |๐|: ๐ a matching} = min { 1/2(|๐|โ๐๐(๐บ\A)+|๐ด|) :๐ดโ๐ }. Thm 5.3: (Tutte's Matching Theorem) A graph ๐บ=(๐, ๐ธ) has a perfect matching if and only if for every subset of nodes ๐ด we have ๐๐(๐บ\A)โค|๐ด|. (necessary and sufficient condition for the existence of a perfect matching) Combinatorial Optimization 2016
8
Shrinking odd circuits:
Let ๐ถ be an odd circuit in ๐บ. ๐บโฒ=๐บร๐ถ (the subgraph obtained from ๐บ by shrinking ๐ถ) ๐ถ Given a matching in ๐บโฒ, it can be extended to a matching in ๐บ. Combinatorial Optimization 2016
9
From Prop 5.4, have ๏ฎ(๐บ)โฅ๏ฎ(๐บร๐ถ)+(|๐(๐ถ)|โ1)/2 (5.2)
Prop 5.4: Let ๐โฒ be a matching in ๐บโฒ. Then there exists a matching ๐ of ๐บ such that ๐โ๐โฒโช๐ธ(๐ถ) and the number of ๐-exposed nodes of ๐บ is the same as the number of ๐โฒ-exposed nodes of ๐บโฒ. (Pf) ๐ถ From Prop 5.4, have ๏ฎ(๐บ)โฅ๏ฎ(๐บร๐ถ)+(|๐(๐ถ)|โ1)/ (5.2) If there exists a maximum matching in ๐บ using (|๐(๐ถ)|โ1)/2 edges from ๐ธ(๐ถ), then above inequality holds with equality. However, this does not happen in general. Combinatorial Optimization 2016
10
(example of an odd circuit which is not tight)
Odd circuit ๐ถ of ๐บ is called tight if (5.2) holds with equality. However, it is difficult to identify whether an odd circuit is tight or not. (example of an odd circuit which is not tight) Idea of tight circuit can be used for nonconstructive proof of Tutte-Berge formula. Def: A node ๐ฃ of ๐บ is called inessential if there is a maximum matching of ๐บ not covering ๐ฃ. Otherwise, ๐ฃ is called essential. If ๐ด satisfies (5.1) with equality, then every ๐ฃโ๐ด is essential. (5.3) ( Choose ๐ฃโ๐ด. Consider ๐บโฒ=๐บ\๐ฃ. Then ๐บโฒโ(๐ดโ{๐ฃ}) and ๐บ\๐ด has the same odd components, but |๐ด|>|๐ดโ{๐ฃ}|. So ๏ฎ(๐บโฒ)<๏ฎ(๐บ). ) Combinatorial Optimization 2016
11
๐1\E(๐ถ) is a maximum matching of ๐บร๐ถ not covering ๐ถ.
Lemma 5.5: Let ๐ฃ๐คโ๐ธ. If ๐ฃ, ๐ค are both inessential, then there is a tight odd circuit ๐ถ using ๐ฃ๐ค. Moreover, ๐ถ is an inessential node of ๐บร๐ถ. (Pf) There are maximum matchings ๐1 and ๐2 of ๐บ not covering ๐ฃ and ๐ค, respectively ( ๐1 covers ๐ค and ๐2 covers ๐ฃ. Otherwise we can get a bigger matching) Consider ๐ป=(๐, ๐1โณ๐2). The component containing ๐ฃ is a path ๐ starting from ๐ฃ and ending at ๐ค (๐ฃ is ๐1-exposed). (Suppose ๐ ends at an ๐ 1 -exposed node, and ends at an ๐ 2 -exposed node other than ๐ค, then derive contradiction). Adding ๐ฃ๐ค to the path ๐ provides a circuit ๐ถ. A maximum matching (for example, ๐1) makes ๐ถ tight. ๐1\E(๐ถ) is a maximum matching of ๐บร๐ถ not covering ๐ถ. ๐ฃ ๐ค ๐1 ๐2 Combinatorial Optimization 2016
12
(Proof of the Tutte-Berge Formula, Thm 5.2)
Enough to show that โ a matching ๐ and a set ๐ด such that the number of ๐-exposed nodes is exactly ๐๐(๐บ\A)โ|๐ด|. Use induction on the number of edges. True for graphs having no edges. (๐ด=โ
) Consider an edge ๐ฃ๐ค. 2 cases:(1) ๐ฃ or ๐ค essential (2) both ๐ฃ and ๐ค inessential. (1) Suppose ๐ฃ essential (similarly for ๐ค). Then ๏ฎ(๐บ\v)=๏ฎ(๐บ)โ1. By induction, โ ๐ดโฒ and ๐โฒ of ๐บ\v s.t. โ exactly ๐๐((๐บ\v)\Aโฒ)โ|๐ดโฒ| ๐โฒ-exposed nodes. Let ๐ด=๐ดโฒโช{๐ฃ}. Since ๐๐((๐บ\v)\Aโฒ)=๐๐(๐บ\A), r.h.s. of (5.1) (for ๐บ) increases by 1 for this choice of ๐ด. By assumption, โ ๐ that satisfies (5.1) with equality. Hence the number of ๐-exposed nodes is exactly ๐๐(๐บ\A)โ|๐ด|. Combinatorial Optimization 2016
13
(2) By Lemma 5.5, ๐บ has a tight circuit containing ๐ฃ๐ค.
Applying induction to ๐บโฒ=๐บร๐ถ, โ ๐โฒ and ๐ดโฒ s.t. |๐โฒ-exposed nodes|=๐๐(๐บโฒ\๐ดโฒ)โ|๐ดโฒ|. Note that ๐ถ is not in ๐ดโฒ by (5.3) since it is an inessential node of ๐บโฒ, by Lemma 5.5. By Proposition 5.4, we can extend ๐โฒ to a matching ๐ of ๐บ having the same number of exposed nodes. When we delete ๐ดโฒ from ๐บ, we have the same number of odd components as we delete ๐ดโฒ from ๐บโฒ, because if one contains ๐ถ, that node will now be replaced by ๐(๐ถ) nodes and the component of ๐บโ๐ดโฒ containing them will still be odd. Thus we get a matching ๐ and a set ๐ดโฒ of nodes such that the number of ๐-exposed nodes is exactly ๐๐(๐บ\๐ดโฒ)โ|๐ดโฒ|, as required. ๏ Combinatorial Optimization 2016
14
5.2 Maximum Matching Alternating Trees
Will consider perfect matching first, then maximum matching. Given a matching ๐ and a fixed ๐-exposed node ๐ of ๐บ, an ๐-alternating tree is a tree rooted at ๐ and the edges in ๐ appear alternately. (Leaves of the tree are in ๐ต(๐)) The nodes in an ๐-alternating tree ๐ are ๐ด(๐)โช๐ต(๐). ๐ด(๐): the set of nodes in ๐ which have odd distance from the root (odd nodes of ๐) ๐ต(๐): the set of nodes in ๐ which have even distance from the root (even nodes of ๐). ๐ is included in ๐ต(๐) ๐ Combinatorial Optimization 2016
15
Construction of an ๐-alternating tree; Begin with ๐ด=โ
, ๐ต={๐}.
If ๐ฃ๐คโ๐ธ,๐ฃโ๐ต,๐คโ๐ดโช๐ต,๐ค๐งโ๐, then add ๐ค to ๐ด, ๐ง to ๐ต. (5.4) We may be able to identify an ๐-augmenting path from an ๐-alternating tree. Properties (a) Every node of ๐ other than ๐ is covered by an edge of ๐โฉ๐ธ(๐) (b) For every node ๐ฃ of ๐, the path in ๐ from ๐ฃ to ๐ is ๐-alternating. Note that |๐ต(๐)|=|๐ด(๐)|+1 ๐ Combinatorial Optimization 2016
16
Use ๐๐ to extend ๐ป Use ๐๐ to augment ๐ดโฒ
Input: A matching ๐โฒ of a graph ๐บโฒ, an ๐โฒ-alternating tree ๐, and an edge vw of ๐บโฒ such that ๐ฃโ๐ต(๐), ๐คโ๐(๐) and ๐ค is ๐โฒ-covered. Action: Let ๐ค๐ง be the edge in ๐โฒ covering ๐ค. (Note that ๐ง is not a node of ๐.) Replace ๐ by the tree having edge-set ๐ธ(๐)โช{๐ฃ๐ค, ๐ค๐ง} Use ๐๐ to augment ๐ดโฒ Input: A matching ๐โฒ of a graph ๐บโฒ, an ๐โฒ-alternating tree ๐ of ๐บโฒ with root ๐, and an edge ๐ฃ๐ค of ๐บโฒ such that ๐ฃโ๐ต(๐), ๐คโ๐(๐) and ๐ค is ๐โฒ-exposed. Action: Let ๐ be the path obtained by attaching ๐ฃ๐ค to the path from ๐ to ๐ฃ in ๐. Replace ๐โฒ by ๐โฒโณ๐ธ(๐). Combinatorial Optimization 2016
17
We call an ๐-alternating tree ๐ in a graph ๐บ frustrated if every edge of ๐บ having one end in ๐ต(๐) has the other end in ๐ด(๐). Prop 5.6: Suppose that ๐บ has a matching ๐ and an ๐-alternating tree ๐ that is frustrated. Then ๐บ has no perfect matching. (Pf) Consider ๐บ\A(๐). Every element of ๐ต(๐) is a single-node odd component of ๐บ\A(๐). Since |๐ด(๐)|<|๐ต(๐)|, ๐บ has no perfect matching (by Tutte's Matching Theorem). ๏ ๐ Combinatorial Optimization 2016
18
Perfect Matching Algorithm for Bipartite Graphs
The Bipartite Case Perfect Matching Algorithm for Bipartite Graphs Set ๐=โ
; Choose an ๐-exposed node ๐ and put ๐=({๐}, โ
) ; While there exists ๐ฃ๐คโ๐ธ with ๐ฃโ๐ต(๐), ๐คโ๐(๐) If ๐ค is ๐-exposed Use ๐ฃ๐ค to augment ๐ ; If there is no ๐-exposed node in ๐บ Return the perfect matching ๐ and stop ; Else Replace ๐ by ({๐}, โ
), where ๐ is ๐-exposed ; Use ๐ฃ๐ค to extend ๐ ; Stop ; ๐บ has no perfect matching. Combinatorial Optimization 2016
19
Prop 5.7: (correctness of the perfect matching algorithm for bipartite graphs)
Suppose that ๐บ is bipartite, that ๐ is a matching of ๐บ, and that ๐ is an ๐-alternating tree such that no edge of ๐บ joins a node in ๐ต(๐) to a node not in ๐(๐). Then ๐ is frustrated, and hence ๐บ has no perfect matching. (Pf) Need to show that every edge having an end in ๐ต(๐) has the other end in ๐ด(๐). Only possible exception would be an edge joining two nodes in ๐ต(๐), but this creates an odd circuit which is impossible in a bipartite graph. Hence ๐ is frustrated. ๏ ๐ Combinatorial Optimization 2016
20
The Blossom Algorithm for Perfect Matching
Idea : Shrinking of odd circuits. (Edmonds, 1965) Can be extended for maximum matching problem. Let ๐บโฒ be a graph obtained from ๐บ by a sequence of odd circuit shrinkings. We call ๐บโฒ a derived graph of G. Two types of nodes in ๐บโฒ: (1) nodes of ๐บ (called original nodes of ๐บโฒ) (2) not nodes of ๐บ (called pseudonodes) Given a node ๐ฃ of ๐บโฒ, define a set ๐(๐ฃ) of nodes of ๐บ: (1) ๐(๐ฃ)={๐ฃ} , ๐ฃโ๐ (2) ๐ฃ=๐ถ, a pseudonode, then ๐(๐ฃ)=โช๐(๐ค), ๐คโ๐(๐ถ). Cardinality is odd. Prop 5.8: Let ๐บโฒ be a derived graph of ๐บ. Let ๐โฒ be a matching of ๐บโฒ, and let ๐ be an ๐โฒ-alternating tree of ๐บโฒ such that no element of ๐ด(๐) is a pseudenode. If ๐ is frustrated, then ๐บ has no perfect matching. (Pf) Delete ๐ด(๐) from ๐บ. Get a component ๐(๐ฃ) for each ๐ฃโ๐ต(๐). Therefore, ๐๐(๐บ\A(๐))>|๐ด(๐)|, so ๐บ has no perfect matching. ๏ Combinatorial Optimization 2016
21
But not sure which odd circuit should be shrunk.
A perfect matching in the derived graph ๐บโฒ can be extended to a perfect matching in ๐บ. If frustrated tree in ๐บโฒ exists, then no perfect matching in ๐บ. But not sure which odd circuit should be shrunk. not frustrated blossom ๐ค ๐ ๐ฃ ๐ข ๐ถ ๐ ๐ข Combinatorial Optimization 2016
22
Use ๐๐ to shrink and update ๐ดโฒ and ๐ป
Input: A matching ๐โฒ of a graph ๐บโฒ, an ๐โฒ-alternating tree ๐, and an edge ๐ฃ๐ค of ๐บโฒ such that ๐ฃ, ๐คโ๐ต(๐) Action: Let ๐ถ be the circuit formed by ๐ฃ๐ค together with the path in ๐ from ๐ฃ to ๐ค. Replace ๐บโฒ by ๐บโฒร๐ถ, ๐โฒ by ๐โฒโ๐ธ(๐ถ), and ๐ by the tree (in ๐บโฒ) having edge-set ๐ธ(๐)โ๐ธ(๐ถ). Prop 5.9: After application of the shrinking subroutine, ๐โฒ is a matching of ๐บโฒ, ๐ is an ๐โฒ-alternating tree of ๐บโฒ, and ๐ถโ๐ต(๐). Combinatorial Optimization 2016
23
Blossom Algorithm for Perfect Matching
Input graph ๐บ and matching ๐ of ๐บ (If ๐ is perfect, terminate); Set ๐โฒ=๐, ๐บโฒ=๐บ ; Choose an ๐โฒ-exposed node ๐ of ๐บโฒ and put ๐=({๐}, โ
) ; While there exists ๐ฃ๐คโ๐ธโฒ with ๐ฃโ๐ต(๐), ๐คโ๐ด(๐) Perform following operations; Return ๐บโฒ, ๐โฒ, ๐ and stop, ๐บ has no perfect matching Combinatorial Optimization 2016
24
Blossom Algorithm for Perfect Matching (continued)
While there exists ๐ฃ๐คโ๐ธโฒ with ๐ฃโ๐ต(๐), ๐คโ๐ด(๐) case: ๐คโ๐(๐), ๐ค is ๐โฒ-exposed Use ๐ฃ๐ค to augment ๐โฒ ; Extend ๐โฒ to a matching ๐ of ๐บ ; Replace ๐โฒ by ๐, ๐บโฒ by ๐บ ; If there is no ๐โฒ-exposed node in ๐บโฒ Return the perfect matching ๐โฒ and stop ; Else Replace ๐ by ({๐}, โ
), where ๐ is ๐โฒ-exposed ; case: ๐คโ๐(๐), ๐ค is ๐โฒ-covered Use ๐ฃ๐ค to extend ๐ ; case: ๐คโ๐ต(๐) Use ๐ฃ๐ค to shrink and update ๐โฒ and ๐ ; Return ๐บโฒ, ๐โฒ, ๐ and stop, ๐บ has no perfect matching Combinatorial Optimization 2016
25
Moreover, it determines correctly whether ๐บ has a perfect matching.
Thm 5.10: The blossom algorithm terminates after ๐(๐) augmentations, ๐(๐2) shrinking steps, ๐(๐2) tree-extension steps. Moreover, it determines correctly whether ๐บ has a perfect matching. (Pf) Algorithm maintains a matching throughout and each augmentation reduces the number of ๐-exposed nodes โ ๐(๐) augmentation. Each shrinking decreases the number of nodes in ๐. Each tree-extension decreases the number of nodes โ๐ โ ๐(๐) steps between augmentation. โ Total ๐(๐2) shrinking and tree-extension. If algorithm halts concluding that ๐บ has no perfect matching, it has found a frustrated tree. Hence, by Prop 5.8, ๐บ has no perfect matching. ๏ Combinatorial Optimization 2016
26
The Blossom Algorithm for Maximum Matching
Use the algorithm for perfect matching to find a maximum matching Apply perfect matching algorithm to ๐บ. If it finds a perfect matching, it is maximum, stop. Otherwise, delete ๐(๐) from ๐บโฒ. New ๐บโฒ does not have pseudonodes and may include some matching edges not deleted. Apply the perfect matching algorithm to new ๐บโฒ again. Continuing the process until no exposed nodes left, we obtain frustrated trees ๐1, ๐2, โฆ, ๐๐ and matching in the trees. Roots of ๐ ๐ are the only exposed nodes. Let ๐ด be the union of ๐ด( ๐ ๐ ) for all ๐. If we delete ๐ด from ๐บ, each of the nodes ๐ต( ๐ ๐ ) for every ๐ will give an odd component. So we have ๐๐(๐บ\A)โฅ|๐ด|+๐ ( ๐๐(๐บ\A)โ|๐ด|โฅ๐, ๐ is a lower bound on the number of exposed nodes ) Since we have a matching with ๐ exposed nodes, the matching is maximum. This provides constructive proof of Tutte-Burge formula. Combinatorial Optimization 2016
27
Implementation of the Blossom Algorithm
Represent ๐บโฒ implicitly by keeping a representation of the partition of ๐ determined by the sets ๐(๐ฃ) for all ๐ฃโ๐(๐บโฒ). (Similar to Kruskal's alg.) Given edge ๐ฃ๐คโ๐ธ, need to identify ๐
(๐ฃ) and ๐
(๐ค), where ๐
(๐ฃ) is the member of the partition of the nodes that contains ๐ฃ. Use "find" and "merge" operations for sets to handle blossoms. ๐(๐ log ๐ ) for each augmentation. Thm 5.11: The blossom algorithm can be implemented to run ๐(๐๐ log ๐ ). Further improvement possible: augmenting on the shortest augmenting path gives ๐( ๐ ๐) Combinatorial Optimization 2016
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.