1 Maximum flow problems. 2 - Introduction of: network, max-flow problem capacity, flow - Ford-Fulkerson method pseudo code, residual networks, augmenting.

Slides:



Advertisements
Similar presentations
Maximum flow Main goals of the lecture:
Advertisements

1 Review of some graph algorithms Graph G(V,E) (Chapter 22) –Directed, undirected –Representation Adjacency-list, adjacency-matrix Breadth-first search.
Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
MAXIMUM FLOW Max-Flow Min-Cut Theorem (Ford Fukerson’s Algorithm)
The Maximum Network Flow Problem. CSE Network Flows.
Advanced Algorithm Design and Analysis (Lecture 8) SW5 fall 2004 Simonas Šaltenis E1-215b
Chapter 26 of CLSR Maximum Network Flow by me Dr. M. Sakalli Ch26 of CSLR and many other sources. Marmara Univ. Picture taken from without permission.
1 The Max Flow Problem. 2 Flow networks Flow networks are the problem instances of the max flow problem. A flow network is given by 1) a directed graph.
CS138A Network Flows Peter Schröder. CS138A Flow Networks Definitions a flow network G=(V,E) is a directed graph in which each edge (u,v)
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2001 Lecture 4 Tuesday, 2/19/02 Graph Algorithms: Part 2 Network.
1 Maximum Flow Maximum Flow Problem The Ford-Fulkerson method Maximum bipartite matching.
1 Optimization Spring 2007 (Third Quarter). 2 Some practical remarks Homepage: Exam: Written, 3 hours. There.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 4 Tuesday, 10/2/01 Graph Algorithms: Part 2 Network.
The max flow problem
Yangjun Chen 1 Network Flow What is a network? Flow network and flows Ford-Fulkerson method - Residual networks - Augmenting paths - Cuts of flow networks.
Chapter 27 Maximum Flow Maximum Flow Problem The Ford-Fulkerson method m bipartite matching.
Flows sourcesink s t Flows sourcesink edge-weights = capacities.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2006 Lecture 5 Wednesday, 10/4/06 Graph Algorithms: Part 2.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2004 Lecture 5 Wednesday, 10/6/04 Graph Algorithms: Part 2.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
1 Ford-Fulkerson method Ford-Fulkerson(G) f = 0 while( 9 simple path p from s to t in G f ) f := f + f p output f Runs in time O(|f max | |E|) where f.
Maximum Flow Maximum Flow Problem The Ford-Fulkerson method
1 The Min Cost Flow Problem. 2 The Min Cost Flow problem We want to talk about multi-source, multi-sink flows than just “flows from s to t”. We want to.
Flow Networks Formalization Basic Results Ford-Fulkerson Edmunds-Karp Bipartite Matching Min-cut.
Maximum Flow Chapter 26.
Yangjun Chen 1 Network Flow What is a network? Flow network and flows Ford-Fulkerson method - Residual networks - Augmenting paths - Cuts of flow networks.
Announcements Network Flow today, depending on how far we get, we will do String Matching on Wednesday Then Review for Final next Monday This week’s lab.
Single Source Shortest-Path: The General Case (with negative edges) Bellman-Ford algorithm. Iteratively relax all edges |V|-1 times Running time? O(VE).
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Finding Max Flow.
Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm.
Maximum Flow. p2. Maximum Flow A flow network G=(V, E) is a DIRECTED graph where each has a nonnegative capacity u.
Max Flow – Min Cut Problem. Directed Graph Applications Shortest Path Problem (Shortest path from one point to another) Max Flow problems (Maximum material.
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Flow Networks & Flows.
Maximum Flow Chapter 26. Flow Concepts Source vertex s – where material is produced Sink vertex t – where material is consumed For all other vertices.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
Chapter 7 May 3 Ford-Fulkerson algorithm Step-by-step walk through of an example Worst-case number of augmentations Edmunds-Karp modification Time complexity.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Flow Networks Ching-Chen Huang Hsi-Yue Hsiao. CONTENTS Network flows on directed acyclic graphs Ford-fulkerson Algorithms -Residual networks.
1 Network Flow CSC401 – Analysis of Algorithms Chapter 8 Network Flow Objectives: Flow networks –Flow –Cut Maximum flow –Augmenting path –Maximum flow.
Fall 2003Maximum Flow1 w s v u t z 3/33/3 1/91/9 1/11/1 3/33/3 4/74/7 4/64/6 3/53/5 1/11/1 3/53/5 2/22/2 
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
A directed graph G consists of a set V of vertices and a set E of arcs where each arc in E is associated with an ordered pair of vertices from V. V={0,
Maximum Flow Problem Definitions and notations The Ford-Fulkerson method.
Instructor Neelima Gupta Edited by Divya Gaur(39, MCS '09) Thanks to: Bhavya(9), Deepika(10), Deepika Bisht(11) (MCS '09)
The Maximum Network Flow Problem
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Network Flow What is a network? Flow network and flows
Maximum Flow Chapter 26.
The Maximum Network Flow Problem
Maximum Flow Chapter 26.
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Graph Algorithms Minimum Spanning Tree (Chap 23)
CS4234 Optimiz(s)ation Algorithms
Network flow problem [Adapted from M.Chandy].
Network Flow 2016/04/12.
Edmonds-Karp Algorithm
Network Flows and Matching (Supplementary)
Lecture 10 Network flow Max-flow and Min-cut Ford-Fulkerson method
Flow Networks Topics Flow Networks Residual networks
Richard Anderson Lecture 21 Network Flow
Network Flows and Matching (Supplementary)
Flow Networks General Characteristics Applications
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
Text Book: Introduction to algorithms By C L R S
Lecture 21 Network Flow, Part 1
Lecture 21 Network Flow, Part 1
Richard Anderson Lecture 22 Network Flow
Advanced Graph Homer Lee 2013/10/31.
Presentation transcript:

1 Maximum flow problems

2 - Introduction of: network, max-flow problem capacity, flow - Ford-Fulkerson method pseudo code, residual networks, augmenting paths cuts of networks max-flow min-cut theorem example of an execution analysis, running time, variations of the max-flow problem

3 Introduction – flow network Practical examples of a flow network - liquids flowing through pipes - parts through assembly lines - current through electrical network - information through communication network - goods transported on the road…

4 Introduction – flow network Example: oil pipelineRepresentation Flow network: directed graph G=(V,E) S t v1 v2 v3 v4 S t v1 v2 v3 v4 source sink

5 Introduction – max-flow problem Representation Flow network: directed graph G=(V,E) S t v1 v2 v3 v4 S t v1 v2 v3 v4 source sink Informal definition of the max-flow problem: What is the greatest rate at which material can be shipped from the source to the sink without violating any capacity contraints? Example: oil pipeline

6 Introduction - capacity S t v1 v2 v3 v4 Representation Flow network: directed graph G=(V,E) S t v1 v2 v3 v4 uv 12 uv 6 c(u,v)=12 c(u,v)=6 Big pipe Small pipe Example: oil pipeline

7 Introduction - capacity S t v1 v2 v3 v4 Representation Flow network: directed graph G=(V,E) S t v1 v2 v3 v Example: oil pipeline v4 v2 v3 v4 If (u,v)  E  c(u,v) =

8 Introduction – flow S t v1 v2 v3 v4 Representation Flow network: directed graph G=(V,E) S t v1 v2 v3 v4 uv 6/12 uv 6/6 f(u,v)=6 Flow below capacity Maximum flow Example: oil pipeline

9 Introduction – flow S t v1 v2 v3 v4 Representation Flow network: directed graph G=(V,E) S t v1 v2 v3 v Example: oil pipeline

10 Introduction – flow S t v1 v2 v3 v4 Representation Flow network: directed graph G=(V,E) S t v1 v2 v3 v /8 6/6 3 3 Example: oil pipeline

11 Introduction – flow S t v1 v2v4 v3 Representation Flow network: directed graph G=(V,E) S t v1 v2 v3 v /8 6/6 3 3 Example: oil pipeline

12 Introduction – flow S t v1 v2v4 v3 Representation Flow network: directed graph G=(V,E) S t v1 v2 v3 v4 3/8 3/3 3/6 6/8 6/6 3 3 Example: oil pipeline

13 Introduction – flow S t v1 v2v4 v3 Representation Flow network: directed graph G=(V,E) S t v1 v2 v3 v4 3/8 3/3 3/6 6/8 6/6 3 3 Example: oil pipeline

14 Introduction – flow S t v1 v2v4 v3 Representation Flow network: directed graph G=(V,E) S t v1 v2 v3 v4 5/8 3/3 3/6 8/8 6/6 2/3 3 Example: oil pipeline

15 Introduction – cancellation S t v1 v2v4 v3 Representation Flow network: directed graph G=(V,E) S t v1 v2 v3 v4 5/8 3/3 3/6 8/8 6/6 2/3 3 Example: oil pipeline

16 Introduction – cancellation S t v1 v2v4 v3 Representation Flow network: directed graph G=(V,E) S t v1 v2 v3 v4 6/8 3/3 4/6 8/8 5/6 6/6 3/3 1/3 u v 104 u v 8/104 u v 3/4 u v 5/104 Example: oil pipeline

17 Flow properties

18 Flow properties St v1 v2 v3 v4 10 8/13 12/12 11/16 1/4 4/4 11/14 15/20 7/7 4/9 Flow network G = (V,E) Note: by skew symmetry f (v3,v1) = - 12

19 Net flow and value of a flow S t v1 v2 v3 v4 6/8 3/3 4/6 8/8 5/6 6/6 3/3 1/3 u v 8/103/4 u v 5/104 f(u,v) = 5 f(v,u) = -5

20 The max-flow problem Informal definition of the max-flow problem: What is the greatest rate at which material can be shipped from the source to the sink without violating any capacity contraints? Formal definition of the max-flow problem: The max-flow problem is to find a valid flow for a given weighted directed graph G, that has the maximum value over all valid flows.

21 The Ford-Fulkerson method a way how to find the max-flow This method contains 3 important ideas: 1) residual networks 2) augmenting paths 3) cuts of flow networks

22 Ford-Fulkerson – pseudo code 1 initialize flow f to 0 2 while there exits an augmenting path p 3 do augment flow f along p 4 return f

23 Ford Fulkerson – residual networks St v1 v2 v3 v4 10 8/13 12/12 11/16 1/4 4/4 11/14 15/20 7/7 4/9 The residual network G f of a given flow network G with a valid flow f consists of the same vertices v  V as in G which are linked with residual edges (u,v)  E f that can admit more strictly positive net flow. The residual capacity c f represents the weight of each edge E f and is the amount of additional net flow f(u,v) before exceeding the capacity c(u,v) Flow network G = (V,E) c f (u,v) = c(u,v) – f(u,v) St v1 v2 v3 v4 residual network G f = (V,E f )

24 Ford Fulkerson – residual networks St v1 v2 v3 v4 10 8/13 12/12 11/16 1/4 4/4 11/14 15/20 7/7 4/9 Flow network G = (V,E) c f (u,v) = c(u,v) – f(u,v) St v1 v2 v3 v4 residual network G f = (V,E f ) The residual network G f of a given flow network G with a valid flow f consists of the same vertices v  V as in G which are linked with residual edges (u,v)  E f that can admit more strictly positive net flow. The residual capacity c f represents the weight of each edge E f and is the amount of additional net flow f(u,v) before exceeding the capacity c(u,v)

25 Ford Fulkerson – augmenting paths St v1 v2 v3 v4 10 8/13 12/12 11/16 1/4 4/4 11/14 15/20 7/7 4/9 c f (p) = min{c f (u,v): (u,v) is on p} Flow network G = (V,E)residual network G f = (V,E f ) Definition: An augmenting path p is a simple (free of any cycle) path from s to t in the residual network G f Residual capacity of p St v1 v2 v3 v

26 Ford Fulkerson – augmenting paths St v1 v2 v3 v4 10 8/13 12/12 11/16 1/4 4/4 11/14 15/20 7/7 4/9 c f (p) = min{c f (u,v): (u,v) is on p} Flow network G = (V,E) St v1 v2 v3 v residual network G f = (V,E f ) Definition: An augmenting path p is a simple (free of any cycle) path from s to t in the residual network G f Residual capacity of p Augmenting path

27 Ford Fulkerson – augmenting paths St v1 v2 v3 v4 10 8/13 12/12 11/16 1/4 4/4 11/14 15/20 7/7 4/9 Flow network G = (V,E) St v1 v2 v3 v residual network G f = (V,E f ) We define a flow: f p : V x V  R such as: c f (p) if (u,v) is on p f p (u,v) = - c f (p) if (v,u) is on p 0 otherwise

28 Ford Fulkerson – augmenting paths St v1 v2 v3 v4 10 8/13 12/12 11/16 1/4 4/4 11/14 15/20 7/7 4/9 Flow network G = (V,E) St v1 v2 v3 v / /5 7 -4/5 residual network G f = (V,E f ) 11 4/ /15 4/4 Our virtual flow f p along the augmenting path p in G f c f (p) if (u,v) is on p f p (u,v) = - c f (p) if (v,u) is on p 0 otherwise We define a flow: f p : V x V  R such as:

29 Ford Fulkerson – augmenting the flow St v1 v2 v3 v /13 12/12 11/16 1/4 4/4 11/14 19/20 7/7 0/9 Flow network G = (V,E) St v1 v2 v3 v /5 7 5 residual network G f = (V,E f ) 11 4/ /4 Our virtual flow f p along the augmenting path p in G f New flow: f´: V x V  R : f´=f + f p c f (p) if (u,v) is on p f p (u,v) = - c f (p) if (v,u) is on p 0 otherwise We define a flow: f p : V x V  R such as:

30 Ford Fulkerson – new valid flow proof of capacity constraint Proof: f p (u,v) < c f (u,v) = c (u,v) – f (u,v)  (f + f p ) (u,v) = f (u,v) + f p (u,v) < c (u,v) Lemma: f´ : V x V  R : f´ = f + f p in G Capacity constraint: For all u,v  V, we require f(u,v) < c(u,v) c f (p) if (u,v) is on p f p (u,v) = - c f (p) if (v,u) is on p 0 otherwise c f (p) = min{c f (u,v): (u,v) is on p} c f (u,v) = c(u,v) – f(u,v)

31 Ford Fulkerson – new valid flow proof of Skew symmetry Proof: (f + f p )(u,v) = f (u,v) + f p (u,v) = - f (v,u) – f p (v,u) = - (f (v,u) + f p (v,u)) = - (f + f p ) (v,u) Skew symmetry: For all u,v  V, we require f(u,v) = - f(v,u) Lemma: f´ : V x V  R : f´ = f + f p in G

32 Ford Fulkerson – new valid flow proof of flow conservation Proof: u  V – {s,t}   (f + f p ) (u,v) =  (f(u,v) + f p (u,v)) =  f (u,v) +  f p (u,v) = = 0 Flow conservation: For all u  V \ {s,t} :  f(u,v) = 0 v  V Lemma: f´ : V x V  R : f´ = f + f p in G

33 Ford Fulkerson – new valid flow Proof: | (f + f p ) | =  (f + f p ) (s,v) =  (f (s,v) + f p (s,v)) =  f (s,v) +  f p (s,v) = | f | + | f p | Lemma: | (f + f p ) | = | f | + | f p | v  V Value of a Flow f: Def: |f| =  f(s,v) v  V

34 Ford Fulkerson – new valid flow Lemma: | (f + f p ) | = | f | + | f p | > | f | f´ : V x V  R : f´ = f + f p in G Lemma shows: if an augmenting path can be found then the above flow augmentation will result in a flow improvement. Question: If we cannot find any more an augmenting path is our flow then maximum? Idea: The flow in G is maximum  the residual G f contains no augmenting path.

35 Ford Fulkerson – cuts of flow networks New notion: cut (S,T) of a flow network A cut (S,T) of a flow network G=(V,E) is a partiton of V into S and T = V \ S such that s  S and t  T. Implicit summation notation: f (S, T) =   f (u, v) St v1 v2 v3 v /13 12/12 11/16 1/4 4/4 19/20 7/7 0/9 11/14 TS In the example: S = {s,v1,v2), T = {v3,v4,t} Net flow f(S,T) = f(v1,v3) + f(v2,v4) + f(v2,v3) = (-0) = 23 Capacity c(S,T) = c(v1,v3) + c(v2,v4) = = 26 Practical example u  S v  T

36 Ford Fulkerson – cuts of flow networks Lemma: the value of a flow in a network is the net flow across any cut of the network f (S,T) = | f | St v1 v2 v3 v /13 12/12 11/16 1/4 4/4 19/20 7/7 0/9 11/14 proof

37 Ford Fulkerson – cuts of flow networks Assumption: The value of any flow f in a flow network G is bounded from above by the capacity of any cut of G Lemma: | f | < c (S, T) | f | = f (S, T) =   f (u, v) <   c (u, v) = c (S, T) v  T u  S v  T u  S St v1 v2 v3 v /13 12/12 11/16 1/4 4/4 19/20 7/77/7 0/9 11/14

38 F. Fulkerson: Max-flow min-cut theorem If f is a flow in a flow network G = (V,E) with source s and sink t, then the following conditions are equivalent: 1.f is a maximum flow in G. 2.The residual network G f contains no augmenting paths. 3.| f | = c (S, T) for some cut (S, T) of G. proof: (1)  (2): We assume for the sake of contradiction that f is a maximum flow in G but that there still exists an augmenting path p in G f. Then as we know from above, we can augment the flow in G according to the formula: f´= f + f p. That would create a flow f´that is strictly greater than the former flow f which is in contradiction to our assumption that f is a maximum flow.

39 F. Fulkerson: Max-flow min-cut theorem If f is a flow in a flow network G = (V,E) with source s and sink t, then the following conditions are equivalent: 1.f is a maximum flow in G. 2.The residual network G f contains no augmenting paths. 3.| f | = c (S, T) for some cut (S, T) of G. proof: (2)  (3): S t v1 v2 v3 v4 6/8 3/3 4/6 8/8 5/6 6/6 3/3 1/3 S t v1 v2 v3 v residual network G f original flow network G

40 F. Fulkerson: Max-flow min-cut theorem If f is a flow in a flow network G = (V,E) with source s and sink t, then the following conditions are equivalent: 1.f is a maximum flow in G. 2.The residual network G f contains no augmenting paths. 3.| f | = c (S, T) for some cut (S, T) of G. proof: (2)  (3): Define S = {v  V |  path p from s to v in G f } T = V \ S (note t  S according to (2)) S t v1 v2 v3 v residual network G f

41 F. Fulkerson: Max-flow min-cut theorem If f is a flow in a flow network G = (V,E) with source s and sink t, then the following conditions are equivalent: 1.f is a maximum flow in G. 2.The residual network G f contains no augmenting paths. 3.| f | = c (S, T) for some cut (S, T) of G. proof: (2)  (3): Define S = {v  V |  path p from s to v in G f } T = V \ S (note t  S according to (2))  for  u  S, v  T: f (u, v) = c (u, v) (otherwise (u, v)  E f and v  S)  | f | = f (S, T) = c (S, T) 1 S t v1 v2 v3 v4 6/8 3/3 4/6 8/8 5/6 6/6 3/3 1/3 original network G

42 F. Fulkerson: Max-flow min-cut theorem If f is a fow in a flow network G = (V,E) with source s and sink t, then the following conditions are equivalent: 1.f is a maximum flow in G. 2.The residual network G f contains no augmenting paths. 3.| f | = c (S, T) for some cut (S, T) of G. proof: (3)  (1): as proofed before | f | = f (S, T) < c (S, T) the statement of (3) : | f | = c (S, T) implies that f is a maximum flow

43 The basic Ford Fulkerson algorithm

44 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f

45 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v4 0/10 0/13 0/12 0/16 0/4 0/14 0/20 7 0/9 (residual) network G f

46 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f

47 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f temporary variable: c f (p) = 12

48 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f temporary variable: c f (p) = 12 St v1 v2 v3 v /12 12/ / new flow network G

49 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f St v1 v2 v3 v /12 12/ / new flow network G 12

50 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f St v1 v2 v3 v /12 12/ / new flow network G 12

51 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f St v1 v2 v3 v /12 12/ / new flow network G 12

52 The basic Ford Fulkerson algorithm example of an execution (residual) network G f St v1 v2 v3 v /12 12/ / new flow network G temporary variable: c f (p) = 4 St v1 v2 v3 v

53 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f St v1 v2 v3 v4 10 4/13 12/12 12/16 4 4/4 4/14 12/ new flow network G 12 temporary variable: c f (p) = 4

54 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f St v1 v2 v3 v4 10 4/13 12/12 12/16 4 4/4 4/14 12/ new flow network G

55 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f St v1 v2 v3 v4 10 4/13 12/12 12/16 4 4/4 4/14 12/ new flow network G

56 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f St v1 v2 v3 v4 10 4/13 12/12 12/16 4 4/4 4/14 12/ new flow network G

57 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f St v1 v2 v3 v4 10 4/13 12/12 12/16 4 4/4 4/14 12/ new flow network G temporary variable: c f (p) = 7

58 The basic Ford Fulkerson algorithm example of an execution St v1 v2 v3 v (residual) network G f St v1 v2 v3 v /13 12/12 12/16 4 4/4 11/14 19/20 7/7 9 new flow network G temporary variable: c f (p) = 7

59 The basic Ford Fulkerson algorithm example of an execution (residual) network G f St v1 v2 v3 v /13 12/12 12/16 4 4/4 11/14 19/20 7/7 9 new flow network G St v1 v2 v3 v

60 The basic Ford Fulkerson algorithm example of an execution (residual) network G f St v1 v2 v3 v /13 12/12 12/16 4 4/4 11/14 19/20 7/7 9 new flow network G St v1 v2 v3 v Finally we have: | f | = f (s, V) = 23

61 Analysis of the Ford Fulkerson algorithm Running time The running time depends on how the augmenting path p in line 4 is determined.

62 Analysis of the Ford Fulkerson algorithm Running time (arbitrary choice of p) O(|E|) O(|E| |f max |) running time: O ( |E| |f max | ) with f max as maximum flow (1) The augmenting path is chosen arbitrarily and all capacities are integers O(|E|)

63 Analysis of the Ford Fulkerson algorithm Running time (arbitrary choice of p) (1) The augmenting path is chosen arbitrarily and all capacities are integers Consequencies of an arbitrarily choice: Example if |f*| is large: t v2 v1 s 1,000,000 1 running time: O ( |E| |f max | ) with f max as maximum flow

64 Analysis of the Ford Fulkerson algorithm Running time (arbitrary choice of p) (1) The augmenting path is chosen arbitrarily and all capacities are integers Consequencies of an arbitrarily choice: Example if |f*| is large: t v2 v1 s 1 / 1,000,000 1,000,000 1 / 1,000,000 1 / 1 t v2 v1 s 999,999 1,000, ,999 1 residual network G f 1 1 running time: O ( |E| |f max | ) with f max as maximum flow

65 Analysis of the Ford Fulkerson algorithm Running time (arbitrary choice of p) (1) The augmenting path is chosen arbitrarily and all capacities are integers Consequencies of an arbitrarily choice: Example if |f*| is large: t v2 v1 s 1 / 1,000,000 1 t v2 v1 s 999,999 1 residual network G f running time: O ( |E| |f max | ) with f max as maximum flow

66 Analysis of the Ford Fulkerson algorithm Running time with Edmonds-Karp algorithm running time: O ( |V| |E|² ) St u1 u2 v3 v Informal idea of the proof: (1)for all vertices v  V\{s,t}: the shortest path distance  f (s,v) in G f increases monotonically with each flow augmentation.  f (s,v) <  f´ (s,v)  f (s,u2) = 1 (2) Edmonds-Karp algorithm augmenting path is found by breath-first search and has to be a shortest path from p to t