Chapter 5. Optimal Matchings

Slides:



Advertisements
Similar presentations
Lecture 7. Network Flows We consider a network with directed edges. Every edge has a capacity. If there is an edge from i to j, there is an edge from.
Advertisements

1 LP Duality Lecture 13: Feb Min-Max Theorems In bipartite graph, Maximum matching = Minimum Vertex Cover In every graph, Maximum Flow = Minimum.
Bipartite Matching, Extremal Problems, Matrix Tree Theorem.
C&O 355 Mathematical Programming Fall 2010 Lecture 22 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
Breadth-First Search of Graphs Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms.
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2012 Lecture 19.
Lectures on Network Flows
Chapter 7 Maximum Flows: Polynomial Algorithms
Yangjun Chen 1 Bipartite Graphs What is a bipartite graph? Properties of bipartite graphs Matching and maximum matching - alternative paths - augmenting.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
Yangjun Chen 1 Bipartite Graph 1.A graph G is bipartite if the node set V can be partitioned into two sets V 1 and V 2 in such a way that no nodes from.
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Advanced Algorithms Piyush Kumar (Lecture 4: MaxFlow MinCut Applications) Welcome to COT5405.
Lecture 16 Maximum Matching. Incremental Method Transform from a feasible solution to another feasible solution to increase (or decrease) the value of.
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Finding Max Flow.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
OR Chapter 8. General LP Problems Converting other forms to general LP problem : min c’x  - max (-c)’x   = by adding a nonnegative slack variable.
Network Flows Chun-Ta, Yu Graduate Institute Information Management Dept. National Taiwan University.
and 6.855J March 6, 2003 Maximum Flows 2. 2 Network Reliability u Communication Network u What is the maximum number of arc disjoint paths from.
10/11/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURE 21 Network.
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Matchings and Factors Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering,
Proof of correctness of Dijkstra’s algorithm: Basically, we need to prove two claims. (1)Let S be the set of vertices for which the shortest path from.
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Trees.
Theory of Computational Complexity Probability and Computing Chapter Hikaru Inada Iwama and Ito lab M1.
Analysis of Algorithms
Lap Chi Lau we will only use slides 4 to 19
Integer Programming An integer linear program (ILP) is defined exactly as a linear program except that values of variables in a feasible solution have.
Topics in Algorithms Lap Chi Lau.
Computing Connected Components on Parallel Computers
The minimum cost flow problem
Bipartite Graphs What is a bipartite graph?
Algorithm Design and Analysis
Lectures on Network Flows
Lecture 12 Algorithm Analysis
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
1.3 Modeling with exponentially many constr.
James B. Orlin Presented by Tal Kaminker
Chap 9. General LP problems: Duality and Infeasibility
3.3 Applications of Maximum Flow and Minimum Cut
Lecture 16 Maximum Matching
Instructor: Shengyu Zhang
Analysis of Algorithms
3.5 Minimum Cuts in Undirected Graphs
3.4 Push-Relabel(Preflow-Push) Maximum Flow Alg.
Problem Solving 4.
Minimum Spanning Tree Algorithms
Max Flow Min Cut, Bipartite Matching Yin Tat Lee
Chapter 8. General LP Problems
2.2 Shortest Paths Def: directed graph or digraph
1.3 Modeling with exponentially many constr.
Chapter 5. The Duality Theorem
Systems of distinct representations
Bipartite Graph 1. A graph G is bipartite if the node set V can be partitioned into two sets V1 and V2 in such a way that no nodes from the same set are.
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
5.4 T-joins and Postman Problems
Algorithms (2IL15) – Lecture 7
and 6.855J March 6, 2003 Maximum Flows 2
Flow Feasibility Problems
V12 Menger’s theorem Borrowing terminology from operations research
Chapter 8. General LP Problems
Lecture 12 Algorithm Analysis
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Chapter 8. General LP Problems
Minimum Spanning Trees
Autumn 2019 Lecture 11 Minimum Spanning Trees (Part II)
Presentation transcript:

Chapter 5. Optimal Matchings

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

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

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

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

(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

⇒ 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

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

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)/2 (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

(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

𝑀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

(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

(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

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

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

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

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

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

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

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

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

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

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

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

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

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

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