Graph Matching prepared and Instructed by Shmuel Wimer Eng. Faculty, Bar-Ilan University March 2014 Graph Matching 1 Matching in Bipartite Graphs A matching in an undirected graph πΊ is a set of pairwise disjoint edges. A perfect matching consumes (saturates) all πΊ’s vertices. Also called complete matching. πΎπ,π has π! perfect matchings. (why?) πΎ2π+1 has no perfect matchings. (why?) πΎ2π has (2π)!/(2ππ!) perfect matchings. (why?) March 2014 Graph Matching 2 Maximum Matching A maximal matching is obtained by iteratively enlarging the matching with a disjoint edge until saturation. A maximum matching is a matching of largest size. It is necessarily maximal. Given a matching π , an π΄-alternating path π is alternating between edges in π and edges not in π. Let π’s end vertices be not in π. The replacement of M’s edges with πΈ(π) − π produces a matching π’ such that |π’| = |π| + 1. This is called π΄-augmentation. March 2014 Graph Matching 3 Maximum matching has no augmentation path. (why?) Symmetric Difference: πΊ π, πΈπΊ π» π, πΈπ» πΊβπ» β πΉ π, πΈπΊ ⊕ πΈπ» Symmetric difference is used also for matching. If π and π′ are two matchings then πΔπ′ = (π ∪ π′) − (π ∩ π′). March 2014 Graph Matching 4 Theorem. (Berge 1957) A matching π in a graph πΊ is a maximum matching iff πΊ has no π-augmentation path. Proof. Maximum => no π-augmentation. As if πΊ would have π-augmentation path, π could not be maximum. For no π-augmentation => maximum, suppose that π is not maximum. We construct an π-augmentation. Consider a matching π′, |π′| > |π|, and Let πΉ be the spanning subgraph of πΊ with πΈ(πΉ) = πΔπ′. π and π′ are matchings so a vertex of πΉ has degree 2 at most. πΉ has therefore only disjoint paths and cycles, and cycles must be of even lengths. (why?) March 2014 Graph Matching 5 Since |π′| > |π| there is an edge alternating path with more edges of π′ than π, and consequently there is an π-augmentation in πΊ. β Hall’s Matching Conditions π applicants apply for π jobs, |π| β« |π|. Each applicant applies for a few jobs. Can all the jobs be assigned? π π Denote π(π) the neighbors in π of π ⊂ π. |π(π)| ≥ |π| is clearly necessary for a matching saturating π. March 2014 Graph Matching 6 Theorem. (Hall 1935) If πΊ[π, π] is bipartite then πΊ has a bipartition matching saturating π iff |π(π)| ≥ |π| for all π ⊆ π. Proof. Sufficiency. Let π be maximum and for each π ⊆ π , there is |π(π)| ≥ |π|. Let π be not saturated. There exists therefore π’ ∈ π, not π-saturated. We will find π contradicting the theorem’s hypothesis. π π π’ π π = π(π) March 2014 Graph Matching 7 Let π ⊂ π and π ⊂ π be reachable from π’ by π΄alternating paths. We claim that π matches π with π − π’. The paths reach π by edges not in M and π by π’s edges. Since π is maximum, there is no π augmentation paths, so every vertex of π is π saturated. Every π¦ ∈ π extends via π to a vertex in π. Also, π − π’ is reached by π from π, thus |π| = |π − π’| = |π| − 1. March 2014 Graph Matching 8 The matching between π and π − π’ implies π ⊆ π π . In fact, π = π π . If there was an edge from π to a vertex π¦ ∈ π − π, it could not be in π, yielding an alternating path to π¦, contradicting π¦ ∉ π. Therefore, |π(π)| = |π| = |π| − 1 < |π|, which is a contradiction of the theorem’s hypothesis. β March 2014 Graph Matching 9 For |π| = |π|, Hall’s Theorem is the Marriage Theorem, proved originally by Frobenius in 1917, for a set of π men and π women. If also every man is compatible (mutual preference) with π women and vice versa, there exists a perfect matching of compatible pairs (perfect matrimonial ο). Corollary. Every π-regular bipartite graph (π > 0) has a perfect matching. Proof. Let π,π be the bipartition. Counting edges from π to π and from π to π yields π|π| = π|π| => |π| = |π|. March 2014 Graph Matching 10 Showing that Hall’s Theorem conditions are satisfied is sufficient, as a matching saturating π ( π ) will be perfect. Consider an arbitrary π ⊆ π. The number π of edges connecting π to π is π = π|π| and those π edges are incident to π(π). The total number of edges incident to π(π) is π|π(π)|. There is therefore π ≤ π|π(π)|. We thus obtained π|π| = π ≤ π|π(π)| , satisfying Hall’s Theorem sufficient condition |π| ≤ |π(π)|. β March 2014 Graph Matching 11 Min-Max Dual Theorems Can something be said on whether a matching is maximum when a complete matching does not exist? Exploring all alternating paths to find whether or not there is an π-augmentation is hopeless. We rather consider a dual problem that answers it efficiently. Definition. A vertex cover of πΊ is a set π of vertices containing at least one vertex of all πΊ’s edges. We say that π’s vertices cover πΊ’s edges. March 2014 Graph Matching 12 No two edges in a matching are covered by a single vertex. The size of a cover is therefore bounded below by the maximum matching size. Exhibiting a cover and a matching of the same size will prove that both are optimal. Each bipartite graph possesses such min-max equality, but general graphs not necessarily. maximum matching=2 minimum cover=2,3 March 2014 Graph Matching 13 Theorem. (KΣ§nig 1931, Egerváry 1931) If πΊ[π, π] is bipartite, the sizes of maximum matching and minimum vertex cover are equal. Proof. Let π be a πΊ ’s vertex cover, and π a πΊ ’s matching. There is always |π| ≥ |π|. Let π be a minimum cover. We subsequently construct a matching π from π such that |π| = |π|. Let π = π ∩ π and π = π ∩ π. Two bipartite subgraphs π» and π»′ are induced by π ∪ (π − π) and π ∪ (π − π ), respectively. March 2014 Graph Matching 14 If we construct a complete matching in π» of π into π − π and a complete matching in π»′ of π into π − π , their union will be a matching in πΊ of size |π|, proving the theorem. It is impossible to have an edge connecting π − π with π − π. Otherwise, π would not be a cover. Hence the matchings in π» and π»′ are disjoint. π π π π» π»’ π March 2014 π Graph Matching 15 Showing that Hall’s Theorem conditions are satisfied by π» and π»’ will ensure that matchings saturating π and π exist. Let π ⊆ π and consider ππ» π ⊆ π − π . If |ππ»(π)| < |π| we could replace π by ππ»(π) in π and obtain a smaller vertex cover, contradicting π being minimum. Therefore |ππ»(π)| ≥ |π| and Hall’s Theorem conditions hold in π». π» has therefore a complete matching of π into π − π. Same arguments hold for π»’. β March 2014 Graph Matching 16 Independent Sets in Bipartite Graphs Definition. The independence number πΌ(πΊ) of a graph πΊ is the maximum size of an independent vertex set. πΌ(πΊ) of a bipartite graph does not always equal the size of a partite set. Definition. An edge cover is an edge set covering πΊ’s vertices. Notation πΌ(πΊ): maximum size of independent set. πΌ′(πΊ): maximum size of matching. π½(πΊ): minimum size of vertex cover. π½′(πΊ): minimum size of edge cover. March 2014 Graph Matching 17 In this notation the KΣ§nig-Egerváry Theorem states that for every bipartite graph πΊ, πΌ′(πΊ) = π½(πΊ). Since there are no edges between the vertices of an independent set, the edge cover of the graph cannot be smaller, and therefore πΌ(πΊ) ≤ π½′(πΊ). We will also prove that for every bipartite graph πΊ (without isolated vertices) πΌ(πΊ) = π½′(πΊ). Lemma. π ⊆ π πΊ is an independent set iff π is a vertex cover, and hence πΌ(πΊ) + π½(πΊ) = π(πΊ) (π(πΊ): = |π|). March 2014 Graph Matching 18 Proof. π independence => there are no edges within π, so π must cover all the edges. Conversely, π covers all the edges => no edges connecting two vertices of π. β Theorem. (Gallai 1959) If πΊ has no isolated vertices, then πΌ′(πΊ) + π½′(πΊ) = π(πΊ). Proof. Let π be a maximum matching (πΌ′(πΊ): = |π|). We can use it to construct an edge cover of πΊ by adding an edge incident to each of the π(πΊ) − 2|π| unsaturated vertices, yielding edge cover of size π + π πΊ − 2 π = π πΊ − π = π πΊ − πΌ′(πΊ). The smallest edge cover π½′(πΊ) is a lower bound. Therefore, π(πΊ) − πΌ′(πΊ) ≥ π½′(πΊ). March 2014 Graph Matching 19 Conversely, let πΏ be a minimum edge cover (π½′(πΊ): = |πΏ|). πΏ cannot contain cycles, nor paths of more than two edges. (why?) πΏ is therefore a collection of π isolated star subgraphs. There are π vertices at star centers, anyway covered by the π(πΊ) − π peripheral. Thus |πΏ| = π(πΊ) − π. The π isolated star subgraphs yield a π-size matching by arbitrarily choosing one edge per star. A maximum matching cannot be smaller than π, thus πΌ ′ πΊ ≥ π = π(πΊ) − π½′(πΊ). All in all, π(πΊ) = πΌ′(πΊ) + π½′(πΊ). β March 2014 Graph Matching 20 Corollary. (KΣ§nig 1916) If πΊ is bipartite with no isolated vertices, πΌ(πΊ) = π½′(πΊ). (|maximum independent set| =|minimum edge cover|. Proof. By the last lemma there is πΌ(πΊ) + π½(πΊ) = π(πΊ). By Gallai Theorem there is π(πΊ) = πΌ′(πΊ) + π½′(πΊ). From KΣ§nig-Egerváry Theorem πΌ′(πΊ) = π½(πΊ) (|maximum matching|=|minimum vertex cover|), and πΌ(πΊ) = π½′(πΊ) follows. β March 2014 Graph Matching 21 Maximum Matching Algorithm Augmentation-path characterization of matching inspires an algorithm to find it. maximum A matching is enlarged step-by-step, one edge at a time, by discovering an augmentation path. If an augmentation path is not found, there will be a vertex cover of same size as the current matching. KΣ§nig-Egerváry Min-Max Theorem ensures that the matching is maximum. An iteration looks at π-unsaturated vertices only at one partite since an augmented path must have its two ends on distinct partite. March 2014 Graph Matching 22 We search for all π-unsaturated vertices. Starting at an unsaturated vertex π₯, a tree of π-alternating paths rooted at π₯ is implied. Starting with zero matching, πΌ′(πΊ) applications of the Augmentation Path Algorithm produce a maximum matching. x1 π⊂π x2 x3 x4 x5 x6 x1 x2 π = xπ 3 x4 x5 x6 y2 y3 y4 y5 y6 y1 y2 y3 y4 y5 y6 π y1 March 2014 Graph Matching 23 π π x1 v x2 v x3 v x4 x5 x6 y1 y2 y3 y4 y5 y6 π π x1 v x2 v x3 v x4 v x5 x6 y1 y2 y3 y4 y5 y6 No more unmarked in π. Matching is maximum |π| = 5. x1 v x2 v x3 v x4 v x5 x6 π−π |π ∪ (π − π)| = 5 minimum cover π y1 March 2014 y2 y3 y4 y5 y6 Graph Matching 24 Algorithm (an iteration finding π-augmentation path). Input: πΊ[π, π], matching π in πΊ, all π-unsaturated vertices π ⊂ π. Initialization: π = π, π = ∅. Iteration: If all π is marked stop: π is a maximum matching and π ∪ (π − π) is a minimum cover. Otherwise, select unmarked π₯ ∈ π. Consider each π¦ ∈ π π such that π₯π¦ ∉ π. If π¦ is unsaturated an πugmentation path from π to π¦ exists. Augment π. Otherwise, π¦ is matched by π with some π€ ∈ π. In that case add π¦ to π and π€ to π. March 2014 Graph Matching 25 After exploring all edges incident to π₯, mark π₯ and iterate. β Theorem. Repeated application of the Augmenting Path Algorithm to a bipartite graph produces matching and a cover of the same size. Proof. Consider the vertex set π ∪ (π − π) upon termination. An π-alternating path from π (uncovered) enters π only via π’s edges, hence there is a matching between π − π and π. An π-alternating paths traverses from π₯ ∈ π to along any π-unsaturated edge, thus π π₯ ⊂ π. March 2014 Graph Matching 26 Since the algorithm marks all π₯ ∈ π before termination, there could not be an edge connecting π to π − π (otherwise, augmentation occurs). π = π ∪ (π − π) is therefore a vertex cover. Upon termination π is saturated by π (otherwise πaugmentation occurs), hence π¦ ∈ π is π-matched to π. Since π ⊆ π contained all the π-unsaturated vertices, π − π is π-saturated, but with edges not involved in π. π therefore involves at least π + π − π edges. Hence π ≥ π + π − π = π . Since matching size is bounded above by covering size, equality and optimality follow. β March 2014 Graph Matching 27 Weighted Bipartite Matching Maximum matching in bipartite graphs generalizes to nonnegative weighted graphs. Missing edges are zero weighted, so πΊ = πΎπ,π is assumed. Example. A farming company has π farms π = π₯1 , … , π₯π and π plants π = π¦1 , … , π¦π . The profit of processing π₯π in π¦π is π€ππ ≥ 0. Farms and plants should 1:1 matched. The government will pay the company π’π to stop farm π production and π£π to stop plant π manufacturing. If π’π + π£π < π€ππ the company will not take the offer and π₯π and π¦π will continue working. March 2014 Graph Matching 28 What should the government offer to completely stop the farms and plants ? It must offer π’π + π£π ≥ π€ππ for all π, π. The government also wishes to minimize π’π + π£π . Definitions. Given an π × π matrix π΄, a transversal is a selection of π entries, one for each row and one for each column. Finding a transversal of π΄ with maximum weight sum is called the assignment problem, a matrix formulation of the maximum weighted matching problem, where we seek a perfect matching π maximizing π€(π). March 2014 Graph Matching 29 The labels π’ = π’π and π£ = π£π cover the weights π€ = π€ππ if π’π + π£π ≥ π€ππ for all π, π. The minimum weighted cover problem is to find a cover π’, π£ minimizing the cost π π’, π£ = π’π + π£π . The maximum weighted matching and the minimum weighted cover problems are dual. They generalize the bipartite maximum matching and minimum cover problem. (how ?) The edges are assigned with weight from {0, 1}, and the cover is restricted to use only integral labels from {0, 1}. Vertices receiving 1 form the cover. March 2014 Graph Matching 30 Lemma. If π is a complete (perfect) matching in a bipartite graph πΊ and π’, π£ is a cover, π π’, π£ ≥ π€ π . Furthermore, π π’, π£ = π€ π iff π consists of edges π₯π π¦π such that π’π + π£π = π€ππ . π is then a maximum weight matching and π’, π£ is a minimum weight cover. Proof. Since the edges of π are disjoint, it follows from the constraints π’π + π£π ≥ π€ππ that summation over all M’s edges yields π π’, π£ ≥ π€ π . If π π’, π£ = π€ π equality π’π + π£π = π€ππ must hold for each of the π summand. Finally, since π€(π) is bounded by π π’, π£ , equality implies that both must be optimal. β March 2014 Graph Matching 31 Weighted Bipartite Matching Algorithm The relation between maximum weighted matching and edge covered by equalities lends itself to an algorithm, named the Hungarian Algorithm. It combines π-augmentation path with cover trimming. Denote by πΊπ’,π£ the subgraph of πΎπ,π spanned by the edges π₯π π¦π satisfying π’π + π£π = π€ππ . The algorithm ensures that if πΊπ’,π£ has a perfect matching (in πΊ), its weight is π’π + π£π and by the lemma both matching and cover are optimal. Otherwise, the algorithm modifies the cover. March 2014 Graph Matching 32 Algorithm. (Kuhn 1955, Munkres 1957) Input: Bipartition πΊ[π, π] and weights of πΎπ,π . Idea: maintain a cover π’, π£, iteratively reducing its cost, until the equality graph πΊπ’,π£ has a perfect matching. Initialization: Define a feasible labeling π’π = max π€ππ , π and π£π = 0. Find a maximum matching π in πΊπ’,π£ (apply path augmentation to πΊπ’,π£ ). Iteration: If π is perfect in πΊ[π, π] stop. π is a maximum weight matching by the lemma. Else, let π ⊂ π be the π-unsaturated in π and π ⊆ π, and π ⊂ π be reached from π by π-alternating paths. March 2014 Graph Matching 33 π π−π π in πΊπ’,π£ π π π π+π Let π = min π’π + π£π − π€ππ | π₯π ∈ π, π¦π ∈ π − π Decrease π’π by π for all π₯π ∈ π and increase π£π by π for all π¦π ∈ π . Derive a new equality graph πΊ′π’,π£ . If it contains an πaugmentation path, replace π by a maximum matching in πΊ′π’,π£ . Iterate anyway. β March 2014 Graph Matching 34 π’ 4 π 8 0 0 8 6 π π£ 0 March 2014 π π 6 1 4 1 6 8 8 π π£ 0 π π 6 6 1 4 1 6 8 π π£ 0 π’ 4 π π’ 4 π 6 1 4 1 6 6 8 0 πΊπ’,π£ 0 Minimum surplus from π to π − π: π = min{8 − 6,6 − 1} = 2 π 0 πΊπ’,π£ 0 Graph Matching 35 π’ 4 π 6 π π£ 0 π’ 4 π 6 1 4 1 6 4 8 2 4 6 1 4 1 6 0 6 8 π π£ 0 πΊ′π’,π£ 2 π 0 π which is a maximum in πΊ′π’,π£ is a perfect matching in πΊ and therefore it is maximum weight matching. To validate, the total edge weight is 16, same as the total cover. March 2014 Graph Matching 36 Theorem. The Hungarian Algorithm finds a maximum weight matching and a minimum cost cover. Proof. The algorithm begins with a cover, each iteration produces a cover, and termination occurs only when the equality graph πΊπ’,π£ has a perfect matching in πΊ. Consider the numbers π’′, π£′, obtained from the cover π’, π£, after decreasing π and increasing π by π. If π₯π ∈ π and π¦π ∈ π, then π’′π + π£′π = π’π + π£π and cover holds. March 2014 Graph Matching 37 If π₯π ∈ π − π and π¦π ∈ π − π, then π’′π + π£′π = π’π + π£π and cover holds. If π₯π ∈ π − π and π¦π ∈ π, then π’′π + π£′π = π’π + π£π + π, hence cover holds. Finally, if π₯π ∈ π and π¦π ∈ π − π, then π’′π + π£′π = π’π + π£π − π. Since π was the smallest surplus from π to π − π, cover holds. March 2014 Graph Matching 38 The termination condition ensures that optimum is achieved. It is required therefore to show that termination occurs after a finite number of iterations. First, π never decreases since πΊπ’,π£ ⊂ πΊ′π’,π£ . If π increases, great. If not, then π increases in πΊ′π’,π£ . That follows from the addition of a new cover-equal edge between π and π − π, traversed in πΊ′π’,π£ by an πalternating path emanating from π (π-unsaturated). β March 2014 Graph Matching 39 Stable Matching Instead of optimizing total weight matching, preferences are optimized. A matching of π men and π women is stable if there is no man-woman pair π₯, π such that π₯ and π prefer each other over their current partners. Otherwise the matching is unstable; π₯ and π will leave their current partners and will switch to each other. Men: π₯, π¦, π§, π¦ π₯: π > π > π > π π¦: π > π > π > π π§: π > π > π > π π€: π > π > π > π Women: π, π, π, π π: π§ > π₯ > π¦ > π€ π: π¦ > π€ > π₯ > π§ π: π€ > π₯ > π¦ > π§ π: π₯ > π¦ > π§ > π€ π₯π, π¦π, π§π, π€π is stable. March 2014 Graph Matching 40 Gale and Shapley proved that a stable matching always exists and can be found by a simple algorithm. Algorithm. (Gale-Shapley Proposal Algorithm). Input: Preference ranking by each of π men and π women. Idea: produce stable matching using proposals while tracking past proposals and rejections. Iteration: Each unmatched man proposes to the highest woman on his list which has not yet rejected him. If each woman receives one proposal stop. a stable matching is obtained. March 2014 Graph Matching 41 Otherwise, at least one woman receives at least two proposals. Every such woman rejects all but the highest on her list, to which she says “maybe”. β Theorem. (Gale-Shapley 1962) The Proposal Algorithm produces stable matching. Proof. The algorithm terminates (with some matching) since at each nonterminal iteration at least one woman rejects a man, reducing the list of π2 potential mates. Observation: the proposals sequence made by a man is non increasing in his preference list, whereas the list of “maybe” said by a woman is non decreasing in her list. March 2014 Graph Matching 42 (Repeated proposals by a man to the same woman and repeated “maybe” answers are possible, until rejected or assigned.) If matching is unstable, there is π₯, π and π¦, π mates, where 1: π₯ prefers π over π and 2: π prefers π₯ over π¦. 1: Since on its preference list π > π, π₯ proposed to π before it proposed to π, a time where π₯ must have already been rejected by π. 2: By the observation, the “maybe” answer sequence made by π is non decreasing in its preferences. Since on π’s list π¦ < π₯, π₯ could never propose to π, hence a contradiction to 1. β March 2014 Graph Matching 43 Question: Which gender is happier using Gale-Shapley Algorithm? (The algorithm is asymmetric.) When the first choice of all men are distinct, they all get their highest possible preference ο, whereas the women are stuck with whomever proposed ο. The precise statement of “the men are happier” is that if we switch the role of men and women, each woman winds up happy and each man winds up unhappy at least as in the original proposal algorithm. (homework) If women propose to men they get π₯π, π¦π, π§π, π€π , which are their first choices. March 2014 Graph Matching 44 Of all stable matching, men are happiest by the maleproposal algorithm whereas women are happiest by the female-proposal algorithm. (homework) Study the case where all men and all women have same preference lists. (homework) The algorithm can be used for assignments of new graduates of medicine schools to hospitals. Who is happier, young doctors or hospitals? Hospitals are happier since they run hospital-proposal. Hospitals started using it on early 50’s to avoid chaos, ten years before Gale-Shapley algorithm was proved. March 2014 Graph Matching 45 Matching in Arbitrary Graphs We establish a lower bound on the uncovered vertices of a maximum matching π in a graph πΊ. Definition. An odd component of a graph is a component of odd order (odd number of vertices). π πΊ is the number of odd components of a graph πΊ. If M is a matching in πΊ and π is the uncovered vertices, each odd component of πΊ must include at least one vertex not covered by π, hence |π| ≥ π πΊ . This inequality can be extended to all induced subgraphs of πΊ. March 2014 Graph Matching 46 Let π ⊂ π πΊ , and let π» be an odd component of πΊ − π. If π» is fully covered by π (all π»’s vertices touched), there must be at least one π£ ∈ π» matching a vertex of π. πΊ odd odd π even π π odd π πΊ−π even At most |π| vertices of πΊ − π can be matched by π with those of π. March 2014 Graph Matching 47 Consider the uncovered vertices π of a matching π in πΊ. At least π πΊ − π − |π| odd components must therefore have a vertex not covered by π, hence |π| ≥ π πΊ − π − |π|, for any π ⊂ π πΊ . πΊ−π πΊ π Does πΊ have a perfect matching ? π πΊ − π = 5, whereas |π| = 3, hence |π| ≥ 2. March 2014 Graph Matching 48 Claim. If it happens that for some matching π and π΅ ⊂ π πΊ there is |π| = π(πΊ − π΅) − |π΅|, then π is a maximum matching. (homework) Such π΅ is called a barrier of πΊ and is a certificate that π is maximum. πΌ π΄ π is maximum since |π| = 2. March 2014 Graph Matching 49 The empty set is trivially a barrier of any graph possessing a perfect matching since |π| = π(πΊ) = 0. Any single vertex is also a barrier of any graph possessing a perfect matching. (why?) The empty set is a barrier of a graph for which a deletion of one vertex results in a subgraph possessing a perfect matching. (why?) The union of barriers of the components of a graph is a barrier of the graph. (homework) Any minimum covering of a bipartite graph is a barrier. (homework) March 2014 Graph Matching 50 Definition: A factor of πΊ is a spanning subgraph of πΊ. Definition: A π-factor is a π-regular (all vertices have degree π) spanning subgraph. A perfect matching is πfactor. Theorem. (Tutte’s 1-Factor Theorem 1947) A graph πΊ has 1-factor iff π(πΊ − π) ≤ |π| for every π ⊆ π(πΊ). Proof (Lovász 1975). (Only if) Let πΊ have 1 -factor (perfect matching) and π ⊆ π(πΊ). 1-factor ⇒ π(πΊ − π) ≤ |π| was shown before. The proof of the opposite direction is more complex. Tutte’s condition is preserved under edge addition, namely, if π(πΊ − π) ≤ |π|, so it is for πΊ ′ = πΊ + π. March 2014 Graph Matching 51 That follows since edge addition may merge two components into one, hence π(πΊ′ − π) ≤ π(πΊ − π) ≤ |π|. Proof plan. We will consider a graph πΊ possessing Tutte’s condition and assume in contrary that it has no 1-factor. We then add an edge π and construct a 1-factor in πΊ′ = πΊ + π, and then construct a 1-factor in πΊ, hence a contradiction. π(πΊ) must be even. That follows by taking π = ∅, so π(πΊ − π) ≤ 0, hence no odd component could exist. March 2014 Graph Matching 52 Let π ⊆ π(πΊ) be such that π£ ∈ π is connected to all πΊ′s vertices and suppose that πΊ − π consists of disjoint cliques. πΊ−π π odd clique even clique πΊ − π vertices are arbitrarily paired up, with the leftover residing in the odd components. Since π πΊ − π ≤ π , the leftover ones matched to any of π. March 2014 Graph Matching 53 π is a clique of its own, hence all its rest vertices (even) are paired up and 1-factor in πΊ exists. We must therefore consider for the contradiction establishment that πΊ − π is not made all of cliques. There must therefore be non-adjacent vertices π₯, π§ ∈ πΊ − π sharing a common vertex π¦ (otherwise π₯, π§ are in a clique, or πΊ − π is an independent set). Since π¦ ∉ π, there is π€ ∈ πΊ − π, non adjacent to π¦. March 2014 Graph Matching 54 Recall that πΊ was chosen to be maximal not having 1factor, such that the addition of any edge will turn it to possess 1-factor. Let π1 and π2 be the 1-factors in πΊ + π₯π§ and πΊ + π¦π€, respectively. By πΊ maximality π₯π§ ∈ π1 and π¦π€ ∈ π2 . It suffices to show that π1 ∪ π2 has 1-factor avoiding π₯π§ and π¦π€, in contradiction with the maximality of πΊ. Consider πΊ with the edges of πΉ = π1 βπ2 . There is π₯π§, π¦π€ ∈ πΉ. Since the degree of any πΊ’s vertex in π1 and π2 is exactly one (perfect matchings), πΉ has only isolated vertices and disjoint even cycles. March 2014 Graph Matching 55 Let πΆ be the cycle in πΉ, π₯π§ ∈ πΆ. If π¦π€ ∉ πΆ, A 1-factor is established by π2 ∩ πΆ ∪ π1 \πΆ , avoiding both π₯π§ and π¦π€. π¦ If both π₯π§, π¦π€ ∈ πΆ, the following cycle occurs. π1 Here is a matching of π πΆ avoiding both π₯π§ and π¦π€ . Outside πΆ either π1 or π2 edges are used, yielding perfect matching in πΊ. β March 2014 π2 π2 π€ π1 π1 π2 π₯ π2 Graph Matching π1 π§ π2 π¦ π€ π1 π2 π₯ π§ π2 56 π2 π1 π¦ π2 π€ π1 π1 π2 π₯ π1 π§ π2 Here is a matching of π πΆ avoiding both π₯π§ and π¦π€. Outside πΆ either π1 or π2 edges can be used, yielding perfect matching in πΊ. β March 2014 Graph Matching 57