Network Flows – Multiple sources and sinks

Slides:



Advertisements
Similar presentations
Max Flow Min Cut. Theorem The maximum value of an st-flow in a digraph equals the minimum capacity of an st-cut. Theorem If every arc has integer capacity,
Advertisements

Max Flow Problem Given network N=(V,A), two nodes s,t of V, and capacities on the arcs: uij is the capacity on arc (i,j). Find non-negative flow fij for.
3/17/2003Tucker, Applied Combinatorics Section 4.2a 1 Network Flows Michael Duquette & Whitney Sherman Tucker, Applied Combinatorics, Section 4.2a, Group.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 8 Network models.
1 Augmenting Path Algorithm s t G: Flow value = 0 0 flow capacity.
Applications of Maximum Flow and Minimum Cut Problems In this handout Transshipment problem Assignment Problem.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Section 4.2 Network Flows By Christina Touhey. The flow out of a equals the flow into z. Algorithm 1.Make vertex a: (0, ). 2.Scan the first vertex and.
1 Augmenting Path Algorithm s t G: Flow value = 0 0 flow capacity.
3 t s the black numbers next to an arc is its capacity.
Yangjun Chen 1 Network Flow What is a network? Flow network and flows Ford-Fulkerson method - Residual networks - Augmenting paths - Cuts of flow networks.
A network is shown, with a flow f. v u 6,2 2,2 4,1 5,3 2,1 3,2 5,1 4,1 3,3 Is f a maximum flow? (a) Yes (b) No (c) I have absolutely no idea a b c d.
A B C D The diagram below shows water flowing through a pipework system. The values on the edges are the capacities of water that they.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Here is an example that involves what is called ‘back flow’ 0 A C B D S T Arrows have already been drawn initially.
NetworkModel-1 Network Optimization Models. NetworkModel-2 Network Terminology A network consists of a set of nodes and arcs. The arcs may have some flow.
Flow Networks Formalization Basic Results Ford-Fulkerson Edmunds-Karp Bipartite Matching Min-cut.
Network Flow How to solve maximal flow and minimal cut problems.
Yangjun Chen 1 Network Flow What is a network? Flow network and flows Ford-Fulkerson method - Residual networks - Augmenting paths - Cuts of flow networks.
Network Flow. Network flow formulation A network G = (V, E). Capacity c(u, v)  0 for edge (u, v). Assume c(u, v) = 0 if (u, v)  E. Source s and sink.
Maximum Flow. p2. Maximum Flow A flow network G=(V, E) is a DIRECTED graph where each has a nonnegative capacity u.
Max Flow – Min Cut Problem. Directed Graph Applications Shortest Path Problem (Shortest path from one point to another) Max Flow problems (Maximum material.
The diagram below shows water flowing through a pipework system. The values on the edges are the capacities of water that they can carry.
& 6.855J & ESD.78J Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.
The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem Thanks to Jim Orlin & MIT OCW.
Network Analysis Maxflow. What is a Network? Directed connected graph Source node Sink (destination node) Arcs are weighted (costs) Represent a system.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
A directed graph G consists of a set V of vertices and a set E of arcs where each arc in E is associated with an ordered pair of vertices from V. V={0,
ENGM 631 Maximum Flow Solutions. Maximum Flow Models (Flow, Capacity) (0,3) (2,2) (5,7) (0,8) (3,6) (6,8) (3,3) (4,4) (4,10)
Network Flow What is a network? Flow network and flows
Maximum Flow Chapter 26.
Maximum Flow Chapter 26.
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Algorithms and Networks Hans Bodlaender
CSCI 3160 Design and Analysis of Algorithms Tutorial 8
Maximum Flow Solutions
Algorithms and Networks
Network Flows – Labelling procedure
Network Flows – Back flow
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Lecture 19-Problem Solving 4 Incremental Method
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 23 Network Flow
R. Johnsonbaugh Discrete Mathematics 5th edition, 2001
Vertex Covers, Matchings, and Independent Sets
Richard Anderson Lecture 21 Network Flow
Not Always Feasible 2 (3,5) 1 s (0,2) 3 (, u) t.
Problem Solving 4.
Augmenting Path Algorithm
Flow Networks General Characteristics Applications
Max Flow Problem Given network N=(V,A), two nodes s,t of V, and capacities on the arcs: uij is the capacity on arc (i,j). Find non-negative flow fij for.
Algorithms (2IL15) – Lecture 7
Network Flow CSE 373 Data Structures.
Network Flows – Restricted vertices
Min Global Cut Animation
Lecture 21 Network Flow, Part 1
Network Flows – Minimum capacities
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Augmenting Path Algorithm
Introduction to Maximum Flows
Richard Anderson Lecture 22 Network Flow
Lecture 21 Network Flow, Part 1
Introduction to Maximum Flows
Not Always Feasible 2 (3,5) 1 s (0,2) 3 (, u) t.
Richard Anderson Lecture 22 Network Flow
Network Flow Problems – Maximal Flow Problems
Maximum Flow Problems in 2005.
EMIS 8374 Max-Flow in Undirected Networks Updated 18 March 2008
EMIS The Maximum Flow Problem: Flows and Cuts Updated 6 March 2008
Presentation transcript:

Network Flows – Multiple sources and sinks Sometimes a network will have multiple sources and multiple sinks. We deal with this situation by introducing a supersource and a supersink. 8 12 A D T1 9 10 S1 3 18 30 16 T2 E B 15 S2 8 10 3 17 T3 12 C F 5

Network Flows – Multiple sources and sinks Sometimes a network will have multiple sources and multiple sinks. To obtain the capacities on the new edges, consider the max flow out of the sources. Max flow out of S1 = 9 + 18 = 27 so the capacity into S1 must be at least 27. Max flow out of S2 = 15 + 17 = 32 so the capacity into S2 must be at least 32. We deal with this situation by introducing a supersource and a supersink. 8 12 A D T1 9 T 10 S1 3 27 S 18 30 16 T2 E B 15 32 S2 8 10 3 17 T3 12 C F 5

Network Flows – Multiple sources and sinks Max flow into T1 = 12 + 10 = 22 so the capacity out of T1 must be at least 22. Max flow into T2 = 16 + 3 = 19 so the capacity out of T2 must be at least 19. Max flow into T3 = 12 so the capacity out of T3 must be at least 12. 8 12 A D T1 9 T 22 10 S1 3 27 S 18 19 30 16 T2 E B 15 32 S2 8 10 3 12 17 T3 12 C F 5

Network Flows – Multiple sources and sinks The minimum cut consists of edges AD, ED, ET2, EF ad CF and DT or vertex sets S, S1, S2, A, B, C, E and D, T1, T2, T3, T The capacity of the cut is 8 + 3 + 10 + 16 + 8 + 5 = 50 What is the minimum cut for this network? 8 12 A D T1 9 T 22 10 S1 3 27 S 18 19 30 16 T2 E B 15 32 S2 8 10 3 12 17 T3 12 C F 5

Network Flows – Multiple sources and sinks We can now find flow augmenting paths to increase the flow. 8 12 A D T1 9 22 10 S1 3 27 18 S 19 30 16 T2 T E B 15 32 S2 8 3 10 12 17 T3 C F 12 5

Network Flows – Multiple sources and sinks SS2BET2T can be increased by 15. Arc S2B is now saturated. 8 12 A D T1 9 22 10 S1 3 27 18 S 4 15 19 30 15 16 1 15 T2 T E B 16 15 32 15 15 S2 8 3 10 12 17 T3 C F 12 5

Network Flows – Multiple sources and sinks SS1BET1T can be increased by 10. Arc ET1 is now saturated. 8 12 A D T1 9 22 12 10 10 10 S1 3 27 17 10 18 8 10 S 15 4 5 25 1 T2 T E B 15 15 15 15 16 15 S2 8 3 10 12 17 T3 C F 12 5

Network Flows – Multiple sources and sinks SS1ADT1T can be increased by 8. Arc AD is now saturated. 8 8 4 8 12 A D T1 9 1 8 4 18 12 10 10 S1 3 9 18 17 10 8 S 10 4 5 1 T2 T E B 15 15 25 15 15 16 S2 8 3 10 12 17 T3 C F 12 5

Network Flows – Multiple sources and sinks SS2CFT3T can be increased by 5. Arc CF is now saturated. 4 A D T1 1 8 8 8 4 10 S1 3 9 8 18 18 S 10 4 5 1 T2 T E B 11 20 16 15 25 15 15 15 S2 7 5 12 8 3 10 12 5 17 7 5 T3 5 5 C F 12

Network Flows – Multiple sources and sinks SS2CEFT2T can be increased by 3. Arc FT2 is now saturated. 4 A D T1 1 8 8 8 4 10 S1 3 9 8 18 18 S 10 1 18 4 15 5 1 T2 T E B 8 23 11 20 25 15 15 S2 5 3 3 5 3 8 10 7 3 7 12 5 9 8 5 T3 5 C F 7

Network Flows – Multiple sources and sinks SS2CEFT3T can be increased by 5. Arc EF is now saturated. 4 A D T1 1 8 8 8 4 10 S1 3 9 8 18 18 S 10 1 5 1 T2 T E B 3 28 8 23 25 15 18 15 S2 7 5 2 10 8 3 5 3 2 8 7 3 9 8 4 13 2 10 7 5 T3 5 C F

Network Flows – Multiple sources and sinks SS1BEDT1T can be increased by 3. Arc ED is now saturated. 1 11 4 8 A D T1 1 8 8 4 18 1 21 3 3 10 S1 6 21 9 18 5 13 8 10 S 2 28 1 5 25 1 T2 T E B 28 15 18 3 15 S2 10 3 8 2 2 13 8 4 10 T3 5 C F 2

Network Flows – Multiple sources and sinks SS1BET2T can be increased by 1. Arcs ET2 and T1T2 are now saturated. 1 A D T1 1 8 11 8 1 3 10 S1 5 22 6 21 4 14 5 13 21 S 19 1 18 1 29 2 28 1 15 16 T2 T E B 28 3 15 S2 10 3 8 2 2 13 8 4 10 T3 5 C F 2

Network Flows – Multiple sources and sinks The flow out of the sources (28 + 22 = 50) and into the sinks (21 + 19 + 10 = 50) are both equal to the minimum cut of 50. We have therefore found the maximum flow. 1 A D T1 1 8 11 8 1 3 10 S1 5 22 4 14 21 S 19 1 29 16 T2 T E B 28 3 15 S2 10 3 8 2 2 13 8 4 10 T3 5 C F 2

Network Flows – Multiple sources and sinks The flow out of the sources (28 + 22 = 50) and into the sinks (21 + 19 + 10 = 50) are both equal to the minimum cut of 50. We have therefore found the maximum flow. 11 1 A D T1 8 1 8 11 8 8 3 10 S1 3 4 14 29 10 14 1 T2 E B 29 16 15 15 8 16 S2 3 8 2 3 13 13 8 8 4 10 T3 5 C F 2 10 5