Today. Flow review. Augmenting paths. Ford-Fulkerson Algorithm. Intro to cuts (reason: prove correctness)

Similar documents
Chapter 7. Network Flow. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Algorithm Design and Analysis

Chapter 7. Network Flow. CS 350: Winter 2018

CS4800: Algorithms & Data Jonathan Ullman

directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time

Running Time. Assumption. All capacities are integers between 1 and C.

Algorithm Design and Analysis

Max Flow: Algorithms and Applications

Greedy. I Divide and Conquer. I Dynamic Programming. I Network Flows. Network Flow. I Previous topics: design techniques

Algorithms and Theory of Computation. Lecture 11: Network Flow

Algorithms: Lecture 12. Chalmers University of Technology

Agenda. Soviet Rail Network, We ve done Greedy Method Divide and Conquer Dynamic Programming

Algorithm Design and Analysis

Soviet Rail Network, 1955

Maximum Flow and Minimum Cut

Algorithm Design and Analysis

Soviet Rail Network, 1955

! Abstraction for material flowing through the edges. ! G = (V, E) = directed graph, no parallel edges.

6/3/2009. CS 244 Algorithm Design Instructor: t Artur Czumaj. Lecture 8 Network flows. Maximum Flow and Minimum Cut. Minimum Cut Problem.

Two Applications of Maximum Flow

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11

Maximum flow problem CE 377K. February 26, 2015

Network Flow. Data Structures and Algorithms Andrei Bulatov

CS 170: Midterm Exam II University of California at Berkeley Department of Electrical Engineering and Computer Sciences Computer Science Division

Soviet Rail Network, 1955

Myriad of applications

Graphs III - Network Flow

CS Lunch This Week. Special Talk This Week. Soviet Rail Network, Flow Networks. Slides20 - Network Flow Intro.key - December 5, 2016

Today: Max Flow Proofs

Lecture 21. The Lovasz splitting-off lemma Topics in Combinatorial Optimization April 29th, 2004

CMPSCI 611: Advanced Algorithms

Max Flow, Min Cut COS 521. Kevin Wayne Fall Soviet Rail Network, Cuts. Minimum Cut Problem. Flow network.

6.046 Recitation 11 Handout

We say that a flow is feasible for G (or just feasible if the graph and capacity function in question are obvious) if

Flows and Cuts. 1 Concepts. CS 787: Advanced Algorithms. Instructor: Dieter van Melkebeek

Lecture 2: Network Flows 1

Graphs and Network Flows IE411. Lecture 12. Dr. Ted Ralphs

Chapter 7. Network Flow. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter Landscape of an Optimization Problem. Local Search. Coping With NP-Hardness. Gradient Descent: Vertex Cover

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

Network Flows: Introduction & Maximum Flow

Graph Algorithms -2: Flow Networks. N. H. N. D. de Silva Dept. of Computer Science & Eng University of Moratuwa

7.5 Bipartite Matching

4. Connectivity Connectivity Connectivity. Whitney's s connectivity theorem: (G) (G) (G) for special

Lecture 13: Polynomial-Time Algorithms for Min Cost Flows. (Reading: AM&O Chapter 10)

Maximum flow problem (part I)

Problem Set 8 Solutions

The Electric Potential Energy

Ring Sums, Bridges and Fundamental Sets

Algorithms: COMP3121/3821/9101/9801

Chapter 7 Network Flow Problems, I

Matching. Slides designed by Kevin Wayne.

Algorithm Design and Analysis

Main Reference: Sections in CLRS.

Lecture 3. 1 Polynomial-time algorithms for the maximum flow problem

CSC 373: Algorithm Design and Analysis Lecture 12

Balanced Network Flows

Algorithms and Data Structures 2011/12 Week 9 Solutions (Tues 15th - Fri 18th Nov)

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)

Flows. Chapter Circulations

1 Motivation and Basic Definitions

CSE 521: Design & Analysis of Algorithms I

Lecture 13 Spectral Graph Algorithms

1 Review for Lecture 2 MaxFlow

6.854 Advanced Algorithms

The min cost flow problem Course notes for Optimization Spring 2007

Elastic Collisions Definition Examples Work and Energy Definition of work Examples. Physics 201: Lecture 10, Pg 1

Mathematics for Decision Making: An Introduction. Lecture 13

Lecture 9: Shor s Algorithm

The Residual Graph. 12 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

Sparse Fault-Tolerant BFS Trees. Merav Parter and David Peleg Weizmann Institute Of Science BIU-CS Colloquium

Flow Network. The following figure shows an example of a flow network:

MAXIMUM FLOW. introduction Ford-Fulkerson algorithm maxflow-mincut theorem

The Budget-Constrained Maximum Flow Problem

Part V. Matchings. Matching. 19 Augmenting Paths for Matchings. 18 Bipartite Matching via Flows

Algorithm Design and Analysis

The Residual Graph. 11 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

Lecture 21 November 11, 2014

Discrete Optimization 2010 Lecture 3 Maximum Flows

ACO Comprehensive Exam March 20 and 21, Computability, Complexity and Algorithms

ρ water = 1000 kg/m 3 = 1.94 slugs/ft 3 γ water = 9810 N/m 3 = 62.4 lbs/ft 3

List coloring hypergraphs

Chapter 6. Dynamic Programming. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Bogoliubov Transformation in Classical Mechanics

CSCE423/823. Introduction. Flow Networks. Ford-Fulkerson Method. Edmonds-Karp Algorithm. Maximum Bipartite Matching 2/35 CSCE423/823.

Lecture 2: Divide and conquer and Dynamic programming

Problem Set If all directed edges in a network have distinct capacities, then there is a unique maximum flow.

Flow networks. Flow Networks. A flow on a network. Flow networks. The maximum-flow problem. Introduction to Algorithms, Lecture 22 December 5, 2001

The min cost flow problem Course notes for Search and Optimization Spring 2004

MAE140 Linear Circuits Fall 2012 Final, December 13th

5 Flows and cuts in digraphs

Lexicographic Flow. Dexter Kozen Department of Computer Science Cornell University Ithaca, New York , USA. June 25, 2009

1 Matchings in Non-Bipartite Graphs

Recall: Matchings. Examples. K n,m, K n, Petersen graph, Q k ; graphs without perfect matching

(1,3) (3,4) (2,2) (1,2) (2,4) t

Maximum Flow. Reading: CLRS Chapter 26. CSE 6331 Algorithms Steve Lai

Chapter 9 Review. Block: Date:

MAS210 Graph Theory Exercises 5 Solutions (1) v 5 (1)

Robust Network Codes for Unicast Connections: A Case Study

CSE 421 Introduction to Algorithms Final Exam Winter 2005

Transcription:

Today Flow review Augmenting path Ford-Fulkeron Algorithm Intro to cut (reaon: prove correctne)

Flow Network = ource, t = ink. c(e) = capacity of edge e Capacity condition: f(e) c(e) Conervation condition: for v V {, t}: " f(e) = f(e) e into v e out of v flow = ource 7 t ink

Flow The value of a flow f i: v(f) = f(e) e out of value = flow = ource 7 t ink

Flow The value of a flow f i: v(f) = f(e) e out of value = flow = ource 7 t ink

Maximum Flow Problem Find -t flow of maximum value. value = flow = ource 7 t ink

Toward a Max-Flow Algorithm Key idea: repeatedly chooe path and augment the amount of flow on thoe path a much a poible until capacitie are met

Toward a Max Flow Algorithm Problem: poible to get tuck at a flow that i not maximum, no more path with exce capacity t Flow value =

Reidual Graph Original edge: e = (u, v) E. Flow f(e), capacity c(e). u 7 v Create two reidual edge Forward edge e = (u, v) with capacity c(e) - f(e) Backward/revere edge e = (v, u) with capacity f(e) u reidual capacity v Reidual graph: G f = (V, E f ). E f = edge with poitive reidual capacity E f = {e : f(e) < c(e)} {e : f(e) > }

Augmenting Path Definition: an -t path P in G f i an augmenting path Idea: ue an augmenting path to augment flow in G Increae flow on forward edge Decreae flow on backward edge Definition: let bottleneck(p, f) be the minimum reidual capacity (i.e., capacity in G f ) of any edge in P Example on board

Augmenting Path Ue path P in G f to to update flow f Augment(f, P) { b = bottleneck(p, f) // edge on P with leat reidual capacity foreach e = (u,v) P { if e i a forward edge f(e) = f(e) + b // forward edge: increae flow ele let e = (v, u) f(e ) = f(e ) - b // backward edge: decreae flow } return f }

Augmenting Path Claim: Let f be a flow and let f = Augment(f, P). Then f i a flow. Proof idea: verify capacity and conervation condition ) Capacity: by deign of reidual graph ) Conervation: check that net change at each node i zero Proof ketch on board

Ford-Fulkeron Algorithm Repeat: find an augmenting path, and augment! Ford-Fulkeron(G,, t) { foreach e E f(e) = // initially, no flow G f = copy of G // reidual graph = original graph } while (there exit an -t path P in G f ) { f = Augment(f, P) // change the flow update G f // build a new reidual graph } return f

Example G: t Flow value =

Example G t G f Flow value = t

Example G t G f Flow value = t

Example G t G f Flow value = 7 t

Example G t Gf Flow value = t

Example G 7 t G f Flow value = t

Example G 7 t max flow = G f 7 t

Termination Aumption. All capacitie are poitive integer. Invariant. Every flow value f(e) and every reidual capacity c f (e) remain an integer throughout the algorithm. Theorem. Let OPT = value of max flow. The algorithm terminate in at mot OPT iteration, with OPT C, the total capacity of the edge leaving the ource. Proof?

Running Time? There are at mot C augment operation. How long doe it take for each? Find a reidual path Compute bottleneck capacity Update flow Update reidual graph O(m+n) O(m) O(m) O(m) Total running time: O(C(m+n))

Cut An -t cut i a partition (A, B) of V with A and t B. The capacity of a cut (A, B) i c(a,b) = Σ c(e) e out of A A B ource t ink capacity of cut = 7

Cut capacity of cut = + + + = (Capacity i um of weight on edge leaving A.) A B ource t ink 7

Flow and Cut Flow value lemma. Let f be any flow, and let (A, B) be any -t cut. Then, the net flow ent acro the cut i equal to the amount leaving. value = A ource f(e) - f(e) = v(f) e out of a e into a 7 t ink B

Flow and Cut Flow value lemma. Let f be any flow, and let (A, B) be any -t cut. Then, the net flow ent acro the cut i equal to the amount leaving. value = ource f(e) - f(e) = v(f) e out of a e into a A 7 B t ink

Flow and Cut Flow value lemma. Let f be any flow, and let (A, B) be any -t cut. Then, the net flow ent acro the cut i equal to the amount leaving. value = A ource f(e) - f(e) = v(f) e out of a e into a 7 t ink B

Flow and Cut Flow value lemma. Let f be any flow, and let (A, B) be any -t cut. Then f(e) - f(e) = v(f). Proof: e out of A e into A v(f) = f(e) e out of = ( f(e) - f(e) ) v A e out of v = f(e) - f(e) e out of A e into A e into v by definition by flow conervation, all term except v = are if both endpoint of e are in A, there will be canceling term for that edge

Max-Flow Min-Cut There i a deep connection between flow and cut in network Next time, we will prove that Ford-Fulkeron i correct by proving the Max-Flow Min-Cut Theorem