This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: MaxFlow Problems MaxFlow is a graph problem that seems very specific and narrowly defined. But many seemingly unrelated problems can be converted to maxflow problems. A flow network consists of: A directed graph G = ( V , E ) . Each edge u v E has a capacity c ( u , v ) . (If u v E then c ( u , v ) = .) Two special vertices: the source s and the sink t . For each vertex v V , there is a directed path s t passing through v . Note: The last condition is not essential. It is included here for convenience. c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 2 / 76 MaxFlow: Definitions Flow Function A flow is a real valued function f : V V R that satisfies the following conditions: Capacity Constraint: For all u , v V , f ( u , v ) c ( u , v ) . Skew Symmetry Constraint: For all u , v V , f ( v , u ) = f ( u , v ) . Flow Conservation Constraint: For any u V{ s , t } , v V f ( u , v ) = The flow value of f is defined to be:  f  = v V f ( s , v ) f ( u , v ) is called the net flow from u to v . c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 3 / 76 MaxFlow: Example t v1 v2 v3 v4 11/16 8/13 12/12 15/20 11/14 4/9 7/7 4/4 1/41/10 s In this figure, the notation 11 / 16 means f ( s , v 1 ) = 11 and c ( s , v 1 ) = 16 . The edges with 0 capacity are not shown. Only positive flow values are shown. (Recall that f ( v , u ) = f ( u , v ) by the skew symmetry constraint.) The capacity constraint is satisfied at all edges. The conservation constraint at the vertex v 1 is: f ( v 1 , s ) + f ( v 1 , v 2 ) + f ( v 1 , v 3 ) + f ( v 1 , v 4 ) + f ( v 1 , t ) = 11 + 1 + 12 + + = The flow value is:  f  = 11 + 8 = 19 . c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 4 / 76 MaxFlow: Definition Caution In the example above, suppose that 3 units flow v 2 v 1 , and 2 units flow v 1 v 2 . It can be seen that the flow conservation and the capacity constrains are still satisfied. But are f ( v 2 v 1 ) = 3 and f ( v 2 v 1 ) = 2 ? Then the Skew Symmetry constrains f ( v 1 , v 2 ) = f ( v 2 , v 1 ) would not be satisfied. In the formulation of the maxflow problem, shipping 3 units flow from v 2 to v 1 , and 2 units flow from v 1 to v 2 is equivalent to shipping 1 unit flow from v 2 to v 1 , and nothing from v 1 to v 2 . In other words, the 2 units flow from v 2 to v 1 , then from v 1 back to v 2 are canceled . So we have: f ( v 2 , v 1 ) = 1 and f ( v 1 , v 2 ) = 1 c Xin He (University at Buffalo) CSE 431/531 Algorithm Analysis and Design 5 / 76 MaxFlow: Application G = ( V , E ) represents an oil pipeline system Each edge u v E is an onedirectional pipeline....
View
Full
Document
 Fall '11
 XINHE
 Algorithms

Click to edit the document details