Download presentation
Presentation is loading. Please wait.
Published bySilvia York Modified over 9 years ago
1
Assignments and matchings Chapter 12 Presented by Yorai Geffen
2
Overview Definitions Bipartite ( דו צדדי ) cardinality matching problem Bipartite weighted matching problem Stable Marriage Problem Nonbipartite cardinality matching problem Bipartite Matching Algorithm Nonbipartite Matching Algorithm Summary
3
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.
4
Bipartite cardinality matching problem
5
Transformation to max flow problem
6
Solution and time complexity
7
Bipartite weighted matching problem AKA The Assignment Problem
8
Transformation to min cost flow
9
Successive Shortest Path Algorithm
10
Relaxation Algorithm
11
Stable Marriage Problem
12
Stable Marriage Problem cont.
13
Stable Marriage iterative greedy algorithm AKA Propose-and-reject Algorithm
14
Analysis
15
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.
16
Man-optimal proof (1)
17
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.
18
Nonbipartite cardinality matching problem – notations (1)
19
Nonbipartite cardinality matching problem – notations (2)
20
Nonbipartite cardinality matching problem – notations (3)
21
Properties (1)
22
Properties (2)
23
Augmenting Path Theorem
24
Bipartite Matching Algorithm
25
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.
26
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).
27
Example
28
Complexity
29
Search algorithm
30
Correctness of the search method If we find an augmenting path, it exists. If we fail to find, can we conclude one does not?
31
Unique label property
32
Unique label property cont.
33
Nonbipartite network counter example
34
Solution?
35
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.
36
Flowers and Blossoms
37
Properties (1)
38
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.
39
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).
40
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.
41
Contracting a blossom (1)
42
Contracting a blossom (2)
43
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)
44
Algorithm (1)
45
Algorithm (2)
46
Example - Finding
47
Example - expanding
48
Correctness (1)
49
Correctness (2)
50
Correctness (2) cont.
51
Complexity of the Nonbipartite Matching Algorithm
52
Complexity cont.
53
Complexity cont. (2)
54
Complexity cont. (3)
55
Complexity cont. (4)
56
Summary
57
Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.