Assignments and matchings Chapter 12 Presented by Yorai Geffen.

Slides:



Advertisements
Similar presentations
Min Cost Flow: Polynomial Algorithms. Overview Recap: Min Cost Flow, Residual Network Potential and Reduced Cost Polynomial Algorithms Approach Capacity.
Advertisements

Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 8 Network models.
Algorithms and Networks
Breadth-First Search of Graphs Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms.
 Graph Graph  Types of Graphs Types of Graphs  Data Structures to Store Graphs Data Structures to Store Graphs  Graph Definitions Graph Definitions.
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
Chapter 10: Iterative Improvement The Maximum Flow Problem The Design and Analysis of Algorithms.
1 Maximum Flow w s v u t z 3/33/3 1/91/9 1/11/1 3/33/3 4/74/7 4/64/6 3/53/5 1/11/1 3/53/5 2/22/2 
Lectures on Network Flows
Chapter 7 Maximum Flows: Polynomial Algorithms
Finding a Maximum Matching in Non-Bipartite Graphs Alicia Thilani Singham Goodwin /22/2013.
Chapter 26 of CLSR Bipartite Matching By Dr. M. Sakalli, Sources: Levitin and many other CSE, Marmara Univ. May/2009.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
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,
NetworkModel-1 Network Optimization Models. NetworkModel-2 Network Terminology A network consists of a set of nodes and arcs. The arcs may have some flow.
Data Structures Using C++ 2E
Operations Research Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD4207 University of Palestine.
Lecture 12-2: Introduction to Computer Algorithms beyond Search & Sort.
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.
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.
Advanced Algorithms Piyush Kumar (Lecture 4: MaxFlow MinCut Applications) Welcome to COT5405.
 Rooted tree and binary tree  Theorem 5.19: A full binary tree with t leaves contains i=t-1 internal vertices.
All Pair Shortest Path IOI/ACM ICPC Training June 2004.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Lectures on Greedy Algorithms and Dynamic Programming
Data Structures & Algorithms Graphs
Matching Algorithms and Networks. Algorithms and Networks: Matching2 This lecture Matching: problem statement and applications Bipartite matching Matching.
Chapter 3 Algorithms Complexity Analysis Search and Flow Decomposition Algorithms.
Bipartite Matching. Unweighted Bipartite Matching.
Matching Algorithms and Networks. Algorithms and Networks: Matching2 This lecture Matching: problem statement and applications Bipartite matching Matching.
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.
Graph Algorithms Maximum Flow - Best algorithms [Adapted from R.Solis-Oba]
Network Analysis Maxflow. What is a Network? Directed connected graph Source node Sink (destination node) Arcs are weighted (costs) Represent a system.
Introduction to Graph Theory
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
EMIS 8374 The Ford-Fulkerson Algorithm (aka the labeling algorithm) Updated 4 March 2008.
Prof. Swarat Chaudhuri COMP 382: Reasoning about Algorithms Fall 2015.
Iterative Improvement for Domain-Specific Problems Lecturer: Jing Liu Homepage:
Chapter 10 IterativeImprovement Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Data Structures and Algorithm Analysis Graph Algorithms Lecturer: Jing Liu Homepage:
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Matchings and Factors Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering,
Trees.
IOI/ACM ICPC Training 4 June 2005.
St. Edward’s University
Chapter 10 Iterative Improvement
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Algorithms and Networks
Lecture 16 Bipartite Matching
Maximum Flow - Best algorithms
Algorithm Design and Analysis
Lectures on Network Flows
Chapter 5. Optimal Matchings
Various Graph Algorithms
James B. Orlin Presented by Tal Kaminker
Instructor: Shengyu Zhang
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Analysis of Algorithms
3.5 Minimum Cuts in Undirected Graphs
Lecture 19-Problem Solving 4 Incremental Method
R. Johnsonbaugh Discrete Mathematics 5th edition, 2001
Problem Solving 4.
Algorithms (2IL15) – Lecture 7
and 6.855J March 6, 2003 Maximum Flows 2
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Text Book: Introduction to algorithms By C L R S
The Ford-Fulkerson Algorithm
Presentation transcript:

Assignments and matchings Chapter 12 Presented by Yorai Geffen

Overview Definitions Bipartite ( דו צדדי ) cardinality matching problem Bipartite weighted matching problem Stable Marriage Problem Nonbipartite cardinality matching problem Bipartite Matching Algorithm Nonbipartite Matching Algorithm Summary

Definitions Matching: Subgraph with the property that every node in the subgraph has degree zero or one. Simple Network: Every node in the network, except the source (s) and sink (t) nodes, has at most one incoming arc or at most one outgoing arc.

Bipartite cardinality matching problem

Transformation to max flow problem

Solution and time complexity

Bipartite weighted matching problem AKA The Assignment Problem

Transformation to min cost flow

Successive Shortest Path Algorithm

Relaxation Algorithm

Stable Marriage Problem

Stable Marriage Problem cont.

Stable Marriage iterative greedy algorithm AKA Propose-and-reject Algorithm

Analysis

Comments There could be several stable matchings. A pair (i,j) is stable partners if some stable match matches man i with woman j. Algorithms property: Each man obtains his best possible stable partner. We refer to such a matching as man-optimal.

Man-optimal proof (1)

Man-optimal proof (2) Lemma: The propose-and-reject algorithm constructs a man-optimal stable matching. Proof: – Immediate after the previous lemma: – The preferred stable-partner of a man will not reject him, as by previous lemma.

Nonbipartite cardinality matching problem – notations (1)

Nonbipartite cardinality matching problem – notations (2)

Nonbipartite cardinality matching problem – notations (3)

Properties (1)

Properties (2)

Augmenting Path Theorem

Bipartite Matching Algorithm

Finding an augmenting path from node p Search algorithm to identify all reachable nodes by alternating paths from p. If it finds an unmatched node reachable from p, we found the path. Else it does not exist. Complicated: Straight forward solves it for bipartite case, but it fails for the nonbipartite case.

The straightforward approach Search tree from p to others via alternating path. p – the root node (remember: p is unmatched) The search tree – an alternating tree. Nodes in the alternating tree – labeled, else unlabeled. Each labeled node is even or odd depending on the unique path from p. If odd and unmatched – it is an augmenting path. LIST of labeled nodes, examined one by one. Assign label to its adjacencies (if unlabeled).

Example

Complexity

Search algorithm

Correctness of the search method If we find an augmenting path, it exists. If we fail to find, can we conclude one does not?

Unique label property

Unique label property cont.

Nonbipartite network counter example

Solution?

Difficulty By assigning just one label to each node, we might overlook an augmenting path. By assigning two labels, we might falsely believe that we have found an augmenting path. Why? What is the cause? – Certain subgraphs called flowers, composed of particular types of paths and odd cycles.

Flowers and Blossoms

Properties (1)

Properties (2) Every node i in the blossom (except its base) is reachable from the root p (or from the base of the blossom w) through two distinct alternating paths; one has even length and the other has odd length.

Even nodes in blossom In a blossom – each node can receive both even and odd labels. We would prefer to give even labels to the nodes for the following reason: – Even-labeled nodes - we can label nodes outside the blossom (all unmatched arcs incident to nodes in the blossom). – Odd-labeled nodes - we label only the nodes in the blossom (matched arcs).

Intuition If we assign all nodes in a blossom with even, the search algorithm will find an augmenting path. – All nodes in blossom are matched, except its base. Can be reached with either an even or odd path. – If stem is not empty – the base is matched too.

Contracting a blossom (1)

Contracting a blossom (2)

Nonbipartite Matching Algorithm Search procedure assigns even or odd labels. Algorithm will identify the possibility to assign even\odd to an odd\even respectively. – When discovering we can assign different label than what node i already has, we suspend the search. Trace back the indices of these paths until the first common node. That node is the base, and the nodes traced are the blossom. – Then we contract it to a pseudonode. If we find a path containing a pseudonodes, we expand them one by one until none are in the path (pseudonode can contain other pseudonodes)

Algorithm (1)

Algorithm (2)

Example - Finding

Example - expanding

Correctness (1)

Correctness (2)

Correctness (2) cont.

Complexity of the Nonbipartite Matching Algorithm

Complexity cont.

Complexity cont. (2)

Complexity cont. (3)

Complexity cont. (4)

Summary

Questions?