290 likes | 454 Views
sender. Maximum flow. receiver. Capacity constraint. Lecture 6: Jan 25. Network transmission. Given a directed graph G A source node s A sink node t Goal: To send as much information from s to t. Flows. An s-t flow is a function f which satisfies: (capacity constraint)
E N D
sender Maximum flow receiver Capacity constraint Lecture 6: Jan 25
Network transmission • Given a directed graph G • A source node s • A sink node t Goal: To send as much information from s to t
Flows • 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)
Value of the flow Maximum flow problem: maximize this value 3 4 G: 9 10 7 6 6 8 10 10 2 0 9 10 9 10 s t 10 9 Value = 19
Flow decomposition • Any flow can be decomposed into at most m flow paths. • The same idea applies to the Chinese postman problem
sender An upper bound receiver
Cuts • 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
Flows ≤ cuts • Let C be a cut and S be the connected component of G-C containing s. Then:
Main result • Value of max s-t flow ≤ capacity of min s-t cut • (Ford Fulkerson 1956) Max flow = Min cut • A polynomial time algorithm
Greedy method? • Find an s-t path where every edge has f(e) < c(e) • Add this path to the flow • Repeat until no such path can be found. • Does it work?
A counterexample Hint: Find an augmenting path
Residual 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
Finding 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: don’t think about flow paths! • Flow conservations • More flow going out from s
Ford-Fulkerson Algorithm • Start from an empty flow f • While there is an s-t path P in G update f along P • Return f
Max-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!
Integrality theorem • If every edge has integer capacity, then there is a flow of integer value.
Complexity • 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)
Speeding up • Capacity scaling (find paths with large capacity) • Find a shortests-t path time • Preflow-push
Applications • of the algorithm • of the min-max theorem • of the integrality theorem
Multi-source multi-sink • A set of sources S = {s1,…,sk} • A set of sinks T = {t1,…,tm} • Maximum flow from S to T
Bipartite matching • Bipartite matching <= Maximum flow
Disjoint paths • Find the maximum number of disjoints-t paths directed edge => directed vertex (vertex splitting) directed vertex => undirected vertex (bidirecting) undirected vertex => undirected edge (line graph)
Minimum Path Cover • Given a directed graph, find a minimum number of paths to cover all vertices Directed graph => Bipartite graph
Matrix Rounding • Round the entries to “keep” the row sums and column sums
League winner • See if your favorite team can still win the leaque
Bonus 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.