CS138A 1999 1 Network Flows Peter Schröder. CS138A 1999 2 Flow Networks Definitions a flow network G=(V,E) is a directed graph in which each edge (u,v)

Slides:



Advertisements
Similar presentations
1 Review of some graph algorithms Graph G(V,E) (Chapter 22) –Directed, undirected –Representation Adjacency-list, adjacency-matrix Breadth-first search.
Advertisements

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)
CSE 326: Data Structures Network Flow and APSP Ben Lerner Summer 2007.
The Maximum Network Flow Problem. CSE Network Flows.
Chapter 10: Iterative Improvement The Maximum Flow Problem The Design and Analysis of Algorithms.
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.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
CS138A Maximum Bipartite Matching Peter Schröder.
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.
1 Maximum Flow Maximum Flow Problem The Ford-Fulkerson method Maximum bipartite matching.
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.
The max-flow problem Defined on a capacitated directed graph G=(V,E,c). The capacities are non-negative G st 11.
Flows sourcesink s t Flows sourcesink edge-weights = capacities.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2008 Lecture 5 Tuesday, 10/7/08 Graph Algorithms: Part 2.
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.
Maximum Flow Maximum Flow Problem The Ford-Fulkerson method
Flow Networks Formalization Basic Results Ford-Fulkerson Edmunds-Karp Bipartite Matching Min-cut.
Maximum Flow Chapter 26.
CS774. Markov Random Field : Theory and Application Lecture 13 Kyomin Jung KAIST Oct
Yangjun Chen 1 Network Flow What is a network? Flow network and flows Ford-Fulkerson method - Residual networks - Augmenting paths - Cuts of flow networks.
Single Source Shortest-Path: The General Case (with negative edges) Bellman-Ford algorithm. Iteratively relax all edges |V|-1 times Running time? O(VE).
1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf.
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.
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.
Iterative Improvement for Domain-Specific Problems Lecturer: Jing Liu Homepage:
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.
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Graph Algorithms Minimum Spanning Tree (Chap 23)
Network flow problem [Adapted from M.Chandy].
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 23 Network Flow
Richard Anderson Lecture 23 Network Flow
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
Richard Anderson Lecture 22 Network Flow
Lecture 21 Network Flow, Part 1
Richard Anderson Lecture 22 Network Flow
Presentation transcript:

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) in E has a nonnegative capacity c(u,v) there are two distinguished vertices: a source s and a sink t for simplicity assume that every vertex lies on some path from s to t (this implies that the graph is connected)

CS138A Flow Definition a flow on a graph is a real valued function VxV>R with the following properties capacity constraint: for all u,v in V skew symmetry: for all u,v in V flow conservation: for all u in V\{s,t}

CS138A Flow Definitions the value of a flow is defined as in the maximum flow problem we wish to find the maximum flow from s to t in some graph G=(V,E) non zero net flow from u to v implies (u,v) in E or (v,u) in E

CS138A Flow Multiple sources and sinks introduce super source and super sink with infinite capacity connections to the individuals sources and sinks respectively implicit set summation convention Lemma 1: Let G=(V,E) be a flow network and let f be a flow in G. Then for X subset V

CS138A Example Use implicit set summation to prove by definition by Lemma 1 by flow conservation

CS138A Ford-Fulkerson Method Principles behind differing implementations repeated update through augmenting paths if there is unused capacity left, use it… 1. Ford-Fulkerson-Method(G,s,t) 2. initialize flow to 0 3. while( exists augmenting path ) 4. augment flow f along path 5. return f

CS138A Residual Networks Formalization of remaining flow opportunities given flow network G=(V,E) and flow f define residual capacity the residual flow network is induced by they positive residual capacity G f =(V,E f ) where E f consists of all pairs u,v in V with positive residual flow capacity (note that it can have as many as twice as many edges)

CS138A Properties Residual networks Lemma 2: Let G=(V,E) be a flow network with source s and sink t and f be a flow; let G f be the residual network induced and let f’ be a flow in G f then the flow sum f+f’ is a flow in G with value |f+f’|=|f|+|f’| Augmenting path simple path p in residual network from s to t residual capacity c f (p) is minimum capacity along path p

CS138A Residual Capacity Property Lemma 3: let G=(V,E) be a flow network with flow f and p be an augmenting path in G f. Define then f p is a flow in G f with value |f p |=c f (p) positive

CS138A Residual Capacity Adding an augmenting flow Corollary 4: Let G=(V,E) be a flow network with flow f and p be an augmenting path in G f Let f p be defined as before; define f’=f+f p then f’ is a flow in G with value |f’|=|f|+|f p | greater than |f| immediate from previous two lemmas

CS138A Cuts of Flow Networks What is a cut? a cut(S,T) is a partition of V into S and T with s in S and t in T with net flow f(S,T) and capacity c(S,T) (picture) Lemma 5: let f be a flow in a flow network G with source s and sink t and let (S,T) be a cut of G; then f(S,T)=|f| Corollary 6: the value of any flow f in a flow network G is bounded from above by the capacity of any cut of G

CS138A Cuts in Flow Networks Max-flow min-cut theorem Theorem 7: if f is a flow in a flow network G=(V,E) with source s and sink t, then the following conditions are equivalent: f is a maximum flow in G the residual network G f contains no augmenting paths |f|=c(S,T) for some cut (S,T) of G

CS138A Basic Ford-Fulkerson Iteratively increase flow by residual capacity 1. Ford-Fulkerson(G,s,t) 2. for( (u,v) in E[G] ) 3. f[u,v] = 0; f[v,u] = 0; 4. while( exists path p from s to t in G f ) 5. c f (p) = min{c f (u,v): (u,v) in p} 6. for( (u,v) in E[p] ) 7. f[u,v] = f[u,v]+c f (p); 8. f[v,u] = -f[u,v]

CS138A Ford-Fulkerson Running time: depends on method to pick augmenting path (use BFS) Edmonds-Karp algorithm pick p with BFS looking for the shortest path with unit edge lengths in the residual network; O(VE 2 ) Lemma 8: when Edmunds-Karp is run on G then for all vertices v in V\{s,t} the shortest path distance in the residual network G f increases monotonically with augmentation

CS138A Edmunds-Karp Properties Theorem 9: if the Edmonds-Karp algorithm is run on a flow network G=(V,E) with source s and sink t, then the total number of flow augmentations performed by the algorithm is at most O(VE)