Bipartite Matching, Extremal Problems, Matrix Tree Theorem.

Slides:



Advertisements
Similar presentations
Weighted Matching-Algorithms, Hamiltonian Cycles and TSP
Advertisements

CS 336 March 19, 2012 Tandy Warnow.
Min-Max Relations, Hall’s Theorem, and Matching-Algorithms Graphs & Algorithms Lecture 5 TexPoint fonts used in EMF. Read the TexPoint manual before you.
Bart Jansen 1.  Problem definition  Instance: Connected graph G, positive integer k  Question: Is there a spanning tree for G with at least k leaves?
1 Decomposing Hypergraphs with Hypertrees Raphael Yuster University of Haifa - Oranim.
15.082J & 6.855J & ESD.78J October 14, 2010 Maximum Flows 2.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
1 Maximum flow sender receiver Capacity constraint Lecture 6: Jan 25.
Bart Jansen, Utrecht University. 2  Max Leaf  Instance: Connected graph G, positive integer k  Question: Is there a spanning tree for G with at least.
Introduction to Graph Theory Lecture 11: Eulerian and Hamiltonian Graphs.
Algorithms and Networks
C&O 355 Lecture 20 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Midterm <  70 3.
1 Weighted Bipartite Matching Lecture 4: Jan Weighted Bipartite Matching Given a weighted bipartite graph, find a matching with maximum total weight.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
04/12/2005Tucker, Sec Applied Combinatorics, 4 th Ed. Alan Tucker Section 4.4 Algorithmic Matching Prepared by Joshua Schoenly and Kathleen McNamara.
Totally Unimodular Matrices Lecture 11: Feb 23 Simplex Algorithm Elliposid Algorithm.
What is the next line of the proof? a). Let G be a graph with k vertices. b). Assume the theorem holds for all graphs with k+1 vertices. c). Let G be a.
Matchings Lecture 3: Jan 18. Bipartite matchings revisited Greedy method doesn’t work (add an edge with both endpoints free)
Maximum Bipartite Matching
Increasing graph connectivity from 1 to 2 Guy Kortsarz Joint work with Even and Nutov.
Is the following graph Hamiltonian- connected from vertex v? a). Yes b). No c). I have absolutely no idea v.
Maximum Flows Lecture 4: Jan 19. Network transmission Given a directed graph G A source node s A sink node t Goal: To send as much information from s.
1 Bipartite Matching Lecture 3: Jan Bipartite Matching A graph is bipartite if its vertex set can be partitioned into two subsets A and B so that.
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
3/24/03Tucker, Section 4.31 Tucker, Applied Combinatorics, Sec. 4.3, prepared by Jo E-M Bipartite GraphMatching Some Definitions X-Matching Maximal Matching.
Maximum Bipartite Matching In a graph G, if no M-augmenting path exists, then M is a maximum matching in G. Idea: Iteratively seek augmenting paths to.
Minimal Spanning Trees What is a minimal spanning tree (MST) and how to find one.
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
CSE, IIT KGP Matchings and Factors. CSE, IIT KGP Matchings A matching of size k in a graph G is a set of k pairwise disjoint edges.A matching of size.
C&O 355 Mathematical Programming Fall 2010 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A.
10.4 How to Find a Perfect Matching We have a condition for the existence of a perfect matching in a graph that is necessary and sufficient. Does this.
Approximating Minimum Bounded Degree Spanning Tree (MBDST) Mohit Singh and Lap Chi Lau “Approximating Minimum Bounded DegreeApproximating Minimum Bounded.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Theory of Computing Lecture 13 MAS 714 Hartmut Klauck.
5.2 Trees  A tree is a connected graph without any cycles.
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
3.2 Matchings and Factors: Algorithms and Applications This copyrighted material is taken from Introduction to Graph Theory, 2 nd Ed., by Doug West; and.
Matching Algorithms and Networks. Algorithms and Networks: Matching2 This lecture Matching: problem statement and applications Bipartite matching Matching.
1 “Graph theory” Course for the master degree program “Geographic Information Systems” Yulia Burkatovskaya Department of Computer Engineering Associate.
1 Decomposition into bipartite graphs with minimum degree 1. Raphael Yuster.
5.8 Graph Matching  Example: Set of worker assign to a set of task  Four tasks are to be assigned to four workers.  – Worker 1 is qualified to do tasks.
Matching Lecture 19: Nov 23.
Graph Algorithms Maximum Flow - Best algorithms [Adapted from R.Solis-Oba]
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
Introduction to Graph Theory
1 Assignment #3 is posted: Due Thursday Nov. 15 at the beginning of class. Make sure you are also working on your projects. Come see me if you are unsure.
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
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.
Trees.
Lap Chi Lau we will only use slides 4 to 19
Bipartite Matching Lecture 8: Oct 7.
Topics in Algorithms Lap Chi Lau.
Algorithms and Networks
Lecture 16 Bipartite Matching
Algorithm Design and Analysis
What is the next line of the proof?
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
Chapter 5. Optimal Matchings
Autumn 2016 Lecture 11 Minimum Spanning Trees (Part II)
Problem Solving 4.
Max Flow Min Cut, Bipartite Matching Yin Tat Lee
Systems of distinct representations
Algorithms (2IL15) – Lecture 7
EE5900 Advanced Embedded System For Smart Infrastructure
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Autumn 2019 Lecture 11 Minimum Spanning Trees (Part II)
Presentation transcript:

Bipartite Matching, Extremal Problems, Matrix Tree Theorem.

Today’s Plan Proof of Hall’s theorem Algorithms for bipartite matching Extremal problems Matrix tree theorem

Perfect Matching Does a perfect matching always exist? Of course not. If there are more vertices on one side, then of course it is impossible. N(S) S Let N(S) be the neighbours of vertices in S. If |N(S)| < |S|, then it is impossible to have a perfect matching.

A Necessary and Sufficient Condition Is it the only situation when a bipartite graph does not have a perfect matching? Hall’s Theorem: A bipartite graph G=(V,W;E) has a perfect matching if and only if |N(S)| >= |S| for every subset S of V and W. This is a deep theorem. It tells you exactly when a bipartite graph does not have a perfect matching. (Now you can convince the king.)

Proof of Hall’s Theorem (easy direction) Hall’s Theorem: A bipartite graph G=(V,W;E) has a perfect matching if and only if |N(S)| >= |S| for every subset S of V. One direction is easy, if there is a perfect matching, then |N(S)| >= |S| for every subset S of V. S N(S) Just consider the neighbours of S in the perfect matching.

Proof of Hall’s Theorem (difficult direction) Hall’s Theorem: A bipartite graph G=(V,W;E) has a perfect matching if and only if |N(S)| >= |S| for every subset S of V. Another direction is more interesting, we need to show whenever |N(S)| >= |S|, then there is a perfect matching! How to prove such kind of statement? Proof by strong induction on the number of edges.

Proof of Hall’s Theorem Hall’s Theorem: If |N(S)| >= |S| for every subset S of V, then there is a perfect matching. Case 1: Every subset S has |N(S)| > |S|. (Easy case) Just delete an edge. By deleting an edge, |N(S)| can decrease by at most 1. Since |N(S)| > |S| before, we still have |N(S)| >= |S| after deleting an edge. Since the graph is smaller (one fewer edge), by induction, there is a perfect matching in this smaller graph, hence there is a perfect matching in the original graph.

Proof of Hall’s Theorem Hall’s Theorem: If |N(S)| >= |S| for every subset S of V, then there is a perfect matching. Case 2: Suppose there is a subset S with |N(S)| = |S|. Divide the graph into two smaller graphs G1 and G2 (so we can apply induction) Find a perfect matching in G1 by induction. G1 Then we are done. G2 S N(S) Find a perfect matching in G2 by induction.

Proof of Hall’s Theorem Why there is a perfect matching in G2? Hall’s Theorem: If |N(S)| >= |S| for every subset S of V, then there is a perfect matching. To apply Hall’s, we want to show for any subset T of S, |N(T) G2| >= |T|. T |N(T) G2| G2 S N(S)

Find a perfect matching in G2 by induction. Proof of Hall’s Theorem Why there is a perfect matching in G2? For any subset T S, N(T) G2 = N(T). By assumption, |N(T) G2| = |N(T)| >= |T|. Therefore, by induction, there is a perfect matching in G2. T |N(T) G2| G2 S N(S) Find a perfect matching in G2 by induction.

Proof of Hall’s Theorem Why there is a perfect matching in G1? For any subset T, we want to show |N(T) G1| >= |T| to apply induction. Consider T, by assumption, |N(T)| >= |T| Can we conclude that |N(T) G1| >= |T|? No, because N(T) may intersect N(S)! Now what? N(T) G1 T S N(S)

Proof of Hall’s Theorem Why there is a perfect matching in G1? For any subset T, we want to show |N(T) G1| >= |T| to apply induction. Consider S T, by assumption, |N(S T)| >= |S T| (the green areas). Since |S|=|N(S)|, |N(S T) – N(S)| >= |S T - S| (the red areas). So |N(T) G1| = |N(S T) – N(S)| > = |S T – S| = |T|, as required. N(T) G1 T |S|=|N(S)| S N(S)

Proof of Hall’s Theorem Hall’s Theorem: If |N(S)| >= |S| for every subset S of V, then there is a perfect matching. Case 2: Suppose there is a subset S with |N(S)| = |S|. Divide the graph into two smaller graphs G1 and G2 (so we can apply induction) Find a perfect matching in G1 by induction. G1 Now we are done. G2 S N(S) Find a perfect matching in G2 by induction.

Today’s Plan Proof of Hall’s theorem Algorithms for bipartite matching Extremal problems Matrix tree theorem

First Try Greedy method? (add an edge with both endpoints unmatched)

Key Questions How to tell if a graph does not have a (perfect) matching? How to determine the size of a maximum matching? How to find a maximum matching efficiently?

Existence of Perfect Matching Hall’s Theorem [1935]: A bipartite graph G=(A,B;E) has a matching that “saturates” A if and only if |N(S)| >= |S| for every subset S of A. N(S) S

Bound for Maximum Matching What is a good upper bound on the size of a maximum matching? König [1931]: In a bipartite graph, the size of a maximum matching is equal to the size of a minimum vertex cover. König [1931]: In a bipartite graph, the size of a maximum matching is equal to the size of a minimum vertex cover. Min-max theorem NP and co-NP Implies Hall’s theorem.

Algorithmic Idea? Any idea to find a larger matching?

Augmenting Path Given a matching M, an M-alternating path is a path that alternates between edges in M and edges not in M. An M-alternating path whose endpoints are unmatched by M is an M-augmenting path.

Optimality Condition What if there is no more M-augmenting path? If there is no M-augmenting path, then M is maximum! Prove the contrapositive: A bigger matching  an M-augmenting path Consider Every vertex in has degree at most 2 A component in is an even cycle or a path Since , an M-augmenting path!

Algorithm Key: M is maximum  no M-augmenting path How to find efficiently? How to find efficiently?

Finding M-augmenting paths Orient the edges (edges in M go up, others go down) An M-augmenting path  a directed path between two unmatched vertices

Complexity At most n iterations An augmenting path in time by a DFS or a BFS Total running time

Minimum Vertex Cover Hall’s Theorem [1935]: A bipartite graph G=(A,B;E) has a matching that “saturates” A if and only if |N(S)| >= |S| for every subset S of A. König [1931]: In a bipartite graph, the size of a maximum matching is equal to the size of a minimum vertex cover. Idea: consider why the algorithm got stuck…

Today’s Plan Proof of Hall’s theorem Algorithms for bipartite matching Extremal problems Matrix tree theorem