CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.

Slides:



Advertisements
Similar presentations
Lecture 7. Network Flows We consider a network with directed edges. Every edge has a capacity. If there is an edge from i to j, there is an edge from.
Advertisements

1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
1 Maximum flow sender receiver Capacity constraint Lecture 6: Jan 25.
1 Review of some graph algorithms Graph G(V,E) (Chapter 22) –Directed, undirected –Representation Adjacency-list, adjacency-matrix Breadth-first search.
MAX FLOW APPLICATIONS CS302, Spring 2013 David Kauchak.
Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
The Maximum Network Flow Problem. CSE Network Flows.
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 
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Advanced Algorithm Design and Analysis (Lecture 8) SW5 fall 2004 Simonas Šaltenis E1-215b
Lectures on Network Flows
1 Maximum Flow Networks Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘capacity’ u ij. Goal: Determine the maximum amount.
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf.
Nick McKeown Spring 2012 Maximum Matching Algorithms EE384x Packet Switch Architectures.
CSC 2300 Data Structures & Algorithms April 17, 2007 Chapter 9. Graph Algorithms.
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.
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 4 Tuesday, 10/2/01 Graph Algorithms: Part 2 Network.
Maximum Flows Lecture 4: Jan 19. Network transmission Given a directed graph G A source node s A sink node t Goal: To send as much information from s.
CS541 Advanced Networking 1 Routing and Shortest Path Algorithms Neil Tang 2/18/2009.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2004 Lecture 5 Wednesday, 10/6/04 Graph Algorithms: Part 2.
CS541 Advanced Networking 1 Introduction to Optimization Neil Tang 2/23/2009.
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.
1 Scheduling Crossbar Switches Who do we chose to traverse the switch in the next time slot? N N 11.
Flow Networks Formalization Basic Results Ford-Fulkerson Edmunds-Karp Bipartite Matching Min-cut.
MAX FLOW CS302, Spring 2013 David Kauchak. Admin.
CS774. Markov Random Field : Theory and Application Lecture 13 Kyomin Jung KAIST Oct
Lecture 16 Maximum Matching. Incremental Method Transform from a feasible solution to another feasible solution to increase (or decrease) the value of.
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.
CS 4407, Algorithms University College Cork, Gregory M. Provan Network Optimization Models: Maximum Flow Problems In this handout: The problem statement.
MAX FLOW APPLICATIONS CS302, Spring 2012 David Kauchak.
Max Flow – Min Cut Problem. Directed Graph Applications Shortest Path Problem (Shortest path from one point to another) Max Flow problems (Maximum material.
1 WEEK 11 Graphs III Network Flow Problems A Simple Maximum-Flow Algorithm Izmir University of Economics.
Maximum Flow Problem (Thanks to Jim Orlin & MIT OCW)
The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem Thanks to Jim Orlin & MIT OCW.
Chapter 7 April 28 Network Flow.
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25.
1 CS612 Algorithms for Electronic Design Automation CS 612 – Lecture 8 Lecture 8 Network Flow Based Modeling Mustafa Ozdal Computer Engineering Department,
Algorithm Design and Analysis (ADA)
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.
Data Structures & Algorithms Network Flow Richard Newman based on book by R. Sedgewick.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 23.
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 
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 14, 2014.
Maximum Flow Problem Definitions and notations The Ford-Fulkerson method.
The Maximum Network Flow Problem
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Honors Track: Competitive Programming & Problem Solving Push-Relabel Algorithm Claire Claassen.
Unweighted Shortest Path Neil Tang 3/11/2010
CS223 Advanced Data Structures and Algorithms
Edmonds-Karp Algorithm
Lecture 10 Network flow Max-flow and Min-cut Ford-Fulkerson method
Dijkstra’s Shortest Path Algorithm Neil Tang 03/25/2008
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
Network Flow CSE 373 Data Structures.
EE5900 Advanced Embedded System For Smart Infrastructure
Scheduling Crossbar Switches
Dijkstra’s Shortest Path Algorithm Neil Tang 3/2/2010
Maximum Flow Neil Tang 4/8/2008
Prim’s Minimum Spanning Tree Algorithm Neil Tang 4/1/2008
Presentation transcript:

CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010

CS223 Advanced Data Structures and Algorithms 2 Class Overview  The maximum flow problem  Applications  A greedy algorithm which does not work  The Ford-Fulkerson algorithm  Implementation and time complexity  Another approach: linear programming  An Application: maximum matching in a bipartite graph

CS223 Advanced Data Structures and Algorithms 3 The Maximum Flow Problem  The weight of a link (a.k.a link capacity) indicates the maximum amount of flow allowed to pass through this link.  The maximum flow problem: Given a weighted directed graph G, a source node s and a sink node t, find the maximum amount of flow that can pass from s to t and a corresponding feasible link flow allocation.  Flow feasibility: Both the flow conservation constraint and the capacity constraint must be satisfied.

CS223 Advanced Data Structures and Algorithms 4 The Maximum Flow Problem

CS223 Advanced Data Structures and Algorithms 5 Applications  Computer networks: Data traffic routing for throughput maximization.  Transportation networks: Road construction and traffic management.  Graph theory: Matching, assignment problems.

CS223 Advanced Data Structures and Algorithms 6 Flow Graph and Residual Graph

CS223 Advanced Data Structures and Algorithms 7 Basic Idea  Keep finding s-t augmenting paths until no such paths can be found in the residual graph.  Update the flow and residual graph according to the augmenting path in each step.

CS223 Advanced Data Structures and Algorithms 8 A Greedy Algorithm which Does Not Work Find an augmenting path s-a-d-t with flow value 3 and update the flow and residual graphs as follows:

CS223 Advanced Data Structures and Algorithms 9 The Ford-Fulkerson Algorithm Find an augmenting path s-a-d-t with flow value 3 and update the flow and residual graphs as follows:

CS223 Advanced Data Structures and Algorithms 10 The Ford-Fulkerson Algorithm Find an augmenting path s-b-d-a-c-t with flow value 2 and update the flow and residual graphs as follows:

CS223 Advanced Data Structures and Algorithms 11 The Implementation and Time Complexity  If all the link capacities are integers, then the time complexity of the Ford-Fulkerson algorithm is bounded by O(f|E|), where f is the max flow.  A bad example for random path selection.

CS223 Advanced Data Structures and Algorithms 12 The Implementation and Time Complexity  In each step, find an augmenting path which allows largest the increase in flow using a modified Dijkstra’s algorithm. It has been proved that it terminates after O(|E|logCap max ) steps, so the time complexity is O(|E| 2 log|V|logCap max ).  The Edmonds-Karp algorithm: In each step, find an augmenting path with minimum number of edges using BFS. It has been proved that it terminates after O(|E||V|) steps. So the time complexity is O(|E| 2 |V|).

13 Another Approach: Linear Programming LP in the standard form CS223 Advanced Data Structures and Algorithms An LP can be solved by existing algorithms in polynomial time.

14 Maximum Flow Problem - LP CS223 Advanced Data Structures and Algorithms

15 Shortest Path Problem - ILP CS223 Advanced Data Structures and Algorithms

16 Maximum Matching in A Bipartite Graph CS223 Advanced Data Structures and Algorithms A matching (a.k.a. independent edge set): a set of edges without common vertices. The maximum matching problem: find the matching with the maximum number of edges.

17 Maximum Matching in A Bipartite Graph CS223 Advanced Data Structures and Algorithms A max-flow based algorithm