220 likes | 330 Views
EMIS 8374 Max-Flow in Undirected Networks Updated 18 March 2008. 4. 10. 3. 8. Max Flow in Undirected Networks. 1. 6. 5. 5. 2. s. t. 2. 6. 10. 3. 4. 1. 4. 5. 5. Replace Edge {i,j} With Arcs (i,j) and (j,i). 4. 6. 4. 1. t. 6. 5. 5. 10. 2. 10. 10. 2. 10. 6. 6.
E N D
EMIS 8374Max-Flow in Undirected Networks Updated 18 March 2008
4 10 3 8 Max Flow in Undirected Networks 1 6 5 5 2 s t 2 6 10 3 4 1 4
5 5 Replace Edge {i,j} With Arcs (i,j) and (j,i) 4 6 4 1 t 6 5 5 10 2 10 10 2 10 6 6 3 3 1 1 3 2 s 4 4 4 8 8
4 2 Max Flow in Directed Network 0 0 4 1 t 6 0 4 0 2 10 0 0 10 6 0 3 0 0 1 3 2 s 4 0 4 7 0
1 2 4 2 Max Flow in Directed Network 6 4 t 4 10 10 6 3 3 2 1 4 7 s 4
1 4 6 2 4 2 12 10 Remove Bi-directional flows if xij xji then xij = xij – xji and xji = 0 else xji = xji – xij and xij = 0 1 4 6 2-2=0 4-2=2 2 12 10
Max Flow in Undirected Network Arrows indicate flow direction 1 4 6 2 2 4 10 s t 2 6 10 3 3 4 7 1 4
Remove Saturated Edges 1 2 s t 3 S = {s, 4} T = {1, 2, 4, t} 4
Undirected s-t Cut 1 4 6 2 2 4 10 s t 2 6 10 3 3 4 7 1 u[S, T] = 24 4
All-Pairs Minimum Cut Problem • Find the minimum value of u[A, B] where [A, B] is an partition of the nodes such that |A|>0 and |B|>0. • Also known as the minimum 2-cut. • Note that no specific source or sink nodes are specified.
Min 2-Cut Algorithm • Since the network is undirected, u[A, B] = u[A, B] • Don’t need to try s = j and t = i if we’ve already tried s = i and t = j
Min 2-Cut Algorithm v* = ; for s = 1 .. |N| - 1 for t = s + 1 .. |N| begin solve max s-t flow problem; identify min cut [S, T]; if u[S, T] < v* then begin A = S; B = T; end end
Min 2-Cut Example 10 1 2 3 3 3 1 8 5 3 4 2 5 4
Minimum Cut: s = 1, t = 2 10 1 2 3 3 3 1 8 5 3 4 2 5 S = {1} T = {2, 3, 4, 5} u[S, T] = 17 4
10 1 2 3 3 3 1 5 8 3 4 2 5 S = {1,2} T = {3,4,5} u[S, T]=14 4 Minimum Cut s = 1, t = 3
Minimum Cut: s = 1, t = 4 10 1 2 3 3 3 1 5 8 3 4 2 5 S = {1,2,3,5} T={4} u[S, T]=12 4
10 1 2 3 3 3 1 5 8 3 4 2 5 S = {1,2} T = {3,4,5} u[S, T]=14 4 Minimum Cut: s = 1, t = 5
Minimum Cut: s = 2, t =3 10 1 2 3 3 3 1 5 8 3 4 2 5 S = {2,1} T = {3,4,5} u[S, T]=14 4
Observation • Suppose s = 2 and t = 3 and let [A, B] be a minimum 2-3 cut. • Case 1: node 1 is in A • [A, B] is also a 1-3 cut • Thus, we already know u[A, B] 14 • Case 2: node 1 is in N2 • [A, B] is also a 2-1 (1-2) cut • Thus, we already know u[A, B] 17 • There is no need to solve the max-flow problem for s = 2 and t =3.
An Improved Min 2-Cut Algorithm • Consider a minimum 2-cut [A, B] • Let A be the set containing node 1. • Since |B| > 0, it must contain at least one node in {2, 3, 4, 5}. • Thus we can discover [A, B] by solving only |N| - 1 max flow problems with s =1 and t = 2, t = 3, …, t = |N|. • Complexity is O(nf(n, m)) where f(n, m) is the complexity of solving a max flow problem
Minimum 2-Cut 10 1 2 3 3 3 1 5 8 3 4 2 5 A = {1,2,3,5} B = {4} 4 u[A, B]=12
Edge Connectivity • In a so-called unweighted graph where each edge as a capacity of 1 unit, the capacity of a minimum 2-cut is known as the edge connectivity of the graph • Connectivity is an important measure of a network’s reliability. • In a telecommunications network an edge connectivity of two (2) means that the network can survive single-link failures.