Presentation is loading. Please wait.

Presentation is loading. Please wait.

Class Plan 2-1.Minimum Spanning Tree 最小木

Similar presentations


Presentation on theme: "Class Plan 2-1.Minimum Spanning Tree 最小木"— Presentation transcript:

1 Class Plan 2-1.Minimum Spanning Tree 最小木
1-1.Graph  グラフ 1-2.Graph Search グラフ探索 + some graph properties 1-3.Network Flow  ネットワーク・フロー 1-4.Algorithms&Complexity アルゴリズムと計算量   2-1.Minimum Spanning Tree 最小木    ( + data structures and sorting データ構造,整列)  2-2.Matroid マトロイド 3-0. Shortest path 最短路 3-1. Maximum Flow 最大流 3-2. Minimum Cost Flow 最小費用流  ?4-1. Approximation algorithm 近似解法 ?4-2. Heuristics ヒューリスティック 

2 Network Flows Variants in flows classical , traditional (?)
generalized flow multicommodity flow dynamic flow maximum flow minimum cost flow Problem Formulation Optimality condition (Algorithm)

3 Maximum Flow Problem (最大流問題)
Given : directed graph G=(V,A) total out flow from s Find : which satisfies flow bound constraints : (容量制約) and mass balance constraints :  (流量保存制約) = v  feasible flow(可能流) : a flow satisfying the above two constraints  maximum flow(最大流) : a feasible flow maximizing

4 Are the following flows feasible/maximum ?
Example capacity instance 3 4 5 2 s 3 4 t 出口 入口 4 3 2 Are the following flows feasible/maximum ? 3 1 4 2 s t 3 4 2 1 s t 2) 3) 3 4 2 1 s t 1) 4) 5) 3 3 4 4 4 3 2 2 s 1 1 1 t s 2 t 4 4 4 3 3 2

5 For evaluate a bottleneck of flow value …
s-t cut : capacity of an s-t cut 3 3 4 4 5 5 2 2 s 3 4 t s 3 4 t 4 3 4 3 2 2 total out flow from s : v≠s

6 Feasible flow and s-t cut
total out flow from s :

7 Maximum-flow Minimum-cut Theorem
Total out flow ∂φ(s) ≦ capacity of δ+(X) Maximum-flow Minimum-cut Theorem (Corollary 4.2) (s-t cut with minimum capacity) Ford-Fulkerson(1956)

8 Augmenting path method(偽)
step0: Augmenting path step1: instance capacity s 2 step2: ε 4 2 1 2 3 3 ε t 1 3 flow: s s 2 s 2 1 2 2 t t t 2 3 s 2 2 1 2 ? There is no s-t directed path. 1 t 3

9 cap ☆ residual network :reverse arc of a
2 4 s 2 +1 s 2 1 2 1 2 3 3 2 1 2 1 2 -1 1 1 3 t 1 +1 2 t t 3 -1 2 s 2 1 2 1 1 1 ☆ residual network 2 t 1 3 :reverse arc of a arcs represent the possibility of pushing flow back on arcs s 2 4 2 2 1 2 1 1 2 1 3 t

10 Augmenting path method (本物)
step0: step1: construct a residual network step2: Find an s-t directed path P in If there is no such a path … step3: compute and update flow along P Go to step1. ← augmenting path ε cap s 2 4 2 1 2 3 3 1 3 t s 2 s 2 1 2 1 2 1 2 1 1 1 2 t t 3 1 3 s 2 4 s 2 3 1 no augmenting path 2 1 2 2 1 2 1 2 2 1 1 1 2 1 1 1 3 t 1 3 t

11 When no augmenting path exists …
: feasible flow There is no s-t directed path (augmenting path ) in s s t t X X : set of vertices reachable from s → s-t cut total out flow from s “Maximum “

12 Maximum-flow Minimum-cut Theorem
Optimality condition Theorem4.1 (Augmenting path theorem) A feasible flow φ is maximum ⇔ there is no augmenting path in ⇒) If there is an augmenting path in …..   ) proved Maximum-flow Minimum-cut Theorem (s-t cut with minimum capacity) Ford-Fulkerson(1956)

13 Max … min… duality Max flow problem Min cut problem
Subject to Show the dual problem Show the complementary slackness condition

14 Review of LP (dual problem)
Example: Maximize 4x1+x2+3x3 Subject to x1- x2- x3= 1 2x1+x2+2x3≦13 x1, x2, x3≧0 A (quick) estimate of the optimal value (upper bound) Since x1, x2, x3 are nonnegative, Obj func. = 4x1+x2+3x3 ≦ 4x1+2x2+4x3≦26 2nd constraint ×2 Obj func. = 4x1+x2+3x3 ≦ 5x1+x2+3x3≦27 2nd constraint ×2 + 1st constraint

15 Review of LP (dual problem)
Example: Maximize 4x1+x2+3x3 Subject to x1- x2- x3= 1 2x1+x2+2x3≦13 x1, x2, x3≧0 Linear combination 1st constraint ×y1 + 2nd constraint ×y2 (y1+2y2)x1+ (-y1+y2)x2 +(-y1+2y2)x3 ≦ y1+13y2 We need y2 ≧0 y1+2y2 ≧ 4 -y1+y2 ≧1 -y1+2y2 ≧3 If coefficient of each xi is at least as big as the corresponding coefficient in obj. function. then obj. function ≦ y1+13y2

16 Review of LP (dual problem)
primal The dual of the dual problem is always the primal problem

17 Review of LP (duality theorem)
: primal opt. sol ⇒ There exists : dual opt. sol s.t.

18 Review of LP (complementary slackness)
: primal feasible sol : dual feasible sol : opt. solutions (proof) Form

19 Augmenting path method (complexity)
Analyze the worst case time complexity for the augmenting path method step0: step1: construct a residual network step2: Find an augmenting path P in If there is no such a path, stop. step3: compute and update flow along P Go to step1. ε

20 Instance 1 M M s 1 t M-1 M M M-1 1 1 s 1 t 1 1 residual network M-1
capacity M M s 1 t M-1 M M M-1 1 1 s 1 t 1 1 residual network M-1 M-1 M M-1 M M 1 s 1 s 1 t t 1 M M-1 M M Number of iterations : ?

21 Instance 2 M 1 3 1 M M r 1 t s M M 2 4 M P1=(s,2,1,3,4,t)
Find maximum flow If the algorithm chooses augmenting path as P1, P2, P1, P3, P1, P2, P1, P3, ,,, how many iterations the algorithm performs?

22 Rules for selecting augmenting paths
Maximum capacity augmenting path … Find an augmenting path maximizing α ε Max capacity augmenting path algo. Capacity scaling algo. MA ordering algo. Minimum length augmenting path … Find an augmenting path with least edges Min length augmenting path algo. Dinitz’s blocking flow algo.

23 Max capacity augmenting path algo.
step0: step1: construct a residual network step2: Find an augmenting path P in If there is no such a path, stop. step3: compute and update flow along P Go to step1. An s-t directed path maximize min{uφ(a)|a∈A(P)} ε

24 Max capacity augmenting path algo.(complexity)
※ integer capacity Opt. flow A flow Flow obtained by updating along a max cap. aug. path The number of iteration O(m log(nU)) × maxmin type shortest path U=max{u(a)|a∈A}

25 Capacity scaling algorithm
※ integer capacity Bit scaling Capacity of kth scaling phase φ ←2φ kth scaling phase find a maximum fow φw.r.t uk (k+1)th scaling phase find a maximum fow φw.r.t uk+1 s 5 5 s 101 101 3 1 011 2 2 001 101 3 010 5 010 011 t 4 3 t 100 011 K=3 (log25=2.32…)

26 Capacity scaling algorithm
101 101 uk(a)=2uk-1(a) or 2uk-1(a)+1 011 001 101 010 010 011 t 100 011 u1 u2 u3 s 1 1 s 10 10 s 101 101 1 01 011 00 10 001 101 01 010 01 010 01 011 t 1 t t 10 01 100 011 Max flow ×2 1 1 1 t Max flow t

27 Capacity scaling algorithm(complexity)
Step0: φ:=0, k:=1 Step1: [k scaling phase] find a maximum flow φ with respect to uk Step2: If k=K, then stop. Else k:=k+1, φ:=2φ, and go to step 1. uk(a)=2uk-1(a) or 2uk-1(a)+1 Max flow ×2 1 1 Min cut value in the auxiliary network: ≦m (the number of cut edges) 1 t Max flow t

28 Minimum length augmenting path

29 Other algorithms Push-relabel algorithm preflow flow bound constraints
Network simplex algorithm preflow flow bound constraints No augmenting path mass balance constraints

30 Max flow on planar graph
s-t planar graph … the graph added the arc (t, s) is still planar 2 1 3 4 s t capacity s-t cut = s*-t* path min cut = shortest path

31 Class Plan 2-1.Minimum Spanning Tree 最小木
1-1.Graph  グラフ 1-2.Graph Search グラフ探索 + some graph properties 1-3.Network Flow  ネットワーク・フロー 1-4.Algorithms&Complexity アルゴリズムと計算量   2-1.Minimum Spanning Tree 最小木    ( + data structures and sorting データ構造,整列)  2-2.Matroid マトロイド 3-1. Maximum Flow 最大流 3-2. Minimum Cost Flow 最小費用流  ?4-1. Approximation algorithm 近似解法 ?4-2. Heuristics ヒューリスティック 

32 minimum circulation problem (最小費用循環流問題)
Given: directed graph G=(V,A) capacity u: A → R+ cost c: A → R Find : flow :A → R+ minimizing total cost which satisfies ・flow bound constraints and ・mass balance constraints feasible flow minimum cost flow

33 Example (cap,cost) instance (3,-1) (4,3) (3,0) (2,2) (1,-1) (1,-3)
(2,1) (4,2) 3 1 2 1 1 1 2 1 1 2 1 2 total cost = 0 total cost = -2 total cost = 12

34 residual network w.r.t. a flow
:reverse arc of a arcs represent the possibility of pushing flow back on arcs

35 optimality condition (negative cycle…)
Let be a feasible flow The following statements are equivalent : MCF-(a) : is minimum cost flow MCF-(b) : the residual network does not have any negative-cost cycles MCF-(c) : There exists π:V → R such that holds for every directed cycle C with

36 (a) ⇒(b) If the residual network has a negative cost cycle, … (b) ⇒(a) : a flow satisfying (b) : optimal flow : feasible flow in can be decomposed into cycles in ⇒  is optimal

37 negative cycle canceling algorithm
step0 : = 0 step1 : construct the residual network step2 : Find a negative-cost cycle C in If there is no such a cycle, stop. step3 : compute and update flow along C. Go to step1. Shortest path algorithm (cap,cost) (3,-1) (4,3) (3,0) (2,2) (1,-1) (1,-3) 1 (2,2) (2,1) (4,2) 1 1 residual network optimal (2,-1) (3,-1) (1,1) (3,0) (4,3) (3,0) (4,3) (2,2) (1,2) (1,-2) (1,-1) (1,-1) (1,-3) (1,3) (2,2) (2,2) (2,1) (2,1) (4,2) (4,2)

38 LP form Minimize Subject to Show the dual problem
Show the complementary slackness condition Compare to optimality conditions

39 Optimality condition (reduced cost)
potential Kilter diagram u(a)

40 Modified network w.r.t. p G=(V, A) Modified capacity

41 Optimality condition (positive cut)
A potential p is dual optimal if and only if in the modified network w.r.t. p any cut δ(X) satisfies Positive cut : a cut with

42 Positive cut canceling algorithm
step0 : p: any potential step1 : construct the modified network step2 : Find a positive cut in modified network If there is no such a cut, stop. step3 : compute and update potential Go to step1. Max flow algorithm (cap,cost) (3,-1) (4,3) (3,0) (2,2) (1,-1) (1,-3) 1 (2,2) (2,1) (4,2) 1 (0, 3)0 (0, 3)0 (3, 3)-1 (0, 0)3 (0, 3)0 1 (0, 0)3 (0, 3)0 (0, 0)2 (0, 1)0 1 (0, 3)0 (0, 0)3 (1, 1)-4 (0, 0)2 (1, 1)-1 (0, 2)0 (1, 1)-3 (0, 0)2 (0, 2)0 (0, 1)0 1 (0, 0)1 (1, 1)-2 (0, 0)2 (0, 0)2 (0, 2)0 (0, 2)0 (0, 0)2 2 modified network (Ip,up)cp (0, 0)4

43 Other algorithms Primal dual algorithm Network simplex algorithm
+Scaling technique


Download ppt "Class Plan 2-1.Minimum Spanning Tree 最小木"

Similar presentations


Ads by Google