Advanced Combinatorial Optimization September 15, Lecture 2

Similar documents
Topics in Combinatorial Optimization February 5, Lecture 2

2. Lecture notes on non-bipartite matching

Advanced Combinatorial Optimization September 17, Lecture 3. Sketch some results regarding ear-decompositions and factor-critical graphs.

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

Maximum Matching Algorithm

Lecture 4: Primal Dual Matching Algorithm and Non-Bipartite Matching. 1 Primal/Dual Algorithm for weighted matchings in Bipartite Graphs

1 Matching in Non-Bipartite Graphs

5.1 Min-Max Theorem for General Matching

Matching. Algorithms and Networks

Paths, Trees, and Flowers by Jack Edmonds

1 Bipartite maximum matching

Solutions to Problem Set 2

Sources for this lecture. 3. Matching in bipartite and general graphs. Symmetric difference

Lecture notes on: Maximum matching in bipartite and non-bipartite graphs (Draft)

MTL 776: Graph Algorithms Lecture : Matching in Graphs

Paths, Flowers and Vertex Cover

Number Theory and Graph Theory

Matchings. Saad Mneimneh

Design And Analysis of Algorithms Lecture 6: Combinatorial Matching Algorithms.

PERFECT MATCHING THE CENTRALIZED DEPLOYMENT MOBILE SENSORS THE PROBLEM SECOND PART: WIRELESS NETWORKS 2.B. SENSOR NETWORKS OF MOBILE SENSORS

12.1 Formulation of General Perfect Matching

1 Matchings in Graphs

Lecture 10,11: General Matching Polytope, Maximum Flow. 1 Perfect Matching and Matching Polytope on General Graphs

Vertex-Colouring Edge-Weightings

Assignment and Matching

Theorem 3.1 (Berge) A matching M in G is maximum if and only if there is no M- augmenting path.

Lecture 3: Graphs and flows

CS261: Problem Set #1

Matching in Bipartite Graphs

Math 170- Graph Theory Notes

Math 776 Graph Theory Lecture Note 1 Basic concepts

Matchings in Graphs. Definition 1 Let G = (V, E) be a graph. M E is called as a matching of G if v V we have {e M : v is incident on e E} 1.

Lecture 6: Graph Properties

Edmonds Blossom Algorithm

Adjacent: Two distinct vertices u, v are adjacent if there is an edge with ends u, v. In this case we let uv denote such an edge.

PERFECT MATCHING THE CENTRALIZED DEPLOYMENT MOBILE SENSORS THE PROBLEM SECOND PART: WIRELESS NETWORKS 2.B. SENSOR NETWORKS OF MOBILE SENSORS

Outline. 1 The matching problem. 2 The Chinese Postman Problem

K 4 C 5. Figure 4.5: Some well known family of graphs

Matching Theory. Figure 1: Is this graph bipartite?

1 Linear programming relaxation

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

The Structure of Bull-Free Perfect Graphs

Mathematical and Algorithmic Foundations Linear Programming and Matchings

The Weighted Matching Approach to Maximum Cardinality Matching

1. Lecture notes on bipartite matching

Lecture 8: Non-bipartite Matching. Non-partite matching

Chain Packings and Odd Subtree Packings. Garth Isaak Department of Mathematics and Computer Science Dartmouth College, Hanover, NH

Math 778S Spectral Graph Theory Handout #2: Basic graph theory

Figure 2.1: A bipartite graph.

Steiner Trees and Forests

6. Lecture notes on matroid intersection

5 Matchings in Bipartite Graphs and Their Applications

CS473-Algorithms I. Lecture 13-A. Graphs. Cevdet Aykanat - Bilkent University Computer Engineering Department

Bipartite Roots of Graphs

Section 3.1: Nonseparable Graphs Cut vertex of a connected graph G: A vertex x G such that G x is not connected. Theorem 3.1, p. 57: Every connected

Definition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1

Graph Theory: Matchings and Factors

Lecture 15: Matching Problems. (Reading: AM&O Chapter 12)

Graph theory - solutions to problem set 1

Definition 1.1. A matching M in a graph G is called maximal if there is no matching M in G so that M M.

1. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time:

Computability Theory

Recognizing Interval Bigraphs by Forbidden Patterns

Matching and Covering

Solution for Homework set 3

Network Flow and Matching

LARGE RAINBOW MATCHINGS IN GENERAL GRAPHS. 1. Introduction

Lecture Orientations, Directed Cuts and Submodular Flows

Lecture 5: July 7,2013. Minimum Cost perfect matching in general graphs

MATH 363 Final Wednesday, April 28. Final exam. You may use lemmas and theorems that were proven in class and on assignments unless stated otherwise.

GRAPH THEORY and APPLICATIONS. Matchings

Network flows and Menger s theorem

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur

AMS /672: Graph Theory Homework Problems - Week V. Problems to be handed in on Wednesday, March 2: 6, 8, 9, 11, 12.

Discrete mathematics , Fall Instructor: prof. János Pach

Exam problems for the course Combinatorial Optimization I (DM208)

Graph Algorithms Matching

Introduction to Graphs

9 Connectivity. Contents. 9.1 Vertex Connectivity

A study of Matchings in Graphs

Lecture 4. 1 Overview. 2 Preflows. COMPSCI 532: Design and Analysis of Algorithms September 4, 2015

Two Characterizations of Hypercubes

LECTURES 3 and 4: Flows and Matchings

Definition: A graph G = (V, E) is called a tree if G is connected and acyclic. The following theorem captures many important facts about trees.

8 Matroid Intersection

A matching of maximum cardinality is called a maximum matching. ANn s/2

[8] that this cannot happen on the projective plane (cf. also [2]) and the results of Robertson, Seymour, and Thomas [5] on linkless embeddings of gra

Fast and Simple Algorithms for Weighted Perfect Matching

CPS 102: Discrete Mathematics. Quiz 3 Date: Wednesday November 30, Instructor: Bruce Maggs NAME: Prob # Score. Total 60

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2

Extremal Graph Theory: Turán s Theorem

Lecture 8: PATHS, CYCLES AND CONNECTEDNESS

Improved upper and lower bounds on the feedback vertex numbers of grids and butterflies

Graph Theory: Introduction

5. Lecture notes on matroid intersection

HW Graph Theory SOLUTIONS (hbovik)

Paths, Flowers and Vertex Cover

Approximation slides 1. An optimal polynomial algorithm for the Vertex Cover and matching in Bipartite graphs

Transcription:

18.438 Advanced Combinatorial Optimization September 15, 2009 Lecture 2 Lecturer: Michel X. Goemans Scribes: Robert Kleinberg (2004), Alex Levin (2009) In this lecture, we will present Edmonds s algorithm for computing a maximum matching in a (not necessarily bipartite) graph G. We will later use the analysis of the algorithm to derive the Edmonds-Gallai Decomposition Theorem stated in the last lecture. 1 Recapitulation Recall the following essential definitions and facts from the last lecture. A matching in an undirected graph G is a set of edges, no two of which share a common endpoint. Given a graph G and a matching M, a vertex is matched if it is the endpoint of an edge in M, unmatched otherwise; we will often designate the set of unmatched vertices by X. Given a graph G with matching M, an M-alternating path is a path whose edges are alternately in M and not in M. (Here we use path to mean a simple path, i.e. one with no repeated vertices. We ll refer to a non-simple path as a walk.) If both endpoints of an M-alternating path belong to the set X of unmatched vertices, it is called an M-augmenting path. Recall the following theorem from last time. Theorem 1 A matching M is of maximum size if and only if G contains no M-augmenting path. Figure 1: An M-augmenting path 2 Flowers, Stems, and Blossoms The following construction is useful for finding M-augmenting paths. Given a graph G = (V, E) with matching M; construct a directed graph Ĝ = (V,A) with the same vertex set as G, and with edge set determined by the rule that (u,w) A if and only if there exists v with (u,v) E \ M and (v,w) M. Observe that every M-augmenting path in G corresponds to a path in Ĝ that begins at a vertex in X and ends at a neighbor of X. However, the converse is not true, because an M-alternating walk may begin at a vertex in X and end at a neighbor of X, without being an M-augmenting path, if it contains an odd cycle. Figure 2 illustrates an example of such a walk. This motivates the following definition. Definition 1 An M-flower is an M-alternating walk v 0,v 1,v 2,...,v t (numbered so that we have (v 2k 1,v 2k ) M, (v 2k,v 2k+1 ) M) satisfying: 1. v 0 X. 2. v 0,v 1,v 2,...,v t 1 are distinct. 3. t is odd. 2-1

X Stem Blossom Figure 2: An M-flower. Note that the dashed edges represent edges of Ĝ. 4. v t = v i, for an even i. The portion of the flower from v 0 to v i is called the stem, while the portion from v i to v t is called the blossom. Lemma 2 Let M be a matching in G, and let P = (v 0,v 1,...,v t ) be a shortest alternating walk from X to X. Then either P is an M-augmenting path, or v 0,v 1,...,v j is an M-flower for some j < t. Proof: If v 0,v 1,...,v t are all distinct, P is an M-augmenting path. Otherwise, assume v i = v j, i < j, and let j be as small as possible, so that v 0,v 1,...,v j 1 are all distinct. We shall prove that v 0,v 1,...,v j is an M-flower. Properties 1 and 2 of a flower are automatic, by construction. It cannot be the case that j is even, since then (v j 1,v j ) M, which gives a contradiction in both of the following cases: i = 0: (v j 1,v j ) M contradicts v 0 X. 0 < i < j 1: (v j 1,v j ) M contradicts the fact that M is a matching, since v i is already matched to a vertex other than v j 1. This proves that j is odd. It remains to show that i is even. Assume, by contradiction, that i is odd. This means that (v i,v i+1 ) and (v j,v j+1 ) are both edges in M. Then v j+1 = v i+1 (since both are equal to the other endpoint of the unique matching edge containing v j = v i ), and we may delete the cycle from P to obtain a shorter alternating walk from X to X. (See Figure 3.) v 6 v 5 v v v v =v v =v v v v 0 1 2 3 7 4 8 9 10 11 Figure 3: An alternating walk from X to X which can be shortened. 2-2

Given a flower F = (v 0,v 1,...,v t ) with blossom B, observe that for any vertex v j B it is possible to modify M to a matching M satisfying: 1. Every vertex of F belongs to an edge of M except v j. 2. M agrees with M outside of F, i.e. M M F. 3. M = M. To do so, we take M to consist of all the edges of the stem which do not belong to M, together with a matching in the blossom which covers every vertex except v j, as well as all the edges in M outside of F. Whenever a graph G with matching M contains a blossom B, we may simplify the graph by shrinking B, a process which we now define. Definition 2 (Shrinking a blossom) Given a graph G = (V,E) with a matching M and a blossom B, the shrunk graph G/B with matching M/B is defined as follows: V (G/B) = (V \ B) {b} E(G/B) = E \ E[B] M/B = M \ E[B] where E[B] denotes the set of edges within B, and b is a new vertex disjoint from V. Observe that M/B is a matching in G, because the definition of a blossom precludes the possibility that M contains more than one edge with one but not both endpoints in B. Observe also that G/B may contain parallel edges between vertices, if G contains a vertex which is joined to B by more than one edge. The relation between matchings in G and matchings in G/B is summarized by the following theorem. Theorem 3 Let M be a matching of G, and let B be an M-blossom. Then, M is a maximum-size matching if and only if M/B is a maximum-size matching in G/B. Proof: (= ) Suppose N is a matching in G/B larger than M/B. Pulling N back to a set of edges in G, it is incident to at most one vertex of B. Expand this to a matching N + in G by adjoining 1 2 ( B 1) edges within B to match every other vertex in B. Then we have N+ N = ( B 1)/2, while at the same time M M/B = ( B 1)/2 (the latter follows because B is an M-blossom, so there are ( B 1)/2 edges of M in B; then M/B contains all the corresponding edges in M except those ( B 1)/2). We conclude that N + exceeds M by the same amount that N exceeds M/B. ( =) If M is not of maximum size, then change it to another matching M, of equal cardinality, in which B is an entire flower. (If S is the stem of the flower whose blossom is B, then we may take M = M S.) Note that M /B is of the same cardinality as M/B, and b is an unmatched vertex of M /B. Since M is not a maximum-size matching in G, there exists an M -augmenting path P. At least one of the endpoints of P is not in B. So number the vertices of P u 0,u 1,...,u t with u 0 B, and let u i be the first node on P which is in B. (If there is no such node, then u i = u t.) This sub-path u 0,u 1,...,u i is an (M /B)-augmenting path in G/B. Note that if M is a matching in G that is not of maximum size, and B is blossom with respect to M, then M/B is not a maximum-size matching in G/B. If we find a maximum-size matching N in G/B, then the proof gives us a way to unshrink the blossom B in order to turn N into a matching N + of G of size larger than that of M. However, it is important to note that N + will not, in general, be a maximum-size matching of G, as the example in Figure 4 shows. 2-3

(a) The graph G with the matching (b) The shrunk graph G/B with M shown in bold the matching M/B (the empty matching) (c) The shrunk graph G/B with a maximum-size matching N (d) The graph G with the matching N + obtained from N by the unshrinking process. Note that it is not a maximum-size matching Figure 4: A maximum matching in the graph G/B does not necessarily pull back to a maximum matching in G. 3 A polynomial-time maximum matching algorithm The algorithm for computing a maximum matching is specified in Figure 5. The correctness of the algorithm is established by Lemma 2 and Theorem 3. The running time may be analyzed as follows. We can compute X and Ĝ in linear time, and can find ˆP in linear time (by breadth-first search). Shrinking a blossom also takes linear time. We can only perform O(n) such shrinkings before terminating or increasing M. The number of times we increase M is O(n). Therefore the algorithm s running time is O(mn 2 ). With a little more work, this can be improved to O(n 3 ). (See Schrijver s book.) The fastest known algorithm, due to Micali and Vazirani, runs in time O( n m). 2-4

M := X := {unmatched vertices} /* Initially all of V. */ Form the directed graph Ĝ. while Ĝ contains a directed path ˆP from X to N(X) Find such a path ˆP of minimum length. P := the alternating path in G corresponding to ˆP if P is an M-augmenting path, modify M by augmenting along P. Update X and construct Ĝ. else P contains a blossom B. Recursively find a maximum-size matching M in G/B. if M = M/B /* M is already a max matching. */ return M /* Done! */ else /* M can be enlarged */ Unshrink M as in the proof of Theorem 3, to obtain a matching in G of size > M. /* It is not necessarily maximal */ Update M and X and construct the graph Ĝ. end Figure 5: Algorithm for computing a maximum matching 2-5