1 / 15

Chapter 6 Maximum Flow Problems

Chapter 6 Maximum Flow Problems. Flows and Cuts Augmenting Path Algorithm. Definitions/Assumptions. Each arc ( i , j ) has an arc capacity u ij . The problem is to find the maximum flow from the source node, s , to the sink node, t . Assumptions: The network is directed

avery
Download Presentation

Chapter 6 Maximum Flow Problems

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 Flow Problems Flows and Cuts Augmenting Path Algorithm

  2. Definitions/Assumptions Each arc (i, j) has an arc capacity uij. The problem is to find the maximum flow from the source node, s, to the sink node, t. Assumptions: The network is directed All capacities are nonnegative integers There is no directed path from s to t composed only of infinite capacity arcs Each arc (i, j) has a corresponding reverse arc (j, i) (could have 0 capacity) There are no parallel arcs

  3. Residual Network (see pp. 44-46) Given a set of flows x = {xij}, the residual network tells what changes are feasible. For each arc (i, j), G(x) contains: A forward arc with residual capacity rij = uij – xij (if > 0) A backward arc with capacity rij = xij (if > 0) The residual capacity of an s-t cut is the sum of the residual capacities of forward arcs in the cut. Facts: The value of any flow is less than or equal to the capacity of any s-t cut in the network. The additional flow that can be sent from s to t is no greater than the residual capacity of any s-t cut.

  4. Generic Augmenting Path Algorithm algorithm augmenting path; begin x := 0; whileG(x) contains a directed path from node s to node t do begin Identify an augmenting path P from node s to node t; augment  units of flow along P and update G(x); end; end;

  5. Augmenting Paths • An augmenting path is a directed path from the source to the sink in the residual network • Its capacity is the minimum (residual) capacity of the arcs it contains • If the network contains an augmenting path, then we can send more units of flow from the source to the sink • An increase of  units on arc (i, j) in the residual network corresponds to, in the original network, increasing xij by  units, or decreasing xji by  units, or increasing xij by a units while decreasing xji by (1-a) units, 0 < a < 1 (i.e., an aug. path may actually subtract flows from some arcs) • Residual capacities do not uniquely determine the flows in the original network. We will use the convention: • if uij  rij, set xij = uij - rij and xji = 0 • otherwise, set xij = 0 and xji = rij - uij

  6. Labeling Algorithm • How to find an augmenting path? • Use the search algorithm (from Chapter 3) to find nodes reachable from the source node in the residual network. If the sink is reachable then a path from the source can be traced backward using predecessor indices. If the search procedure fails to label the sink node as reachable, then it will have identified an s-t cut in the residual network with rij= 0 for each arc (i, j) in the cut. Therefore, xij = uij for each arc in the cut, and the total flow from s to t equals the capacity of this cut.

  7. The Labeling Algorithm (main)

  8. Procedure augment

  9. Max-Flow Min-Cut Theorem Since the labeling algorithm stops when it identifies an s-t cut whose capacity equals the flow from s to t, and since the capacity of any s-t cut is an upper bound on the total value of any feasible flow, it follows that (Max-Flow Min-Cut Theorem) The maximum value of the flow from a source node s to a sink node t in a capacitated network equals the minimum capacity among all s-t cuts. Also, A flow is a maximum flow if and only if the corresponding residual network contains no augmenting path, and If all arc capacities are integer, the maximum flow problem has an integer maximum flow.

  10. 2 1 4 3 Ch. 7: Distance Labels In maximum flow problems, measure the distance of a node from the sink node as the smallest number of arcs on any directed path from this node to the sink. t = 4: d(1) = 3, d(2) = 1, d(3) = 2, d(4) = 0 The shortest augmenting path algorithm identifies the augmenting path in the residual network containing the fewest arcs and runs in O(n2m) time (labeling algorithm is O(nmU), where U is the largest finite arc capacity).

  11. Preflow-Push Algorithm • Augmenting path algorithms can take excessive time by repeatedly sending flows down the same subpaths (see Fig.7.10). Sending a flow along a path takes O(n) time in the worst case. • Note that augmenting path algorithms always maintain a feasible flow (satisfies capacity and flow conservation constraints). • The preflow-push algorithm always obeys capacity constraints but does not satisfy the conservation constraints until it reaches the optimal solution. • A preflow is a set of arc flows in which the total flow into a node may exceed the total flow out of the node; • A push is the simple operation of sending flow down a single arc.

  12. Excesses Given a flow x, the excess of each node i is given by In a preflow, e(i)  0 for each i  s. Node s is the only node with a negative excess (because no arcs are directed into it). Nodes i  t with e(i) > 0 are called active. Active nodes indicate infeasibility; the algorithm moves toward feasibility by trying to push the excess flow to the active node’s neighbors; in particular, to nodes closer to the sink (measured by “distance”). An admissible arc is an arc (i, j) for which d(i) = d(j) + 1.

  13. Preflow-Push Subroutines procedurepreprocess; begin x := 0; compute the exact distance labels d(i); xsj = usj for each arc (s, j)  A(s); d(s) := n; end; procedurepush/relabel(i); begin if the network contains an admissible arc (i, j) then push  = min{e(i), rij} units of flow from i to j else replace d(i) by min{d(j) + 1 : (i, j)  A(i) and rij > 0}; end;

  14. Preflow-Push Algorithm algorithmpreflow-push; begin preprocess; while the network contains an active node do begin select an active node i; push/relabel(i); end; end;

  15. Termination & Complexity The preflow-push algorithm stops when all the excess is collected at the source or the sink, i.e., the current preflow is a feasible flow. The excess at the sink is the maximum flow value. This generic version runs in O(n2m) time. Depending on how the list of active nodes is maintained, variations of it run in O(n3), O(n2m1/2), or O(nm + n2 log U) time, which may be smaller depending on the instance.

More Related