Mat 3770 Network Flows Network Flow Mat 3770 Conservation Max Flow Network Flows flow Cancellation Cut Ford- Fulkerson Residual Spring 2014 Network Augmenting Path Max-flow Min-cut Matching
4.2 Network Flows Mat 3770 Network Flows A directed graph can model a flow network where some material (e.g., widgets, current, . . . ) is produced or enters the Network Flow Conservation network at a source and is consumed at a sink . Max Flow flow Cancellation Production and consumption are at a steady rate , which is the Cut same for both. Ford- Fulkerson Residual Network The flow of the material at any point in the system is the rate Augmenting Path at which the material moves through it. Max-flow Min-cut Matching
Modeling Mat 3770 Network Flow networks can be used to model: Flows liquids through pipe Network Flow Conservation parts through an assembly line Max Flow current through electrical networks flow Cancellation info through communication networks Cut Ford- Fulkerson Each directed edge is a conduit for the material. Residual Network Augmenting Each conduit has a stated capacity given as a maximum rate Path at which the material can flow through the conduit. (e.g., 200 Max-flow Min-cut barrels of oil per hour.) Matching
A Network Flow Example Mat 3770 Edmonton Saskatoon Network 12 Flows v v 1 3 20 Network Flow 16 Vancouver Conservation s t 10 4 9 7 Max Flow flow Winnipeg 13 Cancellation 4 Cut v v 4 2 Ford- 14 Fulkerson Calgary Regina Residual Network A flow network for the Lucky Duck Puck factory, located in Augmenting Path Vancouver, with warehouse in Winnipeg. Max-flow Each edge is labeled with its capacity. Min-cut Matching from: Introduction to Algorithms , by Cormen, Leiserson, & Rivest
Example Details Mat 3770 The Lucky Duck Company has a factory (source s ) in Network Flows Vancouver that manufactures hockey pucks. Network Flow They have a warehouse (sink t ) in Winnipeg that stores them. Conservation Max Flow flow They lease space on trucks from another firm to ship the pucks Cancellation from the factory to the warehouse — with capacity c ( u , v ) Cut crates per day between each pair of cities u and v . Ford- Fulkerson Residual Network Goal : determine p , the largest number of crates Augmenting per day that can be shipped, and then produce this Path Max-flow amount — there’s no sense in producing more pucks Min-cut than they can ship to their warehouse. Matching
Mat 3770 Network Flows The rate at which pucks are shipped along any truck route is a flow . Network Flow Conservation Max Flow Maximum flow determines p , the maximum number of crates flow per day that can be shipped. Cancellation Cut Ford- Fulkerson The pucks leave the factory at the rate of p crates per day, and Residual Network p crates must arrive at the warehouse each day: Augmenting p p s Path t Max-flow Winnipeg Vancouver Min-cut Matching
Mat 3770 Network Flows Shipping time is not a concern, only the flow of p crates/day. Network Flow Conservation Max Flow flow Capacity constraints are given by the restriction that the flow Cancellation f ( u , v ) from city u to city v be at most c ( u , v ) crates per day. Cut Ford- Fulkerson In a steady state , the number of crates entering and the Residual Network number leaving an intermediate city must be equal. Augmenting Path Max-flow Min-cut Matching
Flow Conservation Mat 3770 Network Flows Vertices are conduit junctions . Other than the source and sink , material flows through the vertices without collecting in Network Flow them. Conservation Max Flow flow Cancellation Hence, the rate at which material enters a vertex must equal Cut the rate at which it leaves the vertex. Ford- Fulkerson Residual Network This property is called flow conservation , and is similar in Augmenting concept to Kirchhoff’s Current Law concerning electrical Path Max-flow current. Min-cut Matching
Maximum–flow Mat 3770 Network Flows Network Flow The Maximum–flow problem is the simplest problem Conservation concerning flow networks: Max Flow flow Cancellation What is the greatest rate at which material can Cut Ford- be shipped from source to sink without violating Fulkerson any capacity constraints? Residual Network Augmenting Path Max-flow Min-cut Matching
Assumptions Mat 3770 Network Flows A flow network , G = (V, E), is a directed graph in which each edge (u, v) ∈ E has a non–negative capacity c(u, v) ≥ 0. Network Flow Conservation Max Flow If (u, v) �∈ E, we assume c(u, v) = 0. flow Cancellation Cut ∀ x ∈ E, In( x ) and Out( x ) are the edges into and out of vertex Ford- Fulkerson x . Residual Network Augmenting The integer c( e ) associated with edge e is a capacity or upper Path bound. Max-flow Min-cut Matching
Mat 3770 12/12 Network v v Flows 1 3 15/20 11/16 Network Flow Conservation s 4/9 t 10 1/4 Max Flow 7/7 flow Cancellation 8/13 Cut 4/4 Ford- v v Fulkerson 4 2 11/14 Residual Network Augmenting A flow f with value | f | = 19. Path Only positive net flows (crates shipped) are shown. Max-flow Min-cut If f ( u , v ) > 0, edge ( u , v ) is labeled by f ( u , v ) / c ( u , v ). Matching If f ( u , v ) ≤ 0, edge ( u , v ) is labeled only by its capacity.
Tucker: a–z (Source to Sink) Flow φ Mat 3770 An a–z flow φ in a directed network N is an integer–valued Network Flows function φ defined on each edge e . Network Flow φ ( e ) is the flow in e , together with a source vertex a and a Conservation sink vertex z satisfying the following three conditions: Max Flow flow 1. Capacity Constraint: 0 ≤ φ ( e ) ≤ c( e ) Cancellation We don’t want backflow , nor to exceed any edge’s capacity Cut Ford- 2. φ ( e ) = 0 if e ∈ IN(a) or e ∈ OUT(z) Fulkerson We want the flow to go from source to sink, not vice–versa Residual Network 3. Flow Conservation: Augmenting Path For x � = a or z, � e ∈ IN ( x ) φ ( e ) = � e ∈ OUT ( x ) φ ( e ) Max-flow For every vertex other than the source and sink, the flow into Min-cut and out of that vertex must be equal Matching
Flow Networks A flow in G is a real–valued function f : V × V → ℜ that Mat 3770 Network satisfies the following three properties: Flows 1. Capacity constraint : the flow along an edge cannot exceed Network Flow its capacity: Conservation ∀ u , v , ∈ V , f ( u , v ) ≤ c ( u , v ) Max Flow flow 2. Skew symmetry : the flow from a vertex u to a vertex v is Cancellation Cut the negative of the flow in the reverse direction: Ford- Fulkerson ∀ u , v ∈ V , f ( u , v ) = − f ( v , u ) Residual Network 3. Flow conservation : the net flow of a vertex (other than the Augmenting Path source or sink) is 0: Max-flow Min-cut � ∀ u ∈ V − { s , t } , f ( u , v ) = 0 Matching v ∈ V
Mat 3770 Network The quantity f ( u , v ), which can be positive, negative, or Flows zero, is called the flow from vertex u to vertex v . Network Flow Conservation Max Flow The value of a flow f is defined as: flow | f | = � v ∈ V f ( s , v ) = � v ∈ V f ( v , t ). Cancellation Cut I.e., the total flow out of the source or into the sink . Ford- Fulkerson Residual Network In the maximum–flow problem , we are given a flow Augmenting Path network G with source s and sink t , and we wish to find a Max-flow flow of maximum value from s to t . Min-cut Matching
Mat 3770 Network Flows 1. (By skew symmetry) The flow from a vertex to itself is 0, Network Flow since for all u ∈ V , we have f ( u , u ) = − f ( u , u ) Conservation Max Flow flow Cancellation 2. (By skew symmetry) We can rewrite the flow–conservation Cut property as the total flow into a vertex is 0: Ford- Fulkerson � Residual ∀ v ∈ V − { s , t } , f ( u , v ) = 0 Network u ∈ V Augmenting Path Max-flow Min-cut Matching
Flow In Equals Flow Out Mat 3770 Network 1. The total positive flow entering a vertex v is defined by Flows � f ( u , v ) Network Flow Conservation u ∈ V , f ( u , v ) > 0 Max Flow flow Cancellation 2. The total positive flow leaving a vertex v is defined by Cut Ford- � f ( v , u ) Fulkerson u ∈ V , f ( v , u ) > 0 Residual Network Augmenting Path 3. The positive net flow entering a vertex (other than the source Max-flow Min-cut or sink) must equal the positive net flow leaving the vertex. Matching
Mat 3770 Network There can be no flow between u and v Flows if there is no edge between them. Network Flow If there is no edge between u and v , i.e., ( u , v ) �∈ E and Conservation Max Flow ( v , u ) �∈ E , then: flow Cancellation If there is no edge, then the capacity is zero. Cut And by the Capacity Constraint, the flows must be ≤ 0. Ford- Fulkerson c(u, v) = c(v, u) = 0 ⇒ f(u, v) ≤ 0, f(v, u) ≤ 0 Residual Network Augmenting By skew symmetry, the flow must be zero. Path Max-flow f(u, v) = − f(v, u) ⇒ f(u, v) = f(v, u) = 0 Min-cut Matching
Recommend
More recommend