Matching in bipartite graphs Given: non-weighted bipartite graph not covered node extending alternating path initial matching Algorithm: so-called “extending.

Slides:



Advertisements
Similar presentations
The Primal-Dual Method: Steiner Forest TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A AA A A A AA A A.
Advertisements

Coloring Warm-Up. A graph is 2-colorable iff it has no odd length cycles 1: If G has an odd-length cycle then G is not 2- colorable Proof: Let v 0, …,
Min-Max Relations, Hall’s Theorem, and Matching-Algorithms Graphs & Algorithms Lecture 5 TexPoint fonts used in EMF. Read the TexPoint manual before you.
Graph Theory Arnold Mesa. Basic Concepts n A graph G = (V,E) is defined by a set of vertices and edges v3 v1 v2Vertex (v1) Edge (e1) A Graph with 3 vertices.
Bipartite Matching, Extremal Problems, Matrix Tree Theorem.
Approximation Algorithms for TSP
Optimization of Pearl’s Method of Conditioning and Greedy-Like Approximation Algorithm for the Vertex Feedback Set Problem Authors: Ann Becker and Dan.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
Perfect Graphs Lecture 23: Apr 17. Hard Optimization Problems Independent set Clique Colouring Clique cover Hard to approximate within a factor of coding.
Matchings Matching: A matching in a graph G is a set of non-loop edges with no shared endpoints Maximal Matching: A maximal matching in a graph is a matching.
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.
Shortest Path Algorithm By Weston Vu CS 146. What is Shortest Paths? Shortest Paths is a part of the graph algorithm. It is used to calculate the shortest.
Matching Polytope, Stable Matching Polytope Lecture 8: Feb 2 x1 x2 x3 x1 x2 x3.
Vertex cover problem S  V such that for every {u,v}  E u  S or v  S (or both)
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.
1 Introduction to Approximation Algorithms Lecture 15: Mar 5.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
The Maximum Independent Set Problem Sarah Bleiler DIMACS REU 2005 Advisor: Dr. Vadim Lozin, RUTCOR.
The Shortest Path Problem
Homework solution Problem 2. The number of odd degree vertices in a graph is even. (recom. book: G. Harary: Graph Theory) Solution: Let G=(V,E,w) S= 
Eulerian Graphs CSE 331 Section 2 James Daly. Reminders Project 3 is out Covers graphs Due Friday.
GRAPH Learning Outcomes Students should be able to:
Hon Wai Leong, NUS (CS6234, Spring 2009) Page 1 Copyright © 2009 by Leong Hon Wai CS6234 Lecture 1 -- (14-Jan-09) “Introduction”  Combinatorial Optimization.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Using Dijkstra’s Algorithm to Find a Shortest Path from a to z 1.
Dijkstra’s Algorithm. 2 Shortest-path Suppose we want to find the shortest path from node X to node Y It turns out that, in order to do this, we need.
Lecture 12-2: Introduction to Computer Algorithms beyond Search & Sort.
Analysis of Algorithms Uri Zwick April 2014 Maximum matching 1 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAA.
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
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.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Lecture 16 Maximum Matching. Incremental Method Transform from a feasible solution to another feasible solution to increase (or decrease) the value of.
Approximation Algorithms
CSCI 3160 Design and Analysis of Algorithms Chengyu Lin.
1/24 Introduction to Graphs. 2/24 Graph Definition Graph : consists of vertices and edges. Each edge must start and end at a vertex. Graph G = (V, E)
Projects Network Theory VLSI PSM 1. Network 1. Steiner trees
Lower Bounds in Greedy Model Sashka Davis Advised by Russell Impagliazzo (Slides modified by Jeff) UC San Diego October 6, 2006.
Complete Graphs A complete graph is one where there is an edge between every two nodes A C B G.
Approximation Algorithms for TSP Tsvi Kopelowitz 1.
EMIS 8373: Integer Programming Combinatorial Relaxations and Duals Updated 8 February 2005.
Homework - hints Problem 1. Node weights  Edge weights
Graph Algorithms Maximum Flow - Best algorithms [Adapted from R.Solis-Oba]
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?
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
MCS 312: NP Completeness and Approximation Algorithms Instructor Neelima Gupta
Instructor Neelima Gupta Table of Contents Introduction to Approximation Algorithms Factor 2 approximation algorithm for TSP Factor.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Matchings and Factors Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering,
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
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.
Minimum Spanning Trees
Hamiltonian Cycle and TSP
Graph theory Definitions Trees, cycles, directed graphs.
2-5 Absolute Value Functions and Graphs
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
Chapter 5. Optimal Matchings
Minimum Spanning Trees
Homework solution Problem 2. The number of odd degree vertices in a graph is even. (recom. book: G. Harary: Graph Theory) Solution: Let G=(V,E,w) S=vVdeg(v)
Lecture 16 Maximum Matching
CSE 373: Data Structures and Algorithms
Lecture 19-Problem Solving 4 Incremental Method
GreedyMaxCut a b w c d e 1.
Shortest Path Problems
Problem Solving 4.
Flow Networks and Bipartite Matching
5.4 T-joins and Postman Problems
Lecture 28 Approximation of Set Cover
Presentation transcript:

Matching in bipartite graphs Given: non-weighted bipartite graph not covered node extending alternating path initial matching Algorithm: so-called “extending alternating path”, we start with a not covered node; next step: node from the matching (maybe several edges) in this case: no extending alternating path; result: perfect matching

Vertex Cover Problem In general graphs is NP-hard (best approximation known - 2-approximation) In bipartite graphs  exact algorithm (we can for sure find optimal matching with maximum # of edges) 12 3 minimum cardinality matching M OPT = minimum vertex cover |OPT|  |M| Proof: we need at least 1 vertex in OPT per edge in M

Vertex Cover Problem In bipartite graphs |Maximum matching| = |Minimum vertex cover| Algorithm (also the proof): Pick a node that covers red and blue edge (red=from M, blue=not from M) (except - last case) - such blue edge that has one endpoint not covered by the matching. If such blue edge does not exist, we have perfect matching (from that point on, all nodes are covered by the matching). Every time we have isolated node, we “drop” it

Vertex Cover Problem In case of perfect matching  take one part of the bipartite graph In general graphs - not true Example: minimum cover maximum matching

Homework solutions Problem 1: Translate node weighted graph G= (G,V,w), where w: V  R +, into edge weighted graph G’=(V,E,w’), w: E  R +, then apply Dijkstra on G’. w1 w2 w3 w4 w5 w6 e w(e)= w1+w2 2 w1+w3 2 For any edge e=v i v k  E we define w’(e)=1/2 [w(v i )+w(v k )]. Then length(v 0 v 1...v n -path in G)=length (v 0 v 1...v n -path in G’)+ 1/2 w(v 0 ) + 1/2 w(v n ) (v 0 =source, v n = sink). The minimum weight path in G corresponds to a minimum weight path in G’. v1

Homework solutions Problem 2: For G=(V,E,w) we define a bipartite graph G’= (V+V’,E’,w’) : w(v 2 ) =1 3 3 v1v1 v2v2 v3v v1v1 v2v2 v3v3 v1’v1’v2’v2’v3’v3’ For each v  V define a “copy” v’ and an edge (v,v’), where w(v,v’)=w(v) (corresponds to a loop in v in graph G) Every edge (u,v)  E replace by 2 edges: (u,v’) and (u’,v) with the same weight as (u,v) G’ is bipartite (every edge has 1 end in V, other in V’) Every path from v 1 to v n = even Every path from v 1 to v n ’ (“copy” of v n ) = odd V V’

Homework solutions Problem 3: G=(V,E,w). For each v  V define k “copies” : v 1,v 2,..., v k Then create a directed graph G’=(V’,E’,w’), where V’=V  V 1 ...  V k, v i 1  V 1,.... v j k  V k k k u v For each edge (u,v)  E define edges (u, v 1 ), (u 1, v 2 ), (u 2, v 3 ),... (u (k-1), v k ) with the same edge weight as (u,v). We look at all paths from v 1 (source) to v n (sink) or any copy of v n. All such paths have at most k edges. k  k edges shortest paths