160 likes | 261 Views
CSE 202 Network flow IV. Fan Chung Graham UC San Diego. Flow Network: Oil Through Pipelines. A. D. How much oil can be shipped from S to T ?. 2. 5. 3. 2. 2. T. S. B. 1. 10. 1. 4. 6. C. E. Directed graph G = (V,E) Identified source S and sink T
E N D
CSE 202 Network flow IV Fan Chung Graham UC San Diego
Flow Network: Oil Through Pipelines A D How much oil can be shipped from S to T ? 2 5 3 2 2 T S B 1 10 1 4 6 C E • Directed graph G = (V,E) • Identified sourceS and sinkT • Edge capacitiesce
Max Flow in the Network A D How much oil can be shipped from S to T ? 2/2 4/5 2/3 0/2 T 2/2 S B 0/1 2/10 1/1 5 units of flow – is this the maximum possible? 1/4 1/6 C E • Directed graph G = (V,E) • Identified sourceS and sinkT • Edge capacitiesce • The flow along an edge is ≤capacity. • Conservation of the flow in internal nodes.
Max Flow in the Network A D 2/2 4/5 2/3 0/2 T 2/2 2 units of s-t flow S B 0/1 2/10 1/1 1 unit of s-t flow 1/4 1/6 C E Finding maximum flow • Ford – Fulkerson algorithm Finding augumenting paths in residual graphs or stop with a max-flow, validated by a min-cut. • variations
Max Flow in the Network A D 2/2 4/5 2/3 0/2 T 2/2 2 units of s-t flow S B 0/1 2/10 1/1 1 unit of s-t flow 1/4 1/6 C E Finding maximum flow • Ford – Fulkerson algorithm Finding augumenting paths in residual graphs or stop with a max-flow, validated by a min-cut. • variations
Max Flow in the Network • Two main variations • Circulation with demand • Capacity with lower bound
An application in data mining– survey design • Customers • Products Design individualized survey for each customer i so that: • The survey concerns products he/she purchased. • Survey is not too long, with length • Product j is in y surveys where
An application in data mining– survey design Design individualized survey for each customer i so that: • The survey concerns products he/she purchased. • Survey is not too long, with length • Product j is in y surveys where A D 1 1,5 2,3 T 1 1,5 1 S B E 1,3 2,3 1,4 1 C F
Max Flow in the Network • Two main variations • Circulation with demand • Capacity with lower bound
Max Flow in the Network Circulation with demand For a graph G and demands satisfying want to find • Capacity condition • Demand condition Solve it using max-flow !
Circulation with demand For a graph G and demands satisfying want to find • Capacity condition • Demand condition -3 3 2 2 3 2 G -3 2 4
Circulation with demand For a graph G and demands satisfying want to find • Capacity condition • Demand condition -3 3 2 2 3 T 2 3 2 G S -3 3 4 Solved. 2 4
Capacity with lower bound For a (s,t)-network G satisfying want to find • Capacity condition • Conservation A D 1 1,5 2,3 T 1 1,5 1 S B E 1,3 2,3 1,4 1 C F
Capacity with lower bound A D 1 1,5 2,3 T 1 1,5 1 S B E 1,3 2,3 1,4 1 C F 6 A D -2 1 1 1,5 2,3 1 4 1 1 T 1,5 1 -4 4 1 S B E 1 -1 1 1,3 4 2,3 2 1 1,4 3 1 C F 1 -1 2
Circulation with demand For a graph G and demands satisfying want to find • Capacity condition • Demand condition A D 1 1,5 2,3 T 1 1,5 1 S B E 1,3 2,3 1,4 1 C F