Lecture 17: Max Flow à Bipartite Matching
Tim LaRock larock.t@northeastern.edu bit.ly/cs3000syllabus
Lecture 17: Max Flow Bipartite Matching Tim LaRock - - PowerPoint PPT Presentation
Lecture 17: Max Flow Bipartite Matching Tim LaRock larock.t@northeastern.edu bit.ly/cs3000syllabus Business Homework 5 due Tuesday night 11:59 Boston time No class Monday, per President Aouns office Class Tuesday and Wednesday next
Tim LaRock larock.t@northeastern.edu bit.ly/cs3000syllabus
Output y in B(x) for Problem B Input x for Problem B Input u for Problem A Output v in A(u) for Problem A
In the simplest case, we just call SolveA a single time. In fact we may use SolveA as a subroutine to a more complex reduction.
Output y in B(x) for Problem B Input x for Problem B Input u for Problem A Output v in A(u) for Problem A
A = MaxFlow B = MinCut
Input 𝑦 for B: 𝐻 = (𝑊, 𝐹, 𝑡, 𝑢, 𝑑+ ) Input 𝑣 for A: 𝐻 = (𝑊, 𝐹, 𝑡, 𝑢, 𝑑+ ) Output 𝑤 ∈ 𝐵(𝑣): 𝐻 = (𝑊, 𝐹, 𝑡, 𝑢, 𝑑+ ) Output 𝑧 ∈ 𝐶(𝑦): 𝐻 = (𝑊, 𝐹, 𝑡, 𝑢, 𝑑+ )
Models any problem where one type
node 𝑤 is an endpoint of at most one edge in 𝑁 Models any problem where one type
node 𝑤 is an endpoint of at most one edge in 𝑁
Models any problem where one type
Output y in B(x) for Problem B Input x for Problem B Input u for Problem A Output v in A(u) for Problem A
Output y in B(x) for Problem B Input x for Problem B Input u for Problem A Output v in A(u) for Problem A
1 2 3
Input G for MCBM Input G’ for MAXFLOW
Input G for MCBM Input G’ for MAXFLOW
Set all edge capacities to 𝑑 𝑓 = 1
SolveA
Input G’ for MAXFLOW Output f for MAXFLOW
Red arrow means f(e)=1 Black means f(e) = 0
SolveA
Input G’ for MAXFLOW Output f for MAXFLOW
Red arrow means f(e)=1 Black means f(e) = 0 The matching will be all
𝑆 with nonzero flow!
Output M for MCBM Output f for MAXFLOW
Since the capacity on every edge is 1, by conservation of flow we have:
A matching of size 𝑙 immediately implies a valid flow of value 𝑙
A flow of value 𝑙 must have 𝑙 edges carrying flow from 𝑀 to 𝑆
A flow of value 𝑙 must have 𝑙 edges carrying flow from 𝑀 to 𝑆 A matching of size 𝑙 immediately implies a valid flow of value 𝑙
When 𝑙 is the maximum cardinality matching, there must be a flow, and vice versa!
for maximum bipartite matching Solving maximum integer s-t flow in a graph with n+2 nodes and m+n edges and c(e) = 1 in time T Solving maximum bipartite matching in a graph with n nodes and m edges in time T + O(m+n)