Example: barber

Lecture 20 Max-Flow Problem and Augmenting Path Algorithm

Lecture 20 Max-Flow Problemand Augmenting path AlgorithmOctober 28, 2009 Lecture 20 Outline Max-Flow Problem Description Some examples Algorithm for solving Max-Flow Problem Augmenting path algorithmOperations Research Methods1 Lecture 20 Max-Flow Problem : Single-Source Single-SinkWe are given a directed capacitated network(V, E, C)connecting a source(origin) node with a sink (destination) setVis the set of nodes in the setEis the set of directed links(i, j)The setCis the set of capacitiescij 0of the links(i, j) Problem is to determine themaximum amount of flowthat can besent from the source node to the sink isMax-Flow Problemfor single-source and single-sinkOperations Research Methods2 Lecture 20 Max-Flow Problem .

Lecture 20 Outline • Max-Flow problem • Description • Some examples • Algorithm for solving max-flow problem • Augmenting path algorithm Operations Research Methods 1

Tags:

  Problem, Flows, Path, Flow problem

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Lecture 20 Max-Flow Problem and Augmenting Path Algorithm

1 Lecture 20 Max-Flow Problemand Augmenting path AlgorithmOctober 28, 2009 Lecture 20 Outline Max-Flow Problem Description Some examples Algorithm for solving Max-Flow Problem Augmenting path algorithmOperations Research Methods1 Lecture 20 Max-Flow Problem : Single-Source Single-SinkWe are given a directed capacitated network(V, E, C)connecting a source(origin) node with a sink (destination) setVis the set of nodes in the setEis the set of directed links(i, j)The setCis the set of capacitiescij 0of the links(i, j) Problem is to determine themaximum amount of flowthat can besent from the source node to the sink isMax-Flow Problemfor single-source and single-sinkOperations Research Methods2 Lecture 20 Max-Flow Problem .

2 Multiple-Sources Multiple-SinksWe are given a directed capacitated network(V, E, C)connecting multiplesource nodes with multiple sink setVis the set of nodes and the setEis the set of directed links(i, j)The setCis the set of capacitiescij 0of the links(i, j) EThe Problem is to determine themaximum amount of flowthat can besent from the source nodes to the sink isMax-Flow Problemfor multiple-sources and multiple-sinksOperations Research Methods3 Lecture 20 Multiple-sources multiple-links Problem can be converted to a single-sourceand single-sink Problem by Introducing a dummy source node that is connected to the originalsource nodes with infinite capacity links Introducing a dummy sink node that is connected with the original sinknodes with infinite capacity linksOperations Research Methods4 Lecture 20 For small scale problems.

3 Another alternative is to introduce a single dummy source node connectedwith all the original source nodes BUT Each outgoing link from the dummy source node to an original sourcenodesgets assigned a capacity that is equal to the total capacity of theoutgoing links fromsSimilarly, if there are multiple sink nodes, we introduce a single dummy sinknode BUT Each incoming link from an original sink nodetto the dummy sinknode gets assigned a capacity that is equal to the total capacity of theincoming links to sinktOperations Research Methods5 Lecture 20 Operations Research Methods6 Lecture 20 Maximum Flow Problem : Mathematical FormulationWe are given a directed capacitated networkG= (V, E, C))with a singlesource and a single sink node.

4 We want to formulate the Max-Flow Problem . For each link(i, j) E, letxijdenote the flow sent on link(i, j), For each link(i, j) E, the flow is bounded from above by the capacitycijof the link:cij xij 0 We have to specify the balance equations All the nodes in the network except for the source and the sink nodeare just transit nodes (inflow=outflow) {`|(`,i) E}x`i {j|(i,j) E}xij= 0for alli6=s, tOperations Research Methods7 Lecture 20 The objective is to maximize the outflow from the source nodes {j|(s,j) E}xsj Alternatively: to maximize the inflow to the sink nodet {`|(`,t) E}x`tMAX-FLOW FORMULATION maximize {j.}

5 (s,j) E}xsjsubject to {`|(`,i) E}x`i {j|(i,j) E}xij= 0for alli6=s, t0 xij cijfor all(i, j) Research Methods8 Lecture 20maximizex12+x13subject tox12 x25 x24= 0balance for node 2x13 x35 x34= 0balance for node 3x24+x34 x46= 0balance for node 4x25+x35 x56= 0balance for node 50 x12 5 0 x13 100 x24 4 0 x25 50 x34 5 0 x35 50 x46 8 0 x56 10 Max-Flow is an LP Problem : we could use a simplex methodOperations Research Methods9 Lecture 20 Max-Flow AlgorithmsFor a given graph:ndenotes the number of nodesmdenotes the number of edgesmax|f|is the maximum amount of flowMethodComplexityDescriptionSimplex Constrained by legal flowFord-Fulkerson algorithmO(mmax|f|)Weights have to be integersEdmonds-Karp algorithmO(nm2)Based on Ford-FulkersonDinitz blocking flow algorithmO(n2m)Builds layered graphsGeneral push-relabel algorithmO(n2m)Uses a preflowFord-Fulkerson Algorithm is also known as Augmenting path algorithmWe will also refer to it as Max-Flow AlgorithmOperations Research Methods10 Lecture 20 Max-Flow AlgorithmThis is an iterative method (operates in stages)

6 At each iteration, the Algorithm is searching for a path from the sourcenode to the sink node along which it can send a positive flow Such a path is referred to asaugmenting path After a flow is sent along an Augmenting path the capacities of the linkson that path are adjusted These adjusted capacities are referred to asresidual capacities Correspondingly, the resulting network is referred to asresidualnetwork The algorithmterminateswhen an Augmenting path cannot be foundOperations Research Methods11 Lecture 20 Example: Augmenting pathSuppose we choose to send the flow along path1 3 5 6 Suppose we choose to send 4 units of flow along this pathThen the residual capacities of links (1,2), (3,5) and (5,6)are 6, 1, and 6 respectivelyA better choice is to send 5 units along this path .

7 In this case, the capacityof the link (3,5) is reached (its residual capacity becomes 0)We say that link (3,5) is saturated (no more flow can be sent)Operations Research Methods12 Lecture 20 The flow on a path that saturates at least one of its links is thecapacityof the pathIn other words, the capacity of a path is the maximum possible amountthat we can send along the pathThe capacityC(p)of the pathpis given byC(p) = min(i,j) puijwhereuijis the capacity of the link(i, j)If the pathpunder consideration is in the residual network then the links(i, j) pare the links in theresidual networkand the capacities areresidual capacitiesOperations Research Methods13 Lecture 20 Residual CapacityThe links that have been used to send a flow get updated to reflect the flowpushEvery such link(i, j)gets a capacity label of the forma/bwhere ais the remaining capacity of the link and bis the total flow sent along that link ais viewed as forward capacity of the link bis viewed as backward capacity of the link (capacity if we choose totraverse the link in the opposite direction) NOTE.

8 A+b=cijThe sum of these numbers is equal to the originalcapacity of the linkOperations Research Methods14 Lecture 20 Link with residual capacitya/bwithb >0can be traversed backward Traveling backward means that we are removing the flow from the linkFor example the link(i, j)with the capacity10/3can be used backwardto send the flow of at most 3 unitsIf we send 2 units backward [along(j, i)], the resulting residual capacity ofthe link is (12,1)Operations Research Methods15 Lecture 20 Example: Algorithm ApplicationWe will usefito indicate the amount of flow sent in iterationiWe will apply the Algorithm that sends the maximum possible amount offlow at each iteration, , the flow equal to the capacity of the path underconsiderationOperations Research Methods16 Lecture 20 Iteration 1 We find a paths 4 3 tthat can carry a positive flow The maximum flow we can send along this path isf1= min{2,1,1}.

9 We sendf1= 1unit of flow along this pathOperations Research Methods17 Lecture 20 We obtain a residual network with updated link capacities resulting frompushing the flow along the pathOperations Research Methods18 Lecture 20 Iteration 2 We find a paths 1 2 tthat can carry a positive flow The maximum flow we can send along this path isf2= min{4,4,3}. We sendf2= 3units of flow along this pathOperations Research Methods19 Lecture 20 We obtain a residual network with updated link capacities resulting frompushing the flow along this pathOperations Research Methods20 Lecture 20 Iteration 3 We find a paths 4 tthat can carry a positive flow The maximum flow we can send along this path isf3= min{1,3}.

10 We sendf3= 1unit of flow along this pathOperations Research Methods21 Lecture 20 We obtain a residual network with updated link capacities resulting frompushing the flow along this pathOperations Research Methods22 Lecture 20 Iteration 4 We find a paths 1 3 4 tthat can carry a positive flow The maximum flow we can send along this path isf4= min{1,2,1,2}. We sendf4= 1unit of flow along this pathOperations Research Methods23 Lecture 20 We obtain a residual network with updated link capacities resulting frompushing the flow along this pathAt this point we are node 2 is disconnected from the rest of the nodes (forward capacity 0on all outgoing links)There are no more Augmenting Research Methods24 Lecture 20 Max-Flow VALUEThe maximum flow is the total flow sent:f1+f2+f3+f4= 1 + 3 + 1 + 1 = Research Methods25


Related search queries