Title: Maximum flow
1Maximum flow
receiver
Capacity constraint
Lecture 6 Jan 25
2Network transmission
- Given a directed graph G
- A source node s
- A sink node t
- Goal To send as much information from s to t
3Flows
- An s-t flow is a function f which satisfies
- (capacity constraint)
- (conservation of flows)
- An s-t flow is a function f which satisfies
- (capacity constraint)
- (conservation of flows (at intermediate
vertices)
4Value of the flow
Maximum flow problem maximize this value
3
4
G
9
10
7
8
6
6
10
10
2
0
9
10
9
s
t
10
10
9
Value 19
5Flow decomposition
- Any flow can be decomposed into at most m flow
paths. - The same idea applies to the Chinese postman
problem
6An upper bound
receiver
7Cuts
- An s-t cut is a set of edges whose removal
disconnect s and t - The capacity of a cut is defined as the sum of
the capacity of the edges in the cut
Minimum s-t cut problem minimize this capacity
of a s-t cut
8Flows cuts
- Let C be a cut and S be the connected component
of G-C containing s. Then
9Main result
- Value of max s-t flow capacity of min s-t cut
- (Ford Fulkerson 1956)
- Max flow Min cut
- A polynomial time algorithm
10Greedy method?
- Find an s-t path where every edge has f(e) lt c(e)
- Add this path to the flow
- Repeat until no such path can be found.
- Does it work?
11A counterexample
Hint Find an augmenting path
12Residual graph
- Key idea allow flows to push back
f(e) 2
Can send 8 units forward or push 2 units back.
c(e) 10
c(e) 8
Advantage of this representation is not to
distinguish send forward or push back (which are
irrelevant)
c(e) 2
13Finding an augmenting path
- Find an s-t path in the residual graph
- Add it to the current flow to obtain a larger
flow. Why?
Key dont think about flow paths!
- Flow conservations
- More flow going out from s
14Ford-Fulkerson Algorithm
- Start from an empty flow f
- While there is an s-t path P in G
update f along P - Return f
15Max-flow min-cut theorem
- Consider the set S of all vertices reachable from
s - So, s is in S, but t is not in S
- No incoming flow coming in S (otherwise push
back) - Achieve full capacity from S to T
Min cut!
16Integrality theorem
- If every edge has integer capacity,
- then there is a flow of integer value.
17Complexity
- Assume edge capacity between 1 to C
- At most nC iterations
- Finding an s-t path can be done in O(m) time
- Total running time O(nmC)
18Speeding up
- Capacity scaling (find paths with large capacity)
- Find a shortest s-t path ? time
- Preflow-push
19Faster Algorithms
20Even Faster Algorithms
21Applications
- of the algorithm
- of the min-max theorem
- of the integrality theorem
22Multi-source multi-sink
- A set of sources S s1,,sk
- A set of sinks T t1,,tm
- Maximum flow from S to T
23Bipartite matching
- Bipartite matching lt Maximum flow
24Disjoint paths
- Find the maximum number of disjoint s-t paths
directed edge gt directed vertex (vertex
splitting)
directed vertex gt undirected vertex (bidirecting)
undirected vertex gt undirected edge (line graph)
25Minimum Path Cover
- Given a directed graph, find a minimum number of
paths to cover all vertices
Directed graph gt Bipartite graph
26Matrix Rounding
- Round the entries to keep the row sums and
column sums
27League winner
- See if your favorite team can still win the leaque
28Bonus Question 3
(25) In a soccer tournament of n teams, every
pair of teams plays one match. The winner gets
3 points, the loser gets 0, while both teams
receive 1 point in a draw. Is there a
polynomial algorithm to decide whether a given
score sequence (a score for each team) can be
the score sequence at the end of a valid
championship?
League winner version is NP-hard.