Professional Documents
Culture Documents
1
11/17/20
Finding a Min-Cut
• Given a graph, how to find the min-cut?
2
11/17/20
Finding a Min-Cut
• Given a graph, how to find the min-cut?
• Use Ford-Fulkerson algorithm to determine the max-flow
• Do BFS / DFS on residual graph to determine the set of reachable nodes.
3
11/17/20
4
11/17/20
Network Connectivity
• Network connectivity. Given a directed graph ! = ($, &) and two
nodes ( and ), find min number of edges whose removal disconnects
) from (.
• Def. A set of edges * ⊆ & disconnects ) from ( if all ( − ) paths use
at least one edge in *.
2 5
s 3 6 t
4 7
s 3 6 t s 3 6 t
4 7 4 7
5
11/17/20
s 3 6 t s 3 6 t
4 7 4 7
Bipartite Matching
• Input: undirected, bipartite graph ! = ($ ∪ &, ().
• + ⊆ ( is a matching if each node appears in at most 1 edge in +.
• Max matching: find a max cardinality matching.
1 1'
matching
L 5 5' R
6
11/17/20
Bipartite Matching
• Max flow formulation.
• Create directed graph !′ = (% ∪ ' ∪ {), +}, -′ ).
• Direct all edges from % to ', and assign unit capacity.
• Add source ), and unit capacity edges from ) to each node in %.
• Add sink +, and unit capacity edges from each node in ' to +.
G' 1 1 1'
1 1
2 2'
s 3 3' t
4 4'
L 5 5' R
Bipartite Matching
• Theorem. Max cardinality matching in ! = value of max flow in !′.
• Pf. =>
• Given max matching ! of cardinality ".
• Consider flow # that sends 1 unit along each of " paths.
• # is a flow, and has cardinality ".
1 1' 1 1 1'
1 1
2 2' 2 2'
3 3' s 3 3' t
4 4' 4 4'
G G'
5 5' 5 5'
7
11/17/20
Bipartite Matching
• Pf. <=
• Let ! be a max flow in G' of value k.
• Integrality theorem Þ " is integral and can assume ! is 0 − 1.
• Consider & = set of edges from ( to ) with !(+) = 1.
• each node in ( and ) participates in at most one edge in &
• |&| = ": consider cut (( ∪ /, ) ∪ 1)
1 1 1' 1 1'
1 1
2 2' 2 2'
s 3 3' t 3 3'
4 4' 4 4'
G' G
5 5' 5 5'