11/21/02CSE 202 - Max Flow CSE 202 - Algorithms Max Flow Problems.

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.
15.082J & 6.855J & ESD.78J October 14, 2010 Maximum Flows 2.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
1 Maximum flow sender receiver Capacity constraint Lecture 6: Jan 25.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 8 Network models.
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.
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 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.
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)
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2001 Lecture 4 Tuesday, 2/19/02 Graph Algorithms: Part 2 Network.
CSE Shortest Paths1 Midterm page 1 The worst-case complexity of an algorithm is... a function from N (or size of instance) to N.  (n lg n) is...
12/3CSE NP-complete CSE Algorithms NP Completeness Approximations.
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
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.
CSE Algorithms Minimum Spanning Trees Union-Find Algorithm
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.
10/31/02CSE Greedy Algorithms CSE Algorithms Greedy Algorithms.
Assignment 4. (Due on Dec 2. 2:30 p.m.) This time, Prof. Yao and I can explain the questions, but we will NOT tell you how to solve the problems. Question.
11/26/02CSE FFT,etc CSE Algorithms Polynomial Representations, Fourier Transfer, and other goodies. (Chapters 28-30)
10/31/02CSE Greedy Algorithms CSE Algorithms Greedy Algorithms.
MAX FLOW CS302, Spring 2013 David Kauchak. Admin.
5/27/03CSE Shortest Paths CSE Algorithms Shortest Paths Problems.
Maximum Flow Chapter 26.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 11, 2014.
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.
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.
CS 361 – Chapter 16 Final thoughts on minimum spanning trees and similar problems Flow networks Commitment: –Decide on presentation order.
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.
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.
CSEP 521 Applied Algorithms Richard Anderson Lecture 8 Network Flow.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Prof. Swarat Chaudhuri COMP 382: Reasoning about Algorithms Fall 2015.
The Maximum Network Flow Problem
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
CS4234 Optimiz(s)ation Algorithms
Algorithm Design and Analysis
Lectures on Network Flows
Richard Anderson Lecture 23 Network Flow
Lecture 22 Network Flow, Part 2
CSCI 3160 Design and Analysis of Algorithms Tutorial 8
Edmonds-Karp Algorithm
CSE Algorithms Max Flow Problems 11/21/02 CSE Max Flow.
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 21 Network Flow
Max Flow Min Cut, Bipartite Matching Yin Tat Lee
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
EE5900 Advanced Embedded System For Smart Infrastructure
Network Flow.
Lecture 21 Network Flow, Part 1
MAXIMUM flow by Eric Wengert.
Richard Anderson Lecture 22 Network Flow
Lecture 21 Network Flow, Part 1
Lecture 22 Network Flow, Part 2
Network Flow.
Presentation transcript:

11/21/02CSE Max Flow CSE Algorithms Max Flow Problems

CSE Max Flow2 Max Flow problem Input: a directed graph with a non-negative weight (capacity) on each edge, and a designated source node s and sink node t. A flow assigns to each edge a number (from 0 to its capacity) such that for each node except s and t, the sum of the flow into the node equals sum of the flow out. [The fine print: this is slightly different from the book’s definition.] The value of a flow is the sum of the flow out of the source (which equals total flow into the sink). Maximum-Flow problem: find a flow with the maximum possible value. Note: A max flow can assign 0 to each edge going into the source, and to each edge going out of the sink.

CSE Max Flow3 Example b a d s t c source sink b a d s t c A flow of value 18 This is wasteful! The text’s formulation doesn’t even let it happen.

CSE Max Flow4 Leftover capacity b a d s t c source sink b a d s t c Residual network New backedge showing we can reduce forward flow by 10

CSE Max Flow5 Augmenting Path b a d s t c New residual network We can push 5 more through network on indicated path (New flow has value 23.) b a d s t c Now we’re stuck! We can’t get any more across cut.

CSE Max Flow6 Duality: Max Flow = Min Cut Original problem had a cut of value 23. We can’t possibly get more from source to sink. Theorem: Max flow = min cut Proof: Obviously, any flow  min cut. But if max flow < min cut, there would be an augmenting path from source to sink, leading to a higher-valued flow. This is a contradiction. Thus, max flow = min cut. QED. b a d s t c

CSE Max Flow7 Ford-Fulkerson Methods initialize flow to 0; while (there’s an augmenting path){ update flow; compute new residual graph; } If there are several augmenting paths, does it matter which we pick?? b a s t

CSE Max Flow8 Edmonds-Karp Algorithm Always choose an augmenting path with as few edges as possible (say it has L edges). –This might create a new backedge, e.g (v,u). –This new edge can’t be in a new path of L edges.. (Handle multiple new backedges by induction proof.) –Meanwhile, at least one original edge has been eliminated. –Thus, there are at most E iterations using L long paths. u v s j long path t k long path u v s m long t n long j+1+k is a minimal length path (L) m  j+1 and n  k+1 so m+n > j+k+1 = L

CSE Max Flow9 Edmonds-Karp Algorithm Always choose an augmenting path with as few edges as possible. –At most E iterations use L-edge augmenting path –Longest augmenting path has V-1 edges. –Thus, there are at most O(VE) augmentations. –How long does it take to find and process a shortest augmenting path??

CSE Max Flow10 Max Flow Algorithms Edmonds-Karp is O(VE 2 ) Some faster algorithms based on “Push-Relabel”. –E.g. Goldberg’s algorithm is O(V 2 E) Start source at height V, all others at 0 Add in flow from higher nodes to lower ones. If a non-sink node can’t push all its incoming flow out, increase it’s height. When done, return excess back to source. –Carefully choosing order gives O(V 3 ) algorithm. Fastest known algorithm is O( min(V 2/3, E 1/2 ) E lg(1+V 2 /E) lg(max capacity) ).

CSE Max Flow11 An Application Maximum matching problem: –Given an (undirected) graph (V,E) find a maximum-sized set of disjoint edges. Not the same as a maximal set of disjoint edges. –Amazingly, not NP-complete (but it’s not easy) Bipartite graph: Graph such that you can partition the nodes V = V 1 U V 2, and every edge goes between a node of V 1 and one of V 2. Maximum matching for a bipartite graph can be reduced to a max flow problem.

CSE Max Flow12 Glossary (in case symbols are weird)            subset  element of  infinity  empty set  for all  there exists  intersection  union  big theta  big omega  summation  >=  <=  about equal  not equal  natural numbers(N)  reals(R)  rationals(Q)  integers(Z)