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,

Slides:



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

Max Flow Problem Given network N=(V,A), two nodes s,t of V, and capacities on the arcs: uij is the capacity on arc (i,j). Find non-negative flow fij for.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
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)
Chapter 10: Iterative Improvement The Maximum Flow Problem The Design and Analysis of Algorithms.
1 Maximum Flow 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 
Advanced Algorithm Design and Analysis (Lecture 8) SW5 fall 2004 Simonas Šaltenis E1-215b
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.
1 Efficient implementation of Dinic’s algorithm for maximum flow.
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)
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
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 problems. 2 - Introduction of: network, max-flow problem capacity, flow - Ford-Fulkerson method pseudo code, residual networks, augmenting.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 4 Tuesday, 10/2/01 Graph Algorithms: Part 2 Network.
1 Efficient implementation of Dinic’s algorithm for maximum flow.
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.
NetworkModel-1 Network Optimization Models. NetworkModel-2 Network Terminology A network consists of a set of nodes and arcs. The arcs may have some flow.
Maximum Flow Chapter 26.
Network Flow. Network flow formulation A network G = (V, E). Capacity c(u, v)  0 for edge (u, v). Assume c(u, v) = 0 if (u, v)  E. Source s and sink.
10. Lecture WS 2006/07Bioinformatics III1 V10: Network Flows V10 follows closely chapter 12.1 in on „Flows and Cuts in Networks and Chapter 12.2 on “Solving.
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.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Exercise 6.1 Find the number of different shortest paths from point A to point B in a city with perfectly horizontal streets and vertical avenues as shown.
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.
1 Assignment #3 is posted: Due Thursday Nov. 15 at the beginning of class. Make sure you are also working on your projects. Come see me if you are unsure.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
Maximum Flow Problem Definitions and notations The Ford-Fulkerson method.
ENGM 631 Maximum Flow Solutions. Maximum Flow Models (Flow, Capacity) (0,3) (2,2) (5,7) (0,8) (3,6) (6,8) (3,3) (4,4) (4,10)
Instructor Neelima Gupta Edited by Divya Gaur(39, MCS '09) Thanks to: Bhavya(9), Deepika(10), Deepika Bisht(11) (MCS '09)
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Max-flow, Min-cut Network flow.
Maximum Flow Chapter 26.
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
CS4234 Optimiz(s)ation Algorithms
V12: Network Flows V12 follows closely chapter 12.1 in
Algorithms and Networks Hans Bodlaender
Network flow problem [Adapted from M.Chandy].
Richard Anderson Lecture 23 Network Flow
Maximum Flow 9/13/2018 6:12 PM Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015.
CSCI 3160 Design and Analysis of Algorithms Tutorial 8
Max Flow min Cut.
Maximum Flow Solutions
Max-flow, Min-cut Network flow.
Network Flow 2016/04/12.
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Efficient implementation of Dinic’s algorithm for maximum flow
Flow Networks Topics Flow Networks Residual networks
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 21 Network Flow
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Network Flow.
Lecture 21 Network Flow, Part 1
Richard Anderson Lecture 22 Network Flow
Lecture 21 Network Flow, Part 1
Network Flow.
Richard Anderson Lecture 22 Network Flow
Presentation transcript:

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, 1, 2, 3, 4, 5} E= {(0,1), (0,2), (1,2), (1,3), (2,4),(3,1),(3,5),(4,3),(4,5)} 1

A directed graph G: Remark: In a talk, I might just use the pictures without as many words, but I would not use words without pictures. 2

A directed graph G: Vertex 2 has in-degree 2 and out-degree 1. 3

A directed cycle of length k consists of an alternating sequence of vertices and arcs of the form: v 0, e 1, v 1, e 2, …,v k-1, e k, v k where v 0 = v k but otherwise the vertices are distinct and where e i is the arc (v i, v i+1 ) for i= 0, 1, 2, …, k-1. 1, (1,2), 2, (2,4), 4, (4,3), 3, (3,1), 1 4

A directed cycle of length 4: 5

A cycle of length k consists of an alternating sequence of vertices and arcs of the form: v 0, e 1, v 1, e 2, …,v k-1, e k, v k where v 0 = v k but otherwise the vertices are distinct and where e i is either the arc (v i, v i+1 ) or (v i+1, v i ) for i= 0, 1, 2, …, k-1. 3, (3,5), 5, (4,5), 4, (4,3), 3 6

A cycle of length 3 which is not a directed cycle (arcs can be traversed in either direction): 7

A directed path of length 4 from vertex 0 to vertex 5: 0, (0,1), 1, (1,2), 2, (2,4), 4, (4,5), 5 8

A path of length 4 which is not a directed path (arcs can be traversed in either direction) from vertex 0 to vertex 5: 0, (0,2), 2, (1,2), 1, (3,1), 3, (3,5), 5 9

The maximum flow problem: Given a directed graph G, a source vertex s and a sink vertex t and a non-negative capacity c(u,v) for each arc (u,v), find the maximum flow from s to t. 10

An example of a maximum flow: 11

A flow function f is an assignment of flow values to the arcs of the graph satisfying: 1.For each arc (u,v), 0 ≤ f (u, v) ≤ c(u,v). 2.[Conservation of flow] For each vertex v except for s and t, the flow entering v equals the flow exiting v. 12

The amount of flow from s to t is equal to the net amount of flow exiting s = sum over arcs e that exit s of f(e) – sum over arcs e that enter s of f(e). Flow = 6. 13

A slightly different example: Flow= – 2 = 6. 14

Because of conservation of flow, the amount of flow from s to t is also equal to the net amount of flow entering t. 15

Form an auxillary graph as follows: For each arc (u,v) of G: 1.Add an arc (u,v) with capacity c(u, v) – f(u,v). 2.Add an arc (v,u) with capacity f(u,v). 16

Make the auxillary graph for this example: 17

When the flow is maximum: S= {v: v is reachable from s on a directed path of non-zero weighted arc s} T= V-S. Then (S,T) is a minimum capacity s,t-cut of the graph. 18

S= {0, 1, 2, 4}, T= {3, 5} (S, T)= {(u, v): u ∈ S and v ∈ T}. (S,T)= {(1,3), (4,3), (4,5)} This is a cut because if you remove these edges there are no directed paths anymore from s to t. 19

The capacity of a cut (S,T) is the sum of the capacities of the arcs in the cut. (S,T)= {(1,3), (4,3), (4,5)} Capacity(S,T)= = 6. 20

The maximum flow from s to t cannot be more than the capacity of any of the s,t-cuts. Theorem: the maximum flow equals the minimum capacity of an s,t-cut. How can we find a maximum flow? 21

Use the Edmonds-Karp Algorithm to find the maximum flow in this network. Edmonds-Karp: Use BFS to find augmenting paths in the auxillary graph. 22

Jack Edmonds Richard Karp 23

24

25

26

27

28

Augmenting path: s, b, e, t 29

Send 5 units of flow along augmenting path. 30

Create new auxillary graph: 31

Do BFS starting at s of auxillary graph. 32

Identify augmenting path: s, a, c, e, t Capacity of path is 2. 33

Augment flow: 34

Make new auxillary graph: 35

Apply BFS: Cannot reach t. 36

P= {u: u is reachable from s on BFS} (P, V-P)= { (u,v) : u  P and v  P}. 37

In the auxillary: P={s, a, c} V-P = {b, d, e, f, t} 38

(P, V-P)= { (u,v) : u  P and v  P}. So (P, V-P)= { (s, b), (c, e)} 39

Max Flow Min Cut Theorem: Text p. 169 In any network, the value of a maximum flow is equal to the capacity of a minimum cut. 40

41