









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










10/22/
A. Smith; based on slides by S. Raskhodnikova and K. Wayne
10/22/
A. Smith; based on slides by S. Raskhodnikova and K. Wayne
Matching. (^) M (^) Input: undirected graph G = (V, E). (^) (^) E is a matching if each node appears in at most edge in M.
Max matching: find a max cardinality matching.
Bipartite matching. (^) Input: undirected, bipartite graph G = (L
M (^) (^) E is a matching if each node appears in at most edge in M.
Max matching: find a max cardinality matching.
(^531)
5' 3' 1'
4 2
4' 2'
matching
1-2', 3-1', 4-5'
Roughly: Problem A reduces to problem B if there is a simple algorithm for A that uses an algorithm for problem B as a subroutine.
Usually:
Useful skill: quickly identifying problems where existing solutions may
Reduction to Max flow. (^) Create digraph G' = (L
(^) {s, t}, E' ).
Direct all edges from L to R, and assign capacity 1.
Add source s, and capacity 1 edges from s to each node in L.
Add sink t, and capacity 1 edges from each node in R to t.
s
(^531)
5' 3' 1'
t
4 2
4' 2'
(^1)
1
1
R
L
G'
Pf.Theorem. Max cardinality matching in G = value of max flow in G'. (^)
Given max matching M of cardinality k.
Consider flow f that sends 1 unit along each of k paths.
f is a flow, and has cardinality k.
s
(^531)
5' 3' 1'
t
4 2
4' 2'
(^1)
1
1
(^531)
5' 3' 1'
4 2
4' 2'
G'
G
Pf.Theorem. Max cardinality matching in G = value of max flow in G'. (^)
Let f be a max flow in G' of value k.
Integrality theorem
(^) k is integral; all capacities are 1
(^) f is 0-1.
(^) and R
(^) participates in at most one edge in M
(^) s, R (^) (^) t)
(^531)
5' 3' 1'
4 2
4' 2'
G
s
(^531)
5' 3' 1'
t
4 2
4' 2'
(^1)
1
1
G'
Def. A matching M
(^) E is perfect if each node appears in exactly one
Structure of bipartite graphs with perfect matchings.Q. When does a bipartite graph have a perfect matching?edge in M. (^) What conditions are sufficient? (^) What other conditions are necessary? (^) Clearly we must have |L| = |R|.
Observation. If a bipartite graph G = (Ladjacent to nodes in S.Notation. Let S be a subset of nodes, and let N(S) be the set of nodes
(^) R, E), has a perfect
matching, then |N(S)|
(^) |S| for all subsets S
Pf. Each node in S has to be matched to a different node in N(S).
N(S) = { 2', 5' }.S = { 2, 4, 5 }No perfect matching:
(^531)
5' 3' 1'
4 2
4' 2'
L
R
Pf. (^) (^) Suppose G does not have a perfect matching.
Formulate as a max flow problem with
(^) constraints on edges from L to
R and let (A, B) be min cut in G'.
By max-flow min-cut, cap(A, B) < |
Choose S = L
cap(A, B) = |
Since min cut can't use
(^) edges: N(S)
|N(S
(^) )| (^) (^) | R (^) A (^) | = cap(A, B) - | L
S = {2, 4, 5}
= {1, 3}
(^) = {2', 5'}
N(S) = {2', 5'}
s
1
3
5
1'
3'
5'
t
2
4
4'
(^1)
2'
1
1 1
A
G'
Which max flow algorithm to use for bipartite matching? (^) Generic augmenting path: O(m val(f*)
(^) ) = O(mn).
Capacity scaling: O(m
(^2) log C ) = O(m
Shortest augmenting path (not covered in class): O(m n
1/ ).
Non-bipartite matching. (^) Blossom algorithm: O(nwell-understood. [Tutte-Berge, Edmonds-Galai] (^) Structure of non-bipartite graphs is more complicated, but
[Edmonds 1965]
Best known: O(m n
1/ ).
[Micali-Vazirani 1980]
Recently: better algorithms for dense graphs, e.g. O(n
) [Harvey]