Presentation is loading. Please wait.

Presentation is loading. Please wait.

3 t 4 1 2 s 2 1 4 23 2 1 4 3 4 1 the black numbers next to an arc is its capacity.

Similar presentations


Presentation on theme: "3 t 4 1 2 s 2 1 4 23 2 1 4 3 4 1 the black numbers next to an arc is its capacity."— Presentation transcript:

1 3 t 4 1 2 s 2 1 4 23 2 1 4 3 4 1 the black numbers next to an arc is its capacity

2 3 t 4 1 2 s 2 1 1 4 2 3 1 2 1 1 4 3 2 4 1 the black number next to an arc is its capacity the green number next to an arc is the flow on it extra 3 flow can be sent through (s,2) and then through (2,4); all arcs going out of 4 are saturated; but we can reroute 1 flow unit from (1,4) through (1,3) and then through (3,t), releasing 1 unit of flow through (4,t) which can then be used for extra flow on the (s,2)(2,4)(4,t)-path. To find such possibilities we do the bookkeeping in the so-called residual graph

3 the residual graph 3 t 4 1 2 s 2 1 1 3 4 2 23 1 1 2 1 1 3 4 3 3 2 2 4 1 1 blue arcs (i,j) are forward arcs (f ij <c ij ) green arcs (j,i) are backward arcs (f ij >0) the blue number is the residual capacity of a blue arc the green number is the capacity of a green arc the black number is the original capacity of the arc

4 the residual graph 3 t 4 1 2 s 2 1 1 3 23 1 1 1 3 2 1 red arcs form an augmenting path 3

5 the residual graph 3 t 4 1 2 s 2 1 1 3 23 1 1 1 3 2 1 red arcs form an augmenting path Augment the flow by the minimum capacity of a red arc, i.e, 1 3

6 the residual graph 3 t 4 1 2 s 2 1 2 3 2 1 3 1 1 red ars form an augmenting path Augment the flow by the minimum capacity of a red arc, i.e, 1 And construct the new residual graph 3 1

7 3 t 4 1 2 s 2 1 4 23 2 1 4 2 4 1 An s-t cut is defined by a set S of the nodes with s in S and t not in S.

8 3 t 4 1 2 s 2 1 4 23 2 1 4 2 4 1 An s-t cut is defined by a set S of the nodes with s in S and t not in S. S={s,1,2}

9 3 t 4 1 2 s 2 1 4 23 2 1 4 2 4 1 An s-t cut is defined by a set S of the nodes with s in S and t not in S Size of cut S is the sum of the capacities on the arcs from S to N\S. S={s,1,2}

10 3 t 4 1 2 s 2 1 4 23 2 1 4 2 4 1 An s-t cut is defined by a set S of the nodes with s in S and t not in S Size of cut S is the sum of the capacities on the arcs from S to N\S. C(S)=c 13 +c 14 +c 24 = 2+2+4=8

11 3 t 4 1 2 s 2 1 4 23 2 1 4 2 4 1 C(S 1 )=c s1 +c 24 = 2+4=6 S1S1

12 3 t 4 1 2 s 2 1 4 23 2 1 4 2 4 1 C(S 2 )=c 13 +c 43 +c 4t = 2+1+2=5 S1S1 S2S2

13 3 t 4 1 2 s 2 1 4 23 2 1 4 2 4 1 C(S 1 )=c s1 +c 24 = 2+4=6 C(S 2 )=c 13 +c 43 +c 4t = 2+1+2=5 S1S1 Max Flow ≤ Min Cut S2S2

14 3 t 4 1 2 s 2 1 4 23 2 1 4 2 4 1 C(S 1 )=c s1 +c 24 = 2+4=6 C(S 2 )=c 13 +c 43 +c 4t = 2+1+2=5 S1S1 Max Flow ≤ Min Cut f s1 +f s2 ≤ Min Cut ≤ 5 S2S2

15 t 4 1 2 s 2 1 2 3 2 1 3 1 1 3 1 the residual graph Max Flow ≤ Min Cut f s1 +f s2 =2+3=5 = C(S 2 )=c 13 +c 43 +c 4t = 2+1+2=5 S2S2 S 2 ={s,1,2,4} the set of nodes reachable from S

16 t 4 1 2 s 2 1 2 3 2 1 3 1 1 3 1 the residual graph Max Flow ≤ Min Cut f s1 +f s2 =2+3=5 = C(S 2 )=c 13 +c 43 +c 4t = 2+1+2=5 S2S2 Theorem: Max Flow = Min Cut S 2 ={s,1,2,4} the set of nodes reachable from S


Download ppt "3 t 4 1 2 s 2 1 4 23 2 1 4 3 4 1 the black numbers next to an arc is its capacity."

Similar presentations


Ads by Google