Flow Networks General Characteristics Applications

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
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)
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
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.
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.
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
Maximum Flow Chapter 26.
Theory of Computing Lecture 13 MAS 714 Hartmut Klauck.
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).
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.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
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 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
Graph Algorithms Minimum Spanning Tree (Chap 23)
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.
Lecture 22 Network Flow, Part 2
CSCI 3160 Design and Analysis of Algorithms Tutorial 8
ADVANCED ALGORITHMS GRAPH ALGORITHMS (UNIT-2).
Max Flow – Min Cut Problem
Instructor: Shengyu Zhang
Edmonds-Karp Algorithm
Network Flows and Matching (Supplementary)
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
CSE Algorithms Max Flow Problems 11/21/02 CSE Max Flow.
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
Lecture 5 Tuesday, 3/2/10 Graph Algorithms: Part 2
Network Flows and Matching (Supplementary)
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
EE5900 Advanced Embedded System For Smart Infrastructure
Max Flow / Min Cut.
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
Text Book: Introduction to algorithms By C L R S
Lecture 21 Network Flow, Part 1
MAXIMUM flow by Eric Wengert.
Richard Anderson Lecture 22 Network Flow
Lecture 21 Network Flow, Part 1
Maximum Flow Neil Tang 4/8/2008
Lecture 22 Network Flow, Part 2
Advanced Graph Homer Lee 2013/10/31.
Presentation transcript:

Flow Networks General Characteristics Applications source : materials are produced at a steady rate sink : materials are consumed at the same rate flows through conduits are constrained to max values Applications liquid flow through pipes current flow through a circuit information in a communications network Maximum flow problem - what is the greatest flow of materials from source to sink that does not violate any capacity constraints?

Flow Networks G = (V,E) is a directed graph edge (u,v)  E has capacity c(u,v)  0 two distinct vertices: source s and sink t The flow f : V x V  R satisfies the following: There is no net flow between vertices u and v if there is no edge between them

Example of a Flow Network (a) shows the maximum shipping capacities from the source Vancouver to the sink Winnipeg in (b) the |f| = 19 and one possible flow is shown it turns out 19 is not the maximal flow; experiment with this network on the next page and try to find the maximal flow

Find the Maximal Flow

A Closer Look at Two Vertices Only positive flows are shown; the net flow from v1 to v2 is the actual flow from v1 to v2 minus the actual flow from v2 to v1 ; net flow can be negative Cancellation allows for shipments in opposite directions, as in (c), to be replaced by shipments in one direction only, as in (d)

Multiple Sources and Sinks Problems with multiple sources and sinks can be reduced to the single source/sink case A supersource with  outgoing capacities to the multiple sources is added A supersink with  incoming capacities from the multiple sinks is added

Identities involving Flows A sample proof using these identities |f| = f(s,V) by definition = f(V,V) - f(V-s,V) by lemma = f(V,V-s) by lemma = f(V,t) + f(V,V-s-t) by lemma = f(V,t) by flow conservation in order words, the value of a flow is the total net flow into the sink

The Ford-Fulkerson Method New Ideas residual flow networks - these show where extra capacity might be found augmenting paths - the path along which extra capacity is possible cuts - used to characterize the maximum flow possible in a network The basic method

Residual Networks Residual capacity and network cf (u,v) = c(u,v) - f(u,v) the residual network is a graph with the same vertices but the edges are the residual capacities Ef = { (u,v)  V x V : cf (u,v)  0 }

Relationships Between Flows Let Gf be a residual graph induced by flow f consider a flow f’ in the residual graph the sum of the flows |f| + |f’| is a new flow |f + f’| in the original graph This is proved in the following lemma

Augmenting Paths An augmenting path is a simple path from s to t in the residual network the residual capacity of the augmenting path p is the maximum additional flow we can allow along the augmenting path cf (p) = min {cf (u,v) : (u,v) is on p }

Cuts of Flow Networks Definitions a cut(S,T) of flow network G=(V,E) is a partition of V into S and T= V - S such that s  S and t  T the net flow across a cut is f(S,T), the capacity is c(S,T) f(S,T)=f(v1,v3)+f(v2,v3)+f(v2,v4)=12+(-4)+11=19 c(S,T) = c(v1,v3) + c(v2+v4) = 12 + 14 = 26

Max-flow, min-cut Theorem

Ford-Fulkerson Method Analysis lines 1-3 take (E) time lines 4-8 take at most |f*| time since the flow value has to increase by 1 (for integer values) each time this may be acceptable in most cases but not all, as we will see shortly

EXAMPLE EXECUTION to the left are successive iterations of the while loop to the right are the residual graphs the final solution is shown in (d)

Avoiding Worst Case Behavior The behavior shown above should be avoided: the maximum flow is 2,000,000; if the path with 1 is selected, there are 2,000,000 augmentations Edmonds-Karp algorithm use a breadth-first search to find the shortest path from s to t in the residual network We will prove the complexity is O( V E2 )

Edmonds-Karp algorithm Some fundamental results

Maximum Bipartite Matching A Sample Problem a bipartitle graph has two disjoint subsets of nodes what is the maximum possible matching? An Application let L be a set of machines and R a set of tasks an edge means that a particular machine can perform a particular task the maximal matching provides work for as many machines as possible in parallel

Conversion to Maximum Flow Have a single source s connected to each L and a single sink connected to each R assign a unit capacity to every edge in E’ Flows are constrained to integer values The solution to the maximum flow problem gives us a solution to the maximum bipartite matching problem

Theoretical Foundations