maximum flow: the preflow/push method of goldberg and tarjan (87)

124
Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Upload: felice

Post on 24-Feb-2016

31 views

Category:

Documents


0 download

DESCRIPTION

Maximum flow: The preflow/push method of Goldberg and Tarjan (87). Definitions. G=(V,E) is a directed graph capacity u( v,w ) for every v,w V: If ( v,w )  E then u( v,w ) = 0 Two distinguished vertices s and t. s. 3. 4. 1. a. b. 3. 3. 2. c. d. 4. 3. t. Definitions (cont). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Maximum flow: The preflow/push method of Goldberg and Tarjan

(87)

Page 2: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Definitions• G=(V,E) is a directed graph• capacity u(v,w) for every v,w V: If (v,w) E

then u(v,w) = 0 • Two distinguished vertices s and t.

s

t

a b

c d

3 4

3 3

34

2

1

Page 3: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Definitions (cont) A flow is a function on the edges which satisfies the following requirements• f(v,w) = -f(w,v) skew symmetry• f(v,w) u(v,w)• For every v except s and t wf(v,w) = 0

The value of the flow |f| = wf(s,w)

The maxflow problem is to find f with maximum value

Page 4: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Flows and s-t cutsLet (X,X’) be a cut such that s X, t X’.

s t

f(X,X’) = f(v,w) = f(v,w) - f(v,w) = |f| - 0 = |f|

|f| cap(X,X’) = u(v,w)

Flow is the same across any cut:

so

The value of the maximum flow is smaller than the minimum capacity of a cut.

v X, w X’

v X, w V

v X, w X

Page 5: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

More definitionsThe residual capacity of a flow is a function r on the edges such that

r(v,w) = u(v,w) - f(v,w)

a

d2, 1

Interpretation: We can push r(v,w) more flow from v to w by increasing f(v,w) and decreasing f(w,v)

Page 6: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

More definitions (cont)We define the residual graph R on V such that there is an arc from v to w with capacity r(v,w) for every v and w such that r(v,w) > 0An augmenting path p R is a path from s to t in R

r(p) = min r(v,w)(v,w) p

We can increase the flow by r(p)

Page 7: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Example

3 4

3 3

34

2

1

13

12

31

1

3 3

2 2

33

2

1

1

11

1

A flow The residual network

Page 8: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Basic theorem(1) f is max flow <==>(2) There is no augmenting path in R <==>(3) |f| = cap(X,X’) for some X

Proof. (3) ==> (1), (1) ==> (2) obviousTo prove (2) ==>(3) let X be all vertices reachable from s in R. By assumption t X. So (X,X’) is an s-t cut. Since there is no edge from X to X’ in R |f| = f(X,X’) = f(v,w) = u(v,w) = cap(X,X’)

Page 9: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Augmenting path methodsRepeat the following step:Find an augmenting path in R, increase the flow, update RStop when s and t are disconnected in R.

Need to be careful about how you choose those augmenting paths !

The best algorithm in this family is Dinic’s algorithm, that can be implemented in O(nmlog(n)) time

Page 10: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

But we’ll go for the preflow/push method

Page 11: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Distance labels

• Defined with respect to residual capacities

• d(t) = 0, d(s) = n• d(v) ≤ d(w) + 1 if r(v,w) > 0

Page 12: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Example (distance labels)

3 4

3 3

34

2

1

13

12

31

1

3 3

2 2

33

2

1

1

11

1

A flow The residual network

Page 13: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Example (distance labels)

3 4

3 3

34

2

1

13

12

31

1

3 3

2 2

33

2

1

1

11

1

A flow The residual network

0

11

2 2

6

Is this a valid distance labeling ?

Page 14: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Distance labels – basic lemma

Lemma: d(v) is a lower bound on the length of the shortest path from v to the sink

Proof: Let the s.p. to the sink be:

v v1 v2 t

d(v) ≤ d(v1) + 1 ≤ d(v2) + 2 ..... ≤ d(t) + k = k

Page 15: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Preflow (definition)

A preflow is a function on the edges which satisfies the following requirements• f(v,w) = -f(w,v) skew symmetry• f(v,w) u(v,w)• For every w, except s and t, vf(v,w) ≥ 0

Let e(w) = vf(v,w) be the excess at the node v

(we’ll also have e(t) ≥ 0, and e(s) ≤ 0)

Page 16: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Example (preflow)

Nodes with positive excess are called active.

s t3

3

3

22

2

2

1

2

1

0

0

The preflow push algorithm will try to push flow from active nodes towards the sink, relying on d( ).

Page 17: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Initialization (preflow)

3 4

3 3

34

2

143

00

00

0

3 4

3 3

34

2

13 40

Page 18: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Initialization (distance labels)

3 4

3 3

34

2

143

00

00

0

3 4

3 3

34

2

1

6

0

0

0

003 4

Recall: s must be disconnected from t when d(s) = n, and the labeling is valid…

0

Page 19: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Admissible arc in the residual graph

w

v

d(v) = d(w) + 1

Page 20: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

The preflow push algorithmWhile there is an active node { pick an active node v and push/relabel(v)}Push/relabel(v) { If there is an admissible arc (v,w) then {

push = min {e(v) , r(v,w)} flow from v to w } else { d(v) := min{d(w) + 1 | r(v,w) > 0} (relabel)}

Page 21: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 22: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 23: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 24: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 25: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 26: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 27: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 28: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 29: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 30: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 31: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 32: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 33: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 34: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

CorrectnessLemma 1: The source is reachable from every active vertex in the residual networkProof:

Which means that no flow enters S --A contradiction

vs

S

Assume that’s not the case:

Page 35: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Correctness (cont)Corollary: There is an outgoing residual arc incident with every active vertex

Corollary: So we can push-relabel as long as there is an active vertex

Page 36: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Correctness (cont)Lemma 2: Distance labels only increase and remain valid at all timesProof:By induction on the number of push and relabel operations.For relabel this is clear by the definition of relabelFor push:

v w

d(v) = d(w) + 1 so even if we add (w,v) to the residual network then it is still a valid labeling

Page 37: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Correctness (cont)Lemma 3: When (and if) the algorithm stops the preflow is a maximum flow

Proof: It is a flow since there is no active vertex.It is maximum since the sink is not reachable from the source in the residual network. (d(s) = n, and the labeling is valid)

Page 38: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Complexity analysis

Page 39: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Another example

Page 40: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 41: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 42: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 43: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 44: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 45: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 46: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 47: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 48: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 49: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 50: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 51: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 52: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 53: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 54: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 55: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 56: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 57: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 58: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 59: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 60: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 61: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 62: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 63: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 64: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 65: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 66: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 67: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 68: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 69: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 70: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 71: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 72: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 73: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 74: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 75: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Page 76: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Complexity analysisObservation: d(v) increases when we relabel v !

Lemma: d(v) ≤ 2n-1Proof:

vv1v2s

d(v) ≤ d(v1) + 1 ≤ d(v2) + 2 ..... ≤ d(s) + (n-1) = 2n-1

Page 77: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Complexity analysis (cont)

Lemma: The # of relabelings is (2n-1)(n-2) < 2n2

Proof:

At most 2n-1 per each node other than s and t

Page 78: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Complexity analysis (cont)

Def: Call a push saturating if min{e(v), r(v,w)} = r(v,w)Lemma: The # of saturating pushes is at most 2nmProof: Before another saturating push on (v,w), we must push from w to v.d(w) must increase by at least 2Since d(w) ≤ 2n-1, this can happen at most n

times

Page 79: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Nonsaturating pushesLemma: The # of nonsaturating pushes is at most 4n2mProof: Let Φ = Σv active d(v)

• Decreases (by at least one) by every nonsaturating push

• Increases by at most 2n-1 by a saturating push : total increase (2n-1)2nm

• Increases by each relabeling: total increase < (2n-1)(n-2)

Page 80: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

ImplementationMaintain a list of active nodes, so finding an active node is easyGiven an active node v, we need to decide if there is an admissible arc (v,w) to push on ?

v

current edge

All edges, not only those in R

Page 81: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Current edgev

current edge

If the current edge (v,w) is admissible, push on it (updating the list of active vertices)

Otherwise, advance the current edge pointerif you are on the last edge, relabel v and set the current edge to be the first one.

Page 82: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Is this implementation correct?Lemma: When we relabel v there is no admissible arc (v,w)

Proof: After we scanned (v,w) either (v,w) dropped off the residual network or d(v) ≤ d(w)If d(v) ≤ d(w) then this must be the case now since v has not been relabeled.If (v,w) became residual since it was scanned then when that happened d(w) = d(v) + 1 d(v) ≤ d(w) and this must be the case now

Page 83: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

AnalysisLemma: The total time spent at v between two relabelings of v is Δv plus O(1) per push out of v

Summary: Since we relabel v at most (2n-1) times we get that the total work at v is O(nΔv) + O(1) per push out of v.Summing over all vertices we get that the total time is O(nm) + #of pushes

O(n2m)

Page 84: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Maintain the list of active vertices as a FIFO queue (Q)Discharge the first vertex of the queue:

Discharge(v) { While v is active and hasn’t been relabeled then push/relabel(v). (If the loop stops because v is relabeled then add v to the end of Q)}

Reducing the # of nonsaturating pushes

Page 85: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

4

1

2

22

4

2

Example (FIFO order)

Page 86: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

0

6 0

04

2

Page 87: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

0

6 0

04

2

0

4

1

2

22 0

0

6 0

04

2

relabel

x y

z

u v

w

Q: z y

4

2

Page 88: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

1

6 0

04

2

0

4

1

2

22 0

1

6 0

04

2

x y

z

u v

w

Q: y z relabel

4

2

Page 89: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

1

6 2

04

2

0

4

1

2

22 0

1

6 2

04

2

x y

z

u v

w

Q: z y

push

push

4

2

Page 90: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

1

6 2

04

2

0

4

1

2

22 0

1

6 2

04

2

2

2

pushx y

z

u v

w

Q: y u

2

2

Page 91: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

1

6 2

04

2

0

4

1

2

22 0

1

6 2

04

2

2

2

2

x y

z

u v

w

Q: u z

relabel

2

2

Page 92: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

1

4

1

2

22

4

20

1

6 2

04

2

1

4

1

2

22 0

1

6 2

04

2

2

2

2

x y

z

u v

w

Q: z u

relabel

2

2

Page 93: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

1

4

1

2

22

4

20

3

6 2

04

2

0

4

1

2

22 0

3

6 2

04

2

2

2

2

x y

z

u v

w

Q: u z

Page 94: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

PassesPass 1: Until you finish discharging all vertices initially in QPass i: Until you finish discharging all vertices added to Q in pass (i-1)

Page 95: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

0

6 0

04

2

0

4

1

2

22 0

0

6 0

04

2

relabel

x y

z

u v

w

Q: z y

4

2

Page 96: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

1

6 0

04

2

0

4

1

2

22 0

1

6 0

04

2

x y

z

u v

w

Q: y z relabel

4

2

Page 97: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

1

6 2

04

2

0

4

1

2

22 0

1

6 2

04

2

x y

z

u v

w

Q: z y

4

2

End of pass 1

Page 98: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

1

6 2

04

2

0

4

1

2

22 0

1

6 2

04

2

x y

z

u v

w

Q: z y

push

push

4

2

Page 99: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

1

6 2

04

2

0

4

1

2

22 0

1

6 2

04

2

2

2

pushx y

z

u v

w

Q: y u

2

2

Page 100: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

1

6 2

04

2

0

4

1

2

22 0

1

6 2

04

2

2

2

2

x y

z

u v

w

Q: u z

2

2End of pass 2

Page 101: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

0

4

1

2

22

4

20

1

6 2

04

2

0

4

1

2

22 0

1

6 2

04

2

2

2

2

x y

z

u v

w

Q: u z

relabel

2

2

Page 102: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

1

4

1

2

22

4

20

1

6 2

04

2

1

4

1

2

22 0

1

6 2

04

2

2

2

2

x y

z

u v

w

Q: z u

relabel

2

2

Page 103: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

1

4

1

2

22

4

20

3

6 2

04

2

0

4

1

2

22 0

3

6 2

04

2

2

2

2

x y

z

u v

w

Q: u z

End of pass 3

Page 104: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

AnalysisNote that we still have the O(n2m) bound

How many passes are there ?

Let Φ = maxactive vd(v)1) If the algorithm does not relabel during a pass then Φ decreases by at least 1 (each active node at the beginning of a pass moved its excess to a vertex with lower label)2) If we relabel then Φ may increase by at most the maximum increase of a distance labelThere are at most O(n2) passes of the second kind. These passes increase Φ by at most O(n2) There are at most O(n2) passes of the first kind

Page 105: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Analysis (Cont)So we have O(n2) passes

In each pass we have at most one nonsaturating push per vertex

O(n3) nonsaturating pushes O(n3) total running time

Page 106: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

A faster implementationMaintain a (dynamic) forest of some of the admissible current edges

Page 107: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Reminder: Admissible arc in the residual graph

w

v

d(v) = d(w) + 1

Page 108: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

A faster implementationMaintain a (dynamic) forest of some of the admissible current edges

Page 109: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

A faster implementationMaintain a (dynamic) forest of some of the admissible current edges

Active guys are among the roots

Page 110: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

At a high level the algorithm is almost the same

While there is an active node in Q { Let v be the first in Q discharge(v)}

discharge(v) { While v is active and hasn’t been relabeled then Treepush/relabel(v). (If the loop stops because v is relabeled then add v to the end of Q)}

Page 111: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

A faster implementationQ: v….. discharge(v) Treepush/relabel(v)

v

w

Page 112: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Case 1: (v,w) is admissible

v

w

link(v,w,rf(v,w)),(v,c) = findmin(v), c = min(c,e(v)), addcost(v,-c) Let (u,c) = findmin(v) If c=0 cut(u) and repeatIf e(v) > 0 and v is not a root then repeat

Page 113: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Case 2: (v,w) is not admissible

v

w

a) If (v,w) is not the last edge then advance the current edge

b) If (v,w) is the last edge we relabel v and perform cut(u) for every child u of v

Page 114: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

AnalysisO(1) work + O(1) tree operations in Treepush/relabel +O(1) work + O(1) tree operations per cut

How many cuts do we do ?O(mn) (each charged to a saturating push or a relabel)

How many times do we call Treepush/relabel ?O(mn), in each we either advance the current edge or do a link (there are O(mn) links since there are O(mn) cuts)

Page 115: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Analysis (Cont)

Summary: we do O(mn) dynamic tree operations

We’ll see how to do those in O(log n) each so we get running time of O(mnlog n)

Page 116: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Can we improve on that ?Notice that we have not really used the fact that Q is a queue, any list would do !

Page 117: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Idea: Don’t let the trees to grow too large

Case 1: (v,w) is admissible

v

w

link(v,w,rf(v,w)),(v,c) = findmin(v), c = min(c,e(v)), addcost(v,-c) Let (u,c) = findmin(v) If c=0 cut(u) and repeatIf e(v) > 0 and v is not a root then repeat

We won’t do the link if we are about to create a too large tree (say larger than k)

Page 118: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

If we are about to create a tree with at least k vertices

v

w

Push from v to w min{e(v),rf(v,w)} flow(w,c) = findmin(w), c = min(c,e(w)), addcost(w,-c) Let (u,c) = findmin(w) If c=0 cut(u) and repeatIf e(w) > 0 and w is not a root then repeat

Page 119: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

What collapses in our analysis ?There are calls to Treepush/relabel that we cannot charge to links (or cuts)

v

r

w

So we cannot say that the # of Treepush/relabels is O(mn)

Page 120: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

How do we recover ?

v

r

w

May assume that the push from v is not saturating..(there are only O(nm) saturating ones) v is not active after such Treepush/relabel We are going to bound the # of such Treepush/relabels by the # of times a node may become active

Page 121: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Activating nodesWhen does a node become active ?

v

r

w

• In Treepush/relabel. We know that there are O(mn) of them except for nonsaturating ones, that do not link/cut.

So we can further focus on those problematic Treepush/relabels that make r active

Page 122: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Concluding

v

r

w

May assume that v becomes inactive and r becomes active and the push is not saturating and does not link so

TvTr

Either Tv or Tr is large: ≥ k/2We charge the large tree.

Page 123: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

v

r

w

Since the root of the tree that we charge either becomes active or inactive each tree is charged at most twice in a phase

TvTr

If the tree did not exist at the beginning of the phase then further deliver the charge it to the link or cut that created it

Page 124: Maximum flow: The preflow/push method of Goldberg and Tarjan (87)

Each link is charged once, a cut is charged twice O(mn) such charges over all phases.

At the beginning of a phase we have O(n/k) large trees, each charged once O(n3/k)

So we get that nodes get activated at most O(mn + n3/k) times

For k=n2/m we get the bound of O(mnlog(n2/m))

This also bounds the # of Treepush/relabels and the # of dynamic tree operations