CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 23.

Slides:



Advertisements
Similar presentations
COMP 482: Design and Analysis of Algorithms
Advertisements

1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
1 Maximum flow sender receiver Capacity constraint Lecture 6: Jan 25.
Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
Network Optimization Models: Maximum Flow Problems
MAXIMUM FLOW Max-Flow Min-Cut Theorem (Ford Fukerson’s Algorithm)
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2012 Lecture 19.
CSCI 256 Data Structures and Algorithm Analysis Lecture 18 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
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.
Lectures on Network Flows
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.
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.
Advanced Algorithms Piyush Kumar (Lecture 2: Max Flows) Welcome to COT5405 Slides based on Kevin Wayne’s slides.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
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.
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.
Advanced Algorithms Piyush Kumar (Lecture 5: Weighted Matching) Welcome to COT5405 Based on Kevin Wayne’s slides.
MAX FLOW CS302, Spring 2013 David Kauchak. Admin.
Advanced Algorithms Piyush Kumar (Lecture 5: Weighted Matching) Welcome to COT5405 Based on Kevin Wayne’s slides.
CS774. Markov Random Field : Theory and Application Lecture 13 Kyomin Jung KAIST Oct
Final Exam Review Final exam will have the similar format and requirements as Mid-term exam: Closed book, no computer, no smartphone Calculator is Ok Final.
1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf.
CS 4407, Algorithms University College Cork, Gregory M. Provan Network Optimization Models: Maximum Flow Problems In this handout: The problem statement.
& 6.855J & ESD.78J Algorithm Visualization The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem.
The Ford-Fulkerson Augmenting Path Algorithm for the Maximum Flow Problem Thanks to Jim Orlin & MIT OCW.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
Chapter 7 April 28 Network Flow.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25.
and 6.855J March 6, 2003 Maximum Flows 2. 2 Network Reliability u Communication Network u What is the maximum number of arc disjoint paths from.
Taken from Kevin Wayne’s slides (Princeton University) COSC 3101A - Design and Analysis of Algorithms 13 Maximum Flow.
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.
CSCI 256 Data Structures and Algorithm Analysis Lecture 20 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
CSCE 3110 Data Structures & Algorithm Analysis Graphs (I) Reading: Chap.9, Weiss.
CSEP 521 Applied Algorithms Richard Anderson Lecture 8 Network Flow.
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.
Prof. Swarat Chaudhuri COMP 382: Reasoning about Algorithms Fall 2015.
Markov Random Fields in Vision
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Maximum Flow Problem Definitions and notations The Ford-Fulkerson method.
CSE 421 Algorithms Richard Anderson Lecture 21 Shortest Paths and Network Flow.
CS 312: Algorithm Design & Analysis Lecture #29: Network Flow and Cuts This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported.
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
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.
COMP 382: Reasoning about Algorithms
Edmonds-Karp Algorithm
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
Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Network Flow and Connectivity in Wireless Sensor Networks
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 21 Network Flow
Max Flow Min Cut, Bipartite Matching Yin Tat Lee
Algorithms (2IL15) – Lecture 7
Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
EE5900 Advanced Embedded System For Smart Infrastructure
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
Lecture 21 Network Flow, Part 1
Richard Anderson Lecture 22 Network Flow
Lecture 21 Network Flow, Part 1
Maximum Flow Neil Tang 4/8/2008
Richard Anderson Lecture 22 Network Flow
Presentation transcript:

CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 23

Network Flow Soviet Rail Network, 1955 Reference: On the history of the transportation and maximum flow problems. Alexander Schrijver in Math Programming, 91: 3, 2002.

Maximum Flow and Minimum Cut Max flow and min cut –Two very rich algorithmic problems –Cornerstone problems in combinatorial optimization –Beautiful mathematical duality Nontrivial applications / reductions –Data mining –Project selection –Airline scheduling –Bipartite matching –Baseball elimination –Image segmentation –Network connectivity –Network reliability –Distributed computing –Security of statistical data –Network intrusion detection –Multi-camera scene reconstruction –Many many more...

Flow Network Flow network –Abstraction for material flowing through the edges –G = (V, E) = directed graph, no parallel edges –Two distinguished nodes: s = source, t = sink –c(e) = capacity of edge e s t capacity source sink

Flows Def: An s-t flow is a function that satisfies –For each e  E: (capacity) –For each v  V – {s, t}: (conservation) Def: The value of a flow f is: The maximum-flow problem –Given a flow network, a natural goal is to arrange the traffic so as to make as efficient use as possible of the available capacity –Thus basic algorithmic problem is: given a flow network, find a flow of maximum possible value

Flow Example u st v

Flow Example a s d b cf e g h i t

Towards a Max Flow Algorithm Greedy algorithm –Start with f(e) = 0 for all edge e  E –Find an s-t path P where each edge has f(e) < c(e) –Augment flow along path P –Repeat until you get stuck s 1 2 t Flow value = 0

Towards a Max Flow Algorithm Greedy algorithm –Start with f(e) = 0 for all edge e  E –Find an s-t path P where each edge has f(e) < c(e) –Augment flow along path P –Repeat until you get stuck s 1 2 t 20 Flow value = X X X 20

Towards a Max Flow Algorithm Greedy algorithm –Start with f(e) = 0 for all edge e  E –Find an s-t path P where each edge has f(e) < c(e) –Augment flow along path P –Repeat until you get stuck local optimality  global optimality greedy = 20 s 1 2 t opt = 30 s 1 2 t

Towards a Max Flow Algorithm The way we are going to increase the flow is by finding augmenting paths (i.e., s-t paths that increase the flow) The other way that we can increase the flow is by reversing the direction of flow

Residual Graph Original edge: e = (u, v)  E –Flow f(e), capacity c(e) Residual edge –"Undo" flow sent –e = (u, v) and e R = (v, u) –Residual capacity: Residual graph: G f = (V, E f ) –Residual edges with positive residual capacity –E f = {e : f(e) 0} uv 17 6 capacity flow uv 11 residual capacity 6

Build Residual Graph s 1 2 t

Augmenting Path Lemma Let P be a path from s to t with minimum capacity b in the residual graph b units of flow can be added along the path P in the flow graph

Augmenting Path Algorithm Augment(f, c, P) { b  bottleneck(P) foreach e  P { if (e  E) f(e)  f(e) + b else f(e R )  f(e) - b } return f } forward edge backward edge

Ford-Fulkerson Max-Flow Algorithm Ford-Fulkerson(G, s, t, c) { foreach e  E f(e)  0 G f  residual graph while (there exists augmenting path P) { f  Augment(f, c, P) update G f } return f }

Ford-Fulkerson Example s t G: Flow value = 0 0 flow capacity

Ford-Fulkerson Example s t G: s t G f : X X X 0 Flow value = 0 capacity residual capacity flow

Ford-Fulkerson Example s t G: s t G f : X X X 2 X Flow value = 8

0 Ford-Fulkerson Example s t G: s t 4 2 G f : X X X 8 X Flow value = 10

Ford-Fulkerson Example s t G: s t 1 6 G f : X X X 0 X Flow value = 16

Ford-Fulkerson Example s t G: s t 6 2 G f : X X X 9 X X 3 Flow value = 18

Ford-Fulkerson Example s t G: s t G f : Flow value = 19