07 network flow i

Upload: sheetanshu-sinha

Post on 01-Mar-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 07 Network Flow i

    1/87

    Lecture slides by Kevin Wayne

    Copyright 2005 Pearson-Addison Wesley

    Copyright 2013 Kevin Wayne

    http://www.cs.princeton.edu/~wayne/kleinberg-tardos

    Last updated on Sep 8, 2013 6:40 AM

    7. NETWORK FLOW I

    ! max-flow and min-cut problems

    ! Ford-Fulkerson algorithm

    !

    max-flow min-cut theorem! capacity-scaling algorithm

    ! shortest augmenting paths

    ! blocking-flow algorithm

    ! unit-capacity simple networks

  • 7/25/2019 07 Network Flow i

    2/87

    SECTION 7.1

    7. NETWORK FLOW I

    ! max-flow and min-cut problems

    ! Ford-Fulkerson algorithm

    !

    max-flow min-cut theorem! capacity-scaling algorithm

    ! shortest augmenting paths

    ! blocking-flow algorithm

    ! unit-capacity simple networks

  • 7/25/2019 07 Network Flow i

    3/87

    Abstraction for material flowingthrough the edges.

    Digraph G= (V,E)with source s !V and sink t !V.Nonnegative integer capacity c(e) for each e !E.

    Flow network

    3

    s t5

    15

    1015

    16

    9

    15

    6

    8 10

    154

    4 10

    10

    capacity

    no parallel edges

    no edge enters s

    no edge leaves t

  • 7/25/2019 07 Network Flow i

    4/87

    Def. Ast-cut (cut) is a partition (A,B)of the vertices with s!A andt!B.

    Def. Its capacityis the sum of the capacities of the edges fromAtoB.

    Minimum cut problem

    4

    5s

    15

    10

    t

    capacity = 10 + 5 + 15 = 30

    cap(A,B) = c(e)

    eout ofA

    "

  • 7/25/2019 07 Network Flow i

    5/87

  • 7/25/2019 07 Network Flow i

    6/87

    Def. Ast-cut (cut) is a partition (A,B)of the vertices with s!A andt!B.

    Def. Its capacityis the sum of the capacities of the edges fromAtoB.

    Min-cut problem. Find a cut of minimum capacity.

    10

    Minimum cut problem

    6

    s

    10

    t

    capacity = 10 + 8 + 10 = 28

    8

    cap(A,B) = c(e)

    eout ofA

    "

  • 7/25/2019 07 Network Flow i

    7/87

    Def. Anst-flow (flow) fis a function that satisfies:

    For each e!E: [capacity]For each v!V {s, t}: [flow conservation]

    7

    Maximum flow problem

    0 / 4

    0 / 4 0 / 15

    10/10

    10 / 105 / 5 vs t

    0/6

    5/1

    0

    5 / 9

    5 / 8

    5/15

    10/1010

    /15

    10 / 16

    inflow at v = 5 + 5 + 0 = 10

    outflow at v = 10 + 0 = 10

    flow capacity

    0 / 15

    f(e)

    ein to v

    " = f(e)eout of v

    "0 " f(e) " c(e)

  • 7/25/2019 07 Network Flow i

    8/87

    8

    Maximum flow problem

    Def. Anst-flow (flow) fis a function that satisfies:

    For each e!E: [capacity]For each v!V {s, t}: [flow conservation]

    Def. The valueof a flowf is: val(f) =

    0 / 4

    10/10

    10 / 105 / 5s t

    5/1

    0

    5 / 9

    5 / 8

    5/15

    10/1010

    /15

    0 / 15

    value = 5 + 10 + 10 = 25

    0 / 4

    0/6

    10 / 16

    0 / 15

    f(e)e out ofs

    " .

    f(e)

    ein to v

    " = f(e)eout of v

    "0 " f(e) " c(e)

  • 7/25/2019 07 Network Flow i

    9/87

    9

    Maximum flow problem

    Def. Anst-flow (flow) fis a function that satisfies:

    For each e!E: [capacity]For each v!V {s, t}: [flow conservation]

    Def. The valueof a flowf is: val(f) =

    Max-flow problem. Find a flow of maximum value.

    0 / 4

    10/10

    10 / 105 / 5s

    8/1

    0

    8 / 9

    8 / 8

    10/1013

    /15

    0 / 15

    value = 8 + 10 + 10 = 28

    0 / 4

    3/6

    13 / 16

    0 / 15

    t

    2/15

    f(e)

    ein to v

    " = f(e)eout of v

    "0 " f(e) " c(e)

    f(e)e out ofs

    " .

  • 7/25/2019 07 Network Flow i

    10/87

    SECTION 7.1

    7. NETWORK FLOW I

    ! max-flow and min-cut problems

    ! Ford-Fulkerson algorithm

    !

    max-flow min-cut theorem! capacity-scaling algorithm

    ! shortest augmenting paths

    ! blocking-flow algorithm

    ! unit-capacity simple networks

  • 7/25/2019 07 Network Flow i

    11/87

    11

    Towards a max-flow algorithm

    Greedy algorithm.

    Start withf(e) = 0for all edge e!E.Find an stpath Pwhere each edge hasf(e) < c(e).

    Augment flow along path P.

    Repeat until you get stuck.

    s t

    0 / 2

    0/10 0 / 6

    0 / 10

    0 / 4

    0/8

    0 / 9

    network G

    0 / 10 0

    value of flow

    0/1

    0

    flow capacity

  • 7/25/2019 07 Network Flow i

    12/87

  • 7/25/2019 07 Network Flow i

    13/87

    + 2 = 10

    Greedy algorithm.

    Start withf(e) = 0for all edge e!E.Find an stpath Pwhere each edge hasf(e) < c(e).

    Augment flow along path P.

    Repeat until you get stuck.

    13

    Towards a max-flow algorithm

    0 / 6

    0 / 4

    8/8

    network G

    0 / 10 8

    0/1

    0

    t

    0 / 2

    8/10

    8 / 100 / 9

    10

    2

    2

    2

    s

  • 7/25/2019 07 Network Flow i

    14/87

    Greedy algorithm.

    Start withf(e) = 0for all edge e!E.Find an stpath Pwhere each edge hasf(e) < c(e).

    Augment flow along path P.

    Repeat until you get stuck.

    14

    Towards a max-flow algorithm

    0 / 4

    8/8

    network G

    10

    2 / 2

    10/10

    10 / 10s

    0 / 6

    0 / 10

    0/1

    0

    t2 / 9

    6

    8

    6

    + 6 = 16

    6

  • 7/25/2019 07 Network Flow i

    15/87

    Greedy algorithm.

    Start withf(e) = 0for all edge e!E.Find an stpath Pwhere each edge hasf(e) < c(e).

    Augment flow along path P.

    Repeat until you get stuck.

    15

    Towards a max-flow algorithm

    0 / 4

    8/8

    network G

    16

    2 / 2

    10/10

    10 / 10s

    6 / 6

    6 / 10

    6/1

    0

    t8 / 9

    ending flow value = 16

  • 7/25/2019 07 Network Flow i

    16/87

    Greedy algorithm.

    Start withf(e) = 0for all edge e!E.Find an stpath Pwhere each edge hasf(e) < c(e).

    Augment flow along path P.

    Repeat until you get stuck.

    16

    Towards a max-flow algorithm

    3 / 4

    7/8

    network G

    19

    0 / 2

    10/10

    10 / 10s

    6 / 6

    9 / 10

    9/1

    0

    t9 / 9

    but max-flow value = 19

  • 7/25/2019 07 Network Flow i

    17/87

  • 7/25/2019 07 Network Flow i

    18/87

    Def. An augmenting pathis a simple stpath Pin the residual graph Gf.

    Def. The bottleneck capacityof an augmenting Pis the minimum

    residual capacity of any edge in P.

    Key property. Letf be a flow and let Pbe an augmenting path inGf .

    Thenf 'is a flow and val(f ') = val(f) + bottleneck(Gf, P).

    18

    Augmenting path

    AUGMENT (f, c, P)___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___

    b !bottleneck capacity of pathP.

    FOREACHedge e!P

    IF (e!E) f(e) !f(e) + b.

    ELSE f(eR) !f(eR) b.

    RETURN f.___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___

  • 7/25/2019 07 Network Flow i

    19/87

    Ford-Fulkerson augmenting path algorithm.

    Start withf(e) = 0for all edge e!E.Find an augmenting path Pin the residual graph Gf.

    Augment flow along path P.

    Repeat until you get stuck.

    19

    Ford-Fulkerson algorithm

    FORD-FULKERSON (G, s, t, c)_______________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___

    FOREACHedge e!E:f(e) !0.

    Gf !residual graph.

    WHILE(there exists an augmenting pathPin Gf )

    f!AUGMENT (f, c,P).

    Update Gf.

    RETURN f.

    }_______________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___

  • 7/25/2019 07 Network Flow i

    20/87

    20

    Ford-Fulkerson algorithm demo

    s t

    0 / 2

    0/10 0 / 6

    0 / 10

    0 / 4

    0/8

    0 / 9

    network G

    0 / 10 0

    value of flow

    0/1

    0

    flow capacity

    s t

    2 6

    10

    4

    9

    residual graph Gf

    10

    residual capacity

    10

    10

    8

  • 7/25/2019 07 Network Flow i

    21/87

    21

    Ford-Fulkerson algorithm demo

    2 6

    4

    9

    residual graph Gf

    10

    10

    s t

    0 / 2

    0/10 0 / 6

    0 / 10

    0 / 4

    0/8

    0 / 9

    network G

    0 / 10 0

    0/1

    0

    s t

    10

    10

    8

    8

    8

    8

    + 8 = 8

  • 7/25/2019 07 Network Flow i

    22/87

    22

    Ford-Fulkerson algorithm demo

    4

    residual graph Gf

    10

    s t

    0 / 2

    8/10 0 / 6

    8 / 10

    0 / 4

    8/8

    0 / 9

    network G

    0 / 10 8

    0/1

    0

    8

    8

    8

    9s

    2

    2

    10

    2

    2

    + 2 = 10

    106

    2

    2 t

  • 7/25/2019 07 Network Flow i

    23/87

    23

    Ford-Fulkerson algorithm demo

    4

    residual graph Gf

    s t

    2 / 2

    10/10

    0 / 6

    10 / 10

    0 / 4

    8/8

    2 / 9

    network G

    0 / 10 10

    0/1

    0

    8

    2

    2

    10

    10

    10 7s

    106

    t

    6

    8

    6

    + 6 = 16

    6

  • 7/25/2019 07 Network Flow i

    24/87

    24

    Ford-Fulkerson algorithm demo

    residual graph Gf

    s t

    2 / 2

    10/10

    6 / 6

    10 / 10

    0 / 4

    8/8

    8 / 9

    network G

    6 / 10 16

    6/1

    0

    8

    8

    10

    10

    1

    6

    6

    6

    4

    4s

    4

    t

    2

    8

    0

    2

    8

    + 2 = 18

  • 7/25/2019 07 Network Flow i

    25/87

    25

    Ford-Fulkerson algorithm demo

    residual graph Gf

    s t

    0 / 2

    10/10

    6 / 6

    10 / 10

    2 / 4

    8/8

    8 / 9

    network G

    8 / 10 18

    8/1

    0

    8

    10

    10

    6

    8

    2

    2

    8

    1

    2

    s

    2

    t2

    8

    9

    9

    7

    3

    9

    + 1 = 19

  • 7/25/2019 07 Network Flow i

    26/87

  • 7/25/2019 07 Network Flow i

    27/87

    SECTION 7.2

    7. NETWORK FLOW I

    ! max-flow and min-cut problems

    ! Ford-Fulkerson algorithm

    ! max-flow min-cut theorem

    ! capacity-scaling algorithm

    ! shortest augmenting paths

    ! blocking-flow algorithm

    ! unit-capacity simple networks

  • 7/25/2019 07 Network Flow i

    28/87

    Relationship between flows and cuts

    Flow value lemma. Letf be any flow and let (A, B)be any cut. Then, the net

    flow across (A, B)equals the value of f.

    28

    0 / 4

    10/10

    10 / 105 / 5s t

    5/1

    0

    5 / 9

    5 / 8

    5/15

    10/1010

    /15

    0 / 15

    value of flow = 25

    0 / 4

    0/6

    10 / 16

    0 / 15

    net flow across cut = 5 + 10 + 10 = 25

    f(e)eout of A

    " # f(e)ein to A

    " = v(f)

  • 7/25/2019 07 Network Flow i

    29/87

    Relationship between flows and cuts

    Flow value lemma. Letf be any flow and let (A, B)be any cut. Then, the net

    flow across (A, B)equals the value of f.

    29

    0 / 4

    10/10

    10 / 105 / 5s t

    5/1

    0

    5 / 9

    5 / 8

    5/15

    10/1010

    /15

    0 / 150 / 4

    0/6

    10 / 16

    0 / 15

    net flow across cut = 10 + 5 + 10 = 25

    f(e)eout of A

    " # f(e)ein to A

    " = v(f)

    value of flow = 25

  • 7/25/2019 07 Network Flow i

    30/87

    Relationship between flows and cuts

    Flow value lemma. Letf be any flow and let (A, B)be any cut. Then, the net

    flow across (A, B)equals the value of f.

    30

    0 / 4

    10/10

    10 / 105 / 5s t

    5/1

    0

    5 / 9

    5 / 8

    5/15

    10/1010

    /15

    0 / 150 / 4

    0/6

    10 / 16

    0 / 15

    net flow across cut = (10 + 10 + 5 + 10 + 0 + 0) (5 + 5 + 0 + 0) = 25

    edges from B to A

    f(e)eout of A

    " # f(e)ein to A

    " = v(f)

    value of flow = 25

  • 7/25/2019 07 Network Flow i

    31/87

    Flow value lemma. Letf be any flow and let (A, B)be any cut. Then, the net

    flow across (A, B)equals the value of f.

    Pf.

    =

    v#A

    " f(e)eout ofv

    " $ f(e)ein to v

    "%

    &'

    (

    )*

    31

    Relationship between flows and cuts

    v(f) = f(e)eout ofs"

    by flow conservation, all terms

    except v = s are 0

    f(e)eout of A

    " # f(e)ein to A

    " = v(f)

    = f(e)eout ofA

    " $ f(e).ein to A

    " !

  • 7/25/2019 07 Network Flow i

    32/87

    Relationship between flows and cuts

    Weak duality. Letf be any flow and (A, B)be any cut. Then, v(f) !cap(A,B).

    Pf.

    32

    s t

    0 / 4

    10/10

    9 / 105 / 5

    8/1

    0

    8 / 9

    7 / 8

    2/15

    10/10

    12/1

    5

    0 / 4

    2/6

    12 / 16

    0 / 15

    0 / 15

    s

    15

    5

    10

    t

    value of flow = 27 capacity of cut = 30

    v(f) = f(e)eout of A

    " # f(e)ein to A

    "

    flow-value

    lemma

    !

    $ f(e)eout of A

    "

    $ c(e)eout of A

    "

    = cap(A,B) !

  • 7/25/2019 07 Network Flow i

    33/87

    Max-flow min-cut theorem

    Augmenting path theorem. A flowfis a max-flow iff no augmenting paths.

    Max-flow min-cut theorem. Value of the max-flow = capacity of min-cut.

    Pf. The following three conditions are equivalent for any flow f :

    i. There exists a cut (A,B) such that cap(A, B) = val(f).

    ii. f is a max-flow.

    iii. There is no augmenting path with respect tof.

    [ i ii ]

    Suppose that (A,B)is a cut such that cap(A, B) = val(f).

    Then, for any flowf', val(f') # cap(A, B) = val(f).

    Thus, fis a max-flow. !

    33

    weak duality by assumption

  • 7/25/2019 07 Network Flow i

    34/87

    Max-flow min-cut theorem

    Augmenting path theorem. A flowfis a max-flow iff no augmenting paths.

    Max-flow min-cut theorem. Value of the max-flow = capacity of min-cut.

    Pf. The following three conditions are equivalent for any flow f :

    i. There exists a cut (A,B) such that cap(A, B) = val(f).

    ii. f is a max-flow.

    iii. There is no augmenting path with respect tof.

    [ ii iii ] We prove contrapositive: ~iii ~ii.

    Suppose that there is an augmenting path with respect to f.

    Can improve flowf by sending flow along this path.

    Thus, f is not a max-flow. !

    34

  • 7/25/2019 07 Network Flow i

    35/87

    [ iii i ]

    Letfbe a flow with no augmenting paths.LetAbe set of nodes reachable from sin residual graph Gf.

    By definition of cutA, s!A.

    By definition of flow f, t$A.

    35

    Max-flow min-cut theorem

    v(f) = f(e)eout of A

    " # f(e)ein to A"

    original network G

    s

    t

    A B

    flow-value

    lemma

    edge e = (v, w) with v !A, w !B

    must have f(e) = c(e)

    edge e = (v, w) with v !B, w !A

    must have f(e) = 0

    = c(e)eout of A

    "

    = cap(A,B)

  • 7/25/2019 07 Network Flow i

    36/87

    SECTION 7.3

    7. NETWORK FLOW I

    ! max-flow and min-cut problems

    ! Ford-Fulkerson algorithm

    ! max-flow min-cut theorem

    ! capacity-scaling algorithm

    ! shortest augmenting paths

    ! blocking-flow algorithm

    ! unit-capacity simple networks

  • 7/25/2019 07 Network Flow i

    37/87

    37

    Running time

    Assumption. Capacities are integers between 1and C.

    Integrality invariant. Throughout the algorithm, the flow valuesf(e)

    and the residual capacities cf(e)are integers.

    Theorem. The algorithm terminates in at most val(f*) ! nCiterations.

    Pf. Each augmentation increases the value by at least 1. !

    Corollary. The running time of Ford-Fulkerson is O(mnC).

    Corollary. If C= 1, the running time of Ford-Fulkerson is O(mn).

    Integrality theorem. Then exists a max-flow f*for which everyflow valuef*(e)is an integer.

    Pf. Since algorithm terminates, theorem follows from invariant. !

  • 7/25/2019 07 Network Flow i

    38/87

    Q. Is generic Ford-Fulkerson algorithm poly-time in input size?

    A. No. If max capacity is C, then algorithm can take " Citerations.

    s%v%w%t

    s%w%v%t

    s%v%w%t

    s%w%v%t

    s%v%w%t

    s%w%v%t

    Bad case for Ford-Fulkerson

    38

    s

    t

    w

    v

    1

    m, n, and log C

    each augmenting path

    sends only 1 unit of flow

    (# augmenting paths = 2C)

    C

    C

    CC

  • 7/25/2019 07 Network Flow i

    39/87

    39

    Choosing good augmenting paths

    Use care when selecting augmenting paths.

    Some choices lead to exponential algorithms.Clever choices lead to polynomial algorithms.

    If capacities are irrational, algorithm not guaranteed to terminate!

    Goal. Choose augmenting paths so that:Can find augmenting paths efficiently.

    Few iterations.

  • 7/25/2019 07 Network Flow i

    40/87

    40

    Choosing good augmenting paths

    Choose augmenting paths with:

    Max bottleneck capacity.Sufficiently large bottleneck capacity.

    Fewest number of edges.

    Theoretical Improvements in Algorithmic Efficiency

    for Network Flow Problems

    J A C K E D M O N D S

    University of Waterloo, Waterloo, Ontario, Canada

    A N D

    R I C H A R D M K A R P

    University of California, Berkeley, California

    A BSTRACT. Th i s p ap e r p r e sen t s n ew a l g o r i t h m s f o r t h e m ax i m u m f l o w p r o b l em , t h e H i t ch co ck

    t r a n s p o r t a t i o n p r o b l e m , a n d t h e g e n e r a l m i n i m u m - c o s t f lo w pr o b l e m . U p p e r b o u n d s o n t h e

    n u m b e r s o f s t e p s i n t h e s e a l g o r i t h m s a r e d e r i v e d , a n d a r e s h o w n t o c o m p a l e f a v o r a b l y w i t h

    u p p e r b o u n d s o n t h e n u m b e r s o f s t e p s r e q u i r e d b y e a r l i e r a l g o r i th m s .

    F i r s t , t h e p a p e r s t a t e s t h e m a x i m u m f lo w p ro b l e m , g i v e s t h e F o r d - F u l k e r s o n l a b e l i n g m e th o d

    f o r i t s so l u t i o n , an d p o i n t s o u t t h a t a n i m p r o p e r ch o i ce o f fl o w au g m en t i n g p a t h s can l ead t o

    sev e r e co m p u t a t i o n a l d i f f i cu l t i e s . Th en r u l e s o f ch o i ce t h a t av o i d t h ese d i f f i cu l t i es a r e g i v en .

    W e s h o w t h a t , i f e a c h f lo w a u g m e n t a t i o n i s m a d e a l o n g a n a u g m e n t i n g p a t h h a v i n g a m i n i m u m

    n u m b e r o f a r c s , t h e n a m a x i m u m f lo w in a n n - n o d e n e t w o r k w i l l b e o b ta i n e d a f t e r n o m o r e t h a n

    ~( na - n ) au g m en t a t i o n s ; an d t h en w e sh o w t h a t i f each f l o w ch an g e i s ch o sen t o p r o d u ce a

    m ax i m u m i n c r ea se i n t h e fl o w v a l u e t h e n , p r o v i d e d t h e cap ac i t i e s a r e i n t eg r a l , a m ax i m u m f l o w

    w i l l b e d e t e r m i n ed w i t h i n a t m o s t 1 + l og M/( M-- 1) if t, S) a u g m e n t a t i o n s , wheref* t, s) is the

    v a l u e o f t h e m ax i m u m f l o w an d M is t h e m ax i m u m n u m b er o f a r c s ac r o ss a cu t .

    N e x t a n e w a l g o r i t h m i s g i v e n f o r t h e m i n i m u m - c o s t f l o w p r o b l e m , i n w h i c h a l l s h o r t e s t - p a t h

    c o m p u t a t i o n s a r e p e r f o r m e d o n n e t w o r k s w i t h a l l w e i g h t s n o n n e g a t i v e . I n p a r t i c u l a r , t h i s

    a l g o r i t h m s o l v e s th e n X n a s s i g m n e n t p r o b l e m i n

    O n 3)

    s t ep s . F o l l o w i n g t h a t w e ex p l o r e a

    s c a l i n g t e c h n i q u e f o r s o l v i n g a m i n i m u m - c o s t f lo w p r o b l e m b y t r e a t i n g a s e q u e n c e o f d e r i ve d

    p r o b l e m s w i t h s c a l e d d o w n c a p a c i t ie s . I t i s s h o w n t h a t , u s i n g t h i s t e c h n i q u e , t h e s o l u ti o n o f

    a I i i t c h c o c k t r a n s p o r t a t i o n p r o b l e m w i t h m s o u r ce s a n d n s i n k s , m ~ n , a n d m a x i m u m f lo w B ,

    r eq u i r e s a t m o s t ( n + 2 ) l o g 2

    B/n)

    f l o w au g m en t a t i o n s . S i m i l a r r e su l t s a r e a l so g i v en f o r t h e

    g en e r a l m i n i m u m - co s t fl o w p r o b l em .

    A n a b s t r a c t s t a t i n g t h e m a i n r e s u l t s o f t h e p r e s e n t p a p e r w a s p r e s e n t e d a t t h e C a l g a r y

    I n t e r n a t i o n a l C o n f e r e n c e o n C o m b i n a t o r i a l S t r u c t u r e s a n d T h e i r A p p l i c a t i o n s, J u n e 1 96 9.

    I n a p ap e r b y l ) i n i c ( 1 97 0 ) a r e su l t c l o se l y r e l a t ed t o t h e m a i n r e su l t o f S ec t i o n 1 . 2 is o b t a i n ed .

    Edmonds-Karp 1972 (USA) Dinic 1970 (Soviet Union)

  • 7/25/2019 07 Network Flow i

    41/87

    41

    Capacity-scaling algorithm

    Intuition. Choose augmenting path with highest bottleneck capacity:

    it increases flow by max possible amount in given iteration.Don't worry about finding exact highest bottleneck path.

    Maintain scaling parameter #.

    Let Gf(#)be the subgraph of the residual graph consisting only of

    arcs with capacity " #.

    Gf

    t

    s

    1

    122

    102

    170

    110

    Gf ("), "= 100

    t

    s

    122

    102

    170

    110

  • 7/25/2019 07 Network Flow i

    42/87

    42

    Capacity-scaling algorithm

    CAPACITY-SCALING(G, s, t, c)_________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____

    FOREACHedge e!E:f(e) !0.

    " !largest power of 2 # C.

    WHILE(" $ 1)

    Gf (") !"-residual graph.

    WHILE(there exists an augmenting pathPin Gf ("))

    f!AUGMENT (f, c,P).

    Update Gf (").

    "!

    "

    / 2.

    RETURN f._________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ___________________________________________ ____________________________________________ ___________________________________________ ____

  • 7/25/2019 07 Network Flow i

    43/87

    43

    Capacity-scaling algorithm: proof of correctness

    Assumption. All edge capacities are integers between 1and C.

    Integrality invariant. All flow and residual capacity values are integral.

    Theorem. If capacity-scaling algorithm terminates, then fis a max-flow.

    Pf.

    By integrality invariant, when #= 1 & Gf (#) = Gf .Upon termination of #= 1phase, there are no augmenting paths. !

  • 7/25/2019 07 Network Flow i

    44/87

    44

    Capacity-scaling algorithm: analysis of running time

    Lemma 1. The outer while loop repeats 1 + 'log2 C(times.

    Pf. Initially C/2 n1/2.

    Level graph has more than n1/2levels.

    Let 1 ! h! n1/2be layer with min number of nodes: |Vh | ! n1/2.

    86

    p y p y

    VhV0 Vn1/2V1

    level graph LG for flow f

    Unit-capacity simple networks: analysis

  • 7/25/2019 07 Network Flow i

    87/87

    LEMMA 2. After at most n1/2phases, |f| " |f*| n1/2.

    After n1/2phases, length of shortest augmenting path is > n1/2.

    Level graph has more than n1/2levels.

    Let 1 ! h! n1/2be layer with min number of nodes: |Vh | ! n1/2.

    LetA = {v:(v) < h} "{v:(v) = handvhas!1 outgoing residual edge}.

    capf (A,B) ! |Vh | ! n1/2 & |f| " |f*| n1/2. !

    residual edgesresidual graph Gf

    A