1 / 40

Chapter 6 Maximum Flows: Basic Ideas

Chapter 6 Maximum Flows: Basic Ideas. 6.1 Introduction. Formulation: Maximize v (6.1a) subject to  {j: (i, j)A} x ij -  {j: (j, i)A} x ji = v, for i = s (6.1b) = 0, for all i N{s, t} = -v, for i = t

jalen
Download Presentation

Chapter 6 Maximum Flows: Basic Ideas

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 6Maximum Flows: Basic Ideas

  2. 6.1 Introduction • Formulation: Maximize v (6.1a) subject to {j: (i, j)A} xij - {j: (j, i)A} xji = v, for i = s (6.1b) = 0, for all i N\{s, t} = -v, for i = t 0  xij  uij for each (i, j)A (6.1c) • Assumptions • Network is directed. • Capacities are nonnegative integers. • No s-t directed path composed of infinite capacity arcs. • Whenever arc (i, j)A, arc (j, i)A. • May use arcs with 0 capacities. Conceptual device. Residual network. • Network does not contain parallel arcs.

  3. 6.2 Applications • Application 6.1 Feasible Flow Problem: Identify a feasible flow x satisfying the constraints {j: (i, j)A} xij - {j: (j, i)A} xji = b(i) for i N, (6.2a) 0  xij  uij for all (i, j)A. (6.2b) • Add a source node s, and a sink node t. For each node i with b(i) > 0, add an arc (s, i) with capacity b(i). For each node i with b(i) < 0, add an arc (i, t) with capacity –b(i). Then solve a maximum flow problem from s to t. If the maximum flow saturates all the source and sink arcs, problem has a feasible solution; otherwise, it is infeasible. • If x is a feasible flow satisfying (6.2a), let xsi = b(i) and xit = -b(i). It is a max flow since it saturates all the source and the sink arcs. If x is a maximum flow in the transformed network that saturates all the source and the sink arcs, this flow in the original network is feasible.

  4. Application 6.2 Problem of Representatives: A town has r residents R1, R2, … , Rr; q clubs C1, C2, … , Cq; and p political parties P1, P2, … , Pp. Each resident is a member of at least one club and can belong to exactly one political party. Each club must nominate one of its members to represent it on the town’s governing council so that the number of council members belonging to the political party Pk is at most uk. Is it possible to find a council that satisfies this “balancing” property? • Ex: r = 7, q = 4, p = 3 max flow with value equal to q = 4 gives a balanced council

  5. R1 • Ex) 1 1 P1 C1 1 R2 1 u1 1 1 1 C2 R3 1 1 u2 1 P2 t s 1 1 1 R4 C3 u3 1 1 R5 1 1 C4 1 P3 1 1 R6 1 1 R7

  6. Application 6.3 Matrix Rounding Problem: Concerned with consistent rounding of the elements, row sums, and column sums of a matrix. (see Application 6.6 for another example of using nonzero lower bound on each arc.) • Ex)

  7. (3, 4) 1 1’ (lij, uij) (6, 7) (17, 18) (7, 8) (16, 17) (9. 10) (10, 11) (12, 13) (2, 3) s t 2 2’ (0, 1) (11, 12) (14, 15) (3, 4) (1, 2) 3 3’ (6, 7)

  8. Application 6.4 Scheduling on Uniform Parallel Machines: Scheduling of a set J of jobs on M uniform parallel machines. Each job jJ has processing requirement pj (number of machine days required), a release date rj (beginning of the day when job j becomes available), and a due date dj  rj + pj (beginning of the day by which the job must be completed). Assume that a machine can work on only one job at a time and that each job can be processed by at most one machine at a time. Preemptions are allowed. • Ex) M = 3 machines. Rank all the release and due dates, rj and dj for all j, in ascending order and determine P  2|J| - 1 mutually disjoint intervals of dates between consecutive milestones. Let Tk, l denote the interval that starts at the beginning of date k and ends at the beginning of date l + 1.

  9. T1,2 1 1 6 1 T3,3 2 3 1 1.5 2 1.25 3 T4,4 1 1 2.1 s t 3 6 2 3.6 T5,6 2 6 4 2 T7,8

  10. 6.3 Flows and Cuts • Residual network residual capacity rij = (uij – xij) + xji, given flow x. residual network G(x) defined using arcs with rij > 0 (xij, uij) rij i j i j 2 2 (5, 5) (3, 4) 5 1 3 (2, 3) 4 4 1 2 1 1 source sink sink (1 (0, 1) (2, 2) 2 3 3 (a) Original network G with flow x (b) Residual network G(x)

  11. s-t cut: Partition of N into S and S. Set of arcs whose endpoints belong to the different subsets S and S. s-t cut: sS and tS. forward arc, backward arc of the cut [S, S]. Let (S, S) denote the set of forward arcs in the cut, and (S, S) denote the set of backward arcs. • Capacity of an s-t cut: u[S, S] = (i, j)(S, S) uij. (upper bound on the maximum amount of flow we can send from the nodes in S to the nodes in S) • Minimum cut: an s-t cut whose capacity is minimum among all s-t cuts. • Residual capacity of an s-t cut: r[S, S] = (i, j)(S, S) rij.

  12. Flow across an s-t cut: Let x be a flow. Adding the constraints (6.1b) for the nodes in S, obtain v = iS [ {j: (i, j)A} xij - {j: (j, i)A} xji ]. Simplifying gives v = (i, j)(S, S) xij - (i, j)(S, S) xij . (6.3) Using xij  uij and xij  0, obtain v  (i, j)(S, S) uij = u[S, S]. (6.4) • Property 6.1. The value of any s-t flow is less than or equal to the capacity of any cut. • Suppose that x is a flow of value v, and x’ is a flow of value v + v for some v  0. From (6.4), v + v  (i, j)(S, S) uij . (6.5) Subtracting (6.3) from (6.5), v  (i, j)(S, S) (uij – xij) + (i, j)(S, S) xij . By Assumption 6.4, rewrite (i, j)(S, S) xij as (i, j)(S, S) xji . v  (i, j)(S, S) (uij – xij + xji ) =  (S, S) rij .

  13. Property 6.2. For any flow x of value v, the additional flow that can be sent from s to v is less than or equal to the residual capacity of any s-t cut.

  14. 6.4 Generic Augmenting Path Algorithm • Idea: Given a feasible flow x, identify an augmenting path P in G(x). Let  = min { rij: (i, j)P} Augment  units of flow along P and update G(x) (Stopping criteria? Optimality?) • Recovering flow values xij from residual capacities rij. rij = (uij – xij) + xji (use +xji if arc (j, i) exists)  xij – xji = uij – rij (1) If uij  rij , set xij = uij – rij , xji = 0. (2) Otherwise, set xij = 0, xji = rij – uij. (or compute directly for xji if (j, i) exists)

  15. 6.5 Labeling Algorithm and Max-Flow Min-Cut Theorem • Algorithmlabeling; begin label node t; while t is labeled do begin unlabel all nodes; set pred(j) := 0 for each jN; label node s and set LIST := {s}; while LIST   or t is unlabeled do begin remove a node i from LIST for each arc (i, j) in the residual network emanating from node i do if rij > 0 and node j is unlabeled then set pred(j) := i, label node j, and add j to LIST; end; if t is labeled thenaugment end; end;

  16. procedureaugment; begin use the predecessor labels to trace back from the sink to the source to obtain an augmenting path P from node s to node t;  := min {rij : (i, j)P}; augment  units of flow along P and update the residual capacities; end;

  17. Correctness of the Labeling Algorithm: If t not labeled, rij = 0 for all (i, j), iS, jS (tS) Furthermore, rij = (uij – xij) + xji , xij  uij and xji  0 rij = 0  xij = uij for (i, j)(S, S) xij = 0 for (i, j)(S, S) substituting in v = (i, j)(S, S) xij - (i, j)(S, S) xij  v = (i, j)(S, S) uij = u[S, S]. By Property 6.1, x is a maximum flow and [S, S] is a minimum cut. • Thm 6.3) (Max-Flow Min-Cut Theorem) maximum s-t flow = minimum s-t cut • Thm 6.4) (Augmenting Path Theorem) x* is a maximum flow  G(x*) contains no augmenting path.

  18. Thm 6.5) (Integrality Theorem) If all arc capacities are integer, the maximum flow problem has an integer maximum value. • Complexity: Each augmentation needs O(m). Capacity of the cut (s, N\{s}) is at most nU, hence the max flow value is bounded by nU. Each augmentation increases the flow value by at least 1.  running time is O(nmU) (The running time can be improved much by a simple modification of the labeling algorithm. Details in Chapter 7.)

  19. Drawbacks of the Labeling Algorithm: • The running time may depend on U actually. May augment s-a-b-t and s-b-a-t alternatively 106 times. • May not terminate if arc capacities are irrational • Lose label information at each iteration • Improvements in Chapter 7. b 106 106 1 t s 106 106 a

  20. 6.6 Combinatorial Implications of Max-Flow Min-Cut Thm • Network Connectivity:  alternative s-t path in case of some arcs (nodes) failure in communication network? How many arc disjoint (node disjoint) s-t paths? • Thm 6.7) (Menger’s Thm) The maximum number of arc disjoint paths from s to t equals the minimum number of arcs whose removal from the network disconnects all paths from s to t. Pf) Set the capacity of each arc as equal to 1 and solve max flow problem. Solution gives arc disjoint paths. Any s-t cut has value |(S, S)| and removal of the cut arcs disconnects s and t. From max-flow min-cut theorem, max number of arc disjoint paths equals the minimum number of cut arcs. 

  21. Thm 6.8) (Menger’s Thm) maximum number of node disjoint s-t paths = minimum number of s-t vertex cut. Pf) Construct G’ using node splitting node i in G → node i’, i’’, and arc (i’, i’’) with capacity 1(except s, t) incoming arcs to node i → incoming arcs to i’ outgoing arcs from node i → outgoing arcs from i’’ (i, j)A → set capacity of original arcs at  Flow of v units in G’ gives v arc disjoint paths and v arc disjoint paths in G’  v node disjoint paths in G Also any finite capacity s-t cut in G’ has only node-splitting arcs Therefore, any s-t cut in G’ with capacity k corresponds to a set of k nodes whose removal from G destroys all paths from node s to node t. By max-flow min-cut theorem, max number of node-disjoint s-t paths in G = minimum number of s-t vertex cut in G.  • For undirected network, can replace each edge by two directed arcs with opposite direction. Then the results still hold for undirected case.

  22. Matchings and Covers: Directed bipartite network G = (N1N2, A) (Also can consider undirected case) Matching: subset A’A such that no two arcs in A’ are incident to the same node (i.e. they do not have any common endpoint). Node cover: subset N’N = N1N2 such that every arc in A is incident to one of the nodes in N’. • (For undirected general graph) For any matching M and any cover C, each edge in M has an end in C and the corresponding nodes in C are all distinct. => |M|  |C| (primal-dual relation)

  23. 1 1’ 1 1’ 2 2 2’ 2’ 3 3’ 3 3’ 4 4’ 4 4’ 5 5’ 5 5’

  24. Thm 6.9. (König-Egerváry Theorem, 1931) In a bipartite network G, the maximum cardinality of any matching equals the minimum cardinality of any node cover of G. Pf) Add a source node s and an arc (s, i) for each iN1. Similarly, add a sink node t and an arc (j, t) for each jN2 (called artificial arcs). Set the capacity of each artificial arc equal to 1 and the capacity of each original arc equal to . Then s-t flow of value v in G’.  matching of size v in G. Next show that any node cover H of G defines an s-t cut of capacity |H| in G’. Given a node cover H, construct a set of arcs Q as follows: For each iH, if iN1, add (s,i) to Q, and if iN2, add (i, t) to Q. Since H is a node cover, any s-t path contains one arc in Q, hence Q is a cut with capacity |H| Conversely, suppose Q is a s-t cut of capacity k in G’. Q consists of artificial arcs only since original arcs have infinite capacity.

  25. (continued) If (s,i)Q or (i, t)Q, we add node i to H. Now each original arc (i, j) defines a path s-i-j-t in G’. Since Q is an s-t cut, either (s, i)Q or (j, t)Q or both. Hence iH or jH or both. Consequently, H is a node cover. By the max-flow min-cut theorem, both values are equal. So maximum cardinality of any matching equals the minimum cardinality of any node cover of G. 

  26. 1 1’ 1 1 3 3’ 4 4’ s t 2 2’ 5 5’

  27. View points as LP: IP formulation of max cardinality matching (undirected) max 1x s.t. Ax  1 A: nodearc incidence matrix x  0 and integer (each constraint has the form i(i) xi  1, where (i) is the set of edges incident to node i.) • Matrix A is called totally unimodular if the determinant of any square submatrix of A is 0 or 1. If A is totally unimodular, a basic feasible solution to the LP is integer valued (Use Cramer’s rule. If rhs is integer valued) If G is bipartite, it can be shown that A is totally unimodular which implies that there exits an integer optimal solution to the LP relaxation of the matching problem. Hence we can solve it as LP instead of IP.

  28. The dual of the LP is: D) min 1y s.t. y’A  1 y  0 Integer version of this problem is to find a minimum node cover of G. Since the transpose of a totally unimodular matrix is totally unimodular, we can solve it as LP too. From strong duality of LP, König-Egerváry Theorem follows.

  29. Related results on graphs G = (V, E) (undirected): • node packing (stable set): set of nodes such that no two nodes in the set is joined by an edge in G. ((G): independence number of G) node cover: set of nodes such that every edge in G is incident to at least one node in the set. (cover the edges by nodes) ((G): covering number) • edge packing (matching) (’(G): edge independence number) edge covering: set of edges such that every node is incident to at least one edge in the set. (cover the nodes by edges) (’(G): edge covering number) • Prop) (G) + (G) = |V| Pf) SV is a node packing  V\S is a node covering. 

  30. Prop) ’(G) + ’(G) = |V| Pf) Let M be a maximum cardinality matching, and let C be a minimum cardinality covering of nodes by edges. Given M, let U be the set of nodes of degree zero relative to M. Thus |U| = |V| - 2|M|. Since we obtain a cover by adding |U| edges to M, we have |C|  |M| + |U| = |M| + |V| - 2|M| = |V| - |M|.  |M| + |C|  |V|. Given C, let M’ be a maximum cardinality matching in (V, C), and let U’ be the set of nodes of degree zero relative to M’ in (V, C). Then |C| = |M’| + |U’| = |M’| + |V| - 2|M’| = |V| - |M’| and |M|  |M’| = |V| - |C|  |M| + |C|  |V|. Hence |M| + |C| = |V|. 

  31. Optimal Closure in a Directed Graph: Situation: If we want to choose project v, then we must choose project w also. We want to choose the set of projects which gives maximum profit • Model as a problem on a directed graph. Use directed arc (v, w) if project w precedes project v. Find the maximum benefit set C  V such that (C) = . (closure of G) • Example: open pit mining problem. Partition the volume to be considered for excavation into small 3-dimensional blocks. Block v produces profit of bv (profit of ore in v – cost of excavating v ) If we need to excavate block w to excavate block v, we include arc (v, w) in G. Want to find a closed set in G (no outgoing arc from the set) which maximizes profit.

  32. Convert to min-cut problem (max-flow problem) Divide the nodes into two sets A and B. vA if bv  0 and v  B if bv < 0. Add a source r and a sink s to the graph and add arcs (r, v) for each v A and arcs (v, s) for each vB. Capacity on the arcs are: u(r, v)= bv for each vA and u(v, s)= - bv for each v B. The upper bounds on the original arcs are infinite. • A set C of nodes is closed if and only if the cut C  {r} has finite capacity. • If the capacity of C  {r} is finite, then it equals Since vAbv is a constant, minimizing the capacity of C  {r} amounts to maximizing vCbv .

  33. (Example) 2 -7  2 C  7 4 r 4 1   -1 3  3 2 3 s  -3  1 2  -1

  34. 6.7 Flows with Lower Bounds • Maximize v subject to {j: (i, j)A} xij - {j: (j, i)A} xji = v, for i = s = 0, for all i N\{s, t} = -v, for i = t lij  xij  uij for each (i, j)A • 2 Stages (1) Find an initial feasible flow or prove that the problem is infeasible. (2) Establish a maximum flow.

  35. (2) Determining a Maximum Flow: Set the residual capacity as rij = (uij – xij) + (xji – lji) Work on the residual capacities as before. • Retrieving actual flows: Use change of variables. For all arcs (i, j), let uij’ = uij – lij, rij’ = rij, and xij’ = xij – lij. The residual capacity of arc (i, j) is rij = (uij – xij) + (xji – lji) = (uij’ – xij’) + xji’ = rij’. Similarly, rji’ = uji’ – xji’ + xij’. We have xij’ = max (uij’ – rij’, 0) (and xji’ = max (rij’ – uij’, 0) if (j, i) exists)  xij = lij + max (uij – rij – lij, 0) xji = lji + max (uji – rji – lji, 0)

  36. Proving that the algorithm is correct: Define the capacity of an s-t cut [S, S] as u[S, S] = (i, j)(S, S) uij - (i, j)(S, S) lij. (6.7) (maximum amount of flow that can be sent out of the node set S.) From (6.3), have v = (i, j)(S, S) xij - (i, j)(S, S) xij . (6.8) Using xij  uij and lij  xij, have v  (i, j)(S, S) uij - (i, j)(S, S) lij = u[S, S]. (6.9) At termination of the algorithm, obtain an s-t cut with rij = 0 for (i, j)(S, S). Since rij = (uij – xij) + (xji – lji)  0, have xij = uij for (i, j)(S, S) and xij = lij for (i, j)(S, S). Substituting in (6.8), v = u[S, S] = (i, j)(S, S) uij - (i, j)(S, S) lij. From (6.9), [S, S] is a min-cut and x is a max-flow.

  37. (1) Establishing a Feasible Flow: Add arc (t, s) with infinite capacity and consider the feasible circulation problem. {j: (i, j)A} xij - {j: (j, i)A} xji = 0, for all i N lij  xij  uij for all (i, j)A • Replace the variables with xij = xij’ + lij, then {j: (i, j)A} xij’ - {j: (j, i)A} xji’ = b(i), for all i N 0  xij’  uij - lij for all (i, j)A ( b(i) = {j: (j, i)A} lji - {j: (i, j)A} lij. Note that iN b(i) = 0) • Feasible flow problem in Application 6.1.

  38. Characterizing a Feasible flow: Necessary and sufficient conditions that a circulation problem has a feasible solution. ( (i, j)(S, S) lij  (i, j)(S, S) uij) (Necessity) Let SN. By summing the mass balance constraints of the nodes in S, we obtain (i, j)(S, S) xij - (i, j)(S, S) xij = 0. Using xij  uij in the first term and xij  lij in the second term, we find that (i, j)(S, S) lij  (i, j)(S, S) uij. (Sufficiency) Use algorithmic proof. Start with a circulation that satisfies the mass balance and capacity constraints, but might violate some of the lower bound constraints. Algorithm either finds a feasible circulation or identifies the set S N that violates the condition. An arc (i, j) is called infeasible if xij < lij, and called feasible if lij  xij. Algorithm selects an infeasible arc (p, q) and try to make it feasible by increasing the flow on this arc. → find q-p flow augmenting path and augment flow.

  39. Initially label q. Starting from a labeled node, for forward arcs, label the head of the arc if xij < uij. For backward arcs, label the tail node if xij > lij. If p labeled, augment flow. If algorithm fails, let S be the set of labeled nodes. Then, for (i, j)(S, S), xij = uij, and for (i, j)(S, S), xij  lij. Arc (p, q) is in (S, S) and xpq < lpq. From the mass balance constraints, we have (i, j)(S, S) xij - (i, j)(S, S) xij = 0. Hence (i, j)(S, S) uij < (i, j)(S, S) lij, which is a contradiction to our assumption. So the augmentation must be successful until there exists no infeasible arc.  • Thm 6.11) (Hoffman’s Circulation Theorem) A circulation problem with nonnegative lower bounds on arc flows is feasible if and only if for every set S of nodes (i, j)(S, S) lij  (i, j)(S, S) uij

  40. Note that the proof of Theorem 6.11 provides a one pass algorithm to solve a circulation problem, starting with the zero flow. • Thm 6.12) The feasibility flow problem stated in (6.2) has a feasible solution if and only if for every subset SN, b(S) –u[S, S]  0, where b(S) = iS b(i).

More Related