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

Similar documents
Soviet Rail Network, 1955

Maximum Flow and Minimum Cut

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

Algorithm Design and Analysis

Soviet Rail Network, 1955

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

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

Network Flows: Introduction & Maximum Flow

Network Flow. Data Structures and Algorithms Andrei Bulatov

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

Today: Max Flow Proofs

1 Motivation and Basic Definitions

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

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

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

Graphs III - Network Flow

Algorithm Design and Analysis

Matching. Slides designed by Kevin Wayne.

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

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

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

Maximum Flow. Contents. Max Flow Network. Maximum Flow and Minimum Cut

4/12/12. Applications of the Maxflow Problem 7.5 Bipartite Matching. Bipartite Matching. Bipartite Matching. Bipartite matching: the flow network

Main Reference: Sections in CLRS.

CSE 521: Design & Analysis of Algorithms I

3/3/2015. Chapter 7. Network Flow. Maximum Flow and Minimum Cut. Minimum Cut Problem

Randomized Perfect Bipartite Matching

Maximum Flow 5/6/17 21:08. Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

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

Algorithmic Discrete Mathematics 6. Exercise Sheet

Algorithms. Algorithms 6.4 MAXIMUM FLOW

CSC 364S Notes University of Toronto, Spring, The networks we will consider are directed graphs, where each edge has associated with it

Maximum Flow. How do we transport the maximum amount data from source to sink? Some of these slides are adapted from Lecture Notes of Kevin Wayne.

Admin MAX FLOW APPLICATIONS. Flow graph/networks. Flow constraints 4/30/13. CS lunch today Grading. in-flow = out-flow for every vertex (except s, t)

Flow networks, flow, maximum flow. Some definitions. Edmonton. Saskatoon Winnipeg. Vancouver Regina. Calgary. 12/12 a.

18 Extensions of Maximum Flow

Network Flows UPCOPENCOURSEWARE number 34414

CMPS 6610/4610 Fall Flow Networks. Carola Wenk Slides adapted from slides by Charles Leiserson

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

Flow Networks. Ma/CS 6a. Class 14: Flow Exercises

CS 473G Lecture 15: Max-Flow Algorithms and Applications Fall 2005

Please Complete Course Survey. CMPSCI 311: Introduction to Algorithms. Approximation Algorithms. Coping With NP-Completeness. Greedy Vertex Cover

Reminder: Flow Networks

16 Max-Flow Algorithms and Applications

introduction Ford-Fulkerson algorithm

7. NETWORK FLOW I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 11/22/17 6:11 AM

Introduction to Congestion Games

They were originally developed for network problem [Dantzig, Ford, Fulkerson 1956]

Maximum Flow in Planar Graphs

Today s topics. CSE 421 Algorithms. Problem Reduction Examples. Problem Reduction. Undirected Network Flow. Bipartite Matching. Problem Reductions

7. NETWORK FLOW I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 11/22/17 6:11 AM

Chapter 7. Network Flow. CS 350: Winter 2018

introduction Ford-Fulkerson algorithm

Network flows. The problem. c : V V! R + 0 [ f+1g. flow network G = (V, E, c), a source s and a sink t uv not in E implies c(u, v) = 0

Basic Tools CMSC 641. Running Time. Problem. Problem. Algorithmic Design Paradigms. lg (n!) (lg n)! (lg n) lgn n.2

7.5 Bipartite Matching. Chapter 7. Network Flow. Matching. Bipartite Matching

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

Maximum Flow 3/3 4/6 1/1 4/7 3/3. s 3/5 1/9 1/1 3/5 2/2. 1/18/2005 4:03 AM Maximum Flow 1

7. NETWORK FLOW II. Soviet rail network (1950s) Max-flow and min-cut applications. "Free world" goal. Cut supplies (if cold war turns into real war).

April 3, The maximum flow problem. See class notes on website.

Network Flow Applications

7.5 Bipartite Matching. Chapter 7. Network Flow. Matching. Bipartite Matching

Algorithm Design and Analysis

20/20 20/20 0/5 0/5 20/20 20/20 5/5 0/5 0/5 5/5 0/20 25/30 20/20 30/30 20/20 0/5 5/5 20/20 0/5 0/5 15/20 15/25 20/20 10/10

Average Case Lower Bounds for Monotone Switching Networks

Introduction to SLE Lecture Notes

26.1 Flow networks. f (u,v) = 0.

23 Maximum Flows and Minimum Cuts

EECE 301 Signals & Systems Prof. Mark Fowler

Ford Fulkerson algorithm max-flow min-cut theorem. max-flow min-cut theorem capacity-scaling algorithm

Graph Theory: Network Flow

7. NETWORK FLOW II. Minimum cut application (RAND 1950s) Maximum flow application (Tolstoǐ 1930s) Max-flow and min-cut applications

Selfish Routing. Tim Roughgarden Cornell University. Includes joint work with Éva Tardos

, the. L and the L. x x. max. i n. It is easy to show that these two norms satisfy the following relation: x x n x = (17.3) max

16 Max-Flow Algorithms

Mechtild Stoer * Frank Wagner** Abstract. fastest algorithm known. The runtime analysis is straightforward. In contrast to

1 Review of Zero-Sum Games

Notes for Lecture 17-18

Ford-Fulkerson Algorithm for Maximum Flow

CS261: A Second Course in Algorithms Lecture #1: Course Goals and Introduction to Maximum Flow

Efficient Algorithms for Computing Disjoint QoS Paths

Dynamic Programming 11/8/2009. Weighted Interval Scheduling. Weighted Interval Scheduling. Unweighted Interval Scheduling: Review

Laplace Transform. Inverse Laplace Transform. e st f(t)dt. (2)

CS4800: Algorithms & Data Jonathan Ullman

Notes on cointegration of real interest rates and real exchange rates. ρ (2)

CHAPTER 7: SECOND-ORDER CIRCUITS

Selfish Routing and the Price of Anarchy. Tim Roughgarden Cornell University

FIXED POINTS AND STABILITY IN NEUTRAL DIFFERENTIAL EQUATIONS WITH VARIABLE DELAYS

6.8 Laplace Transform: General Formulas

3.1.3 INTRODUCTION TO DYNAMIC OPTIMIZATION: DISCRETE TIME PROBLEMS. A. The Hamiltonian and First-Order Conditions in a Finite Time Horizon

DETC2004/CIE ALGORITHMIC FOUNDATIONS FOR CONSISTENCY-CHECKING OF INTERACTION-STATES OF MECHATRONIC SYSTEMS

INDEPENDENT SETS IN GRAPHS WITH GIVEN MINIMUM DEGREE

FLAT CYCLOTOMIC POLYNOMIALS OF ORDER FOUR AND HIGHER

Topics in Combinatorial Optimization May 11, Lecture 22

Particle Swarm Optimization

Ma/CS 6a Class 15: Flows and Bipartite Graphs

Supplement for Stochastic Convex Optimization: Faster Local Growth Implies Faster Global Convergence

MATH 128A, SUMMER 2009, FINAL EXAM SOLUTION

I. Introduction to place/transition nets. Place/Transition Nets I. Example: a vending machine. Example: a vending machine

Transcription:

Algorihm Deign Technique CS : Nework Flow Dan Sheldon April, reedy Divide and Conquer Dynamic Programming Nework Flow Comparion Nework Flow Previou opic: deign echnique reedy Divide and Conquer Dynamic Programming Nework flow: pecific cla of problem wih many applicaion Formulae problem??? Deign algorihm eay hard hard Prove correcne hard eay eay Analyze running ime eay hard eay Where doe nework flow fi in? Nework Flow Previou opic: deign echnique Nework flow: pecific cla of problem wih many applicaion Direc applicaion: commodiie in nework whea/rail nework packe/inerne waer/pipe Nework Flow Previou opic: deign echnique Nework flow: pecific cla of problem wih many applicaion Direc applicaion: commodiie in nework whea/rail nework packe/inerne waer/pipe ndirec applicaion: Maching in biparie graph Airline cheduling Baeball eliminaion

Nework Flow Fir, a Sory Abou Flow and Cu Key heme: flow in a newwork are inimiaely relaed o cu Previou opic: deign echnique Nework flow: pecific cla of problem wih many applicaion Direc applicaion: commodiie in nework Sovie rail nework in whea/rail nework packe/inerne waer/pipe ndirec applicaion: Maching in biparie graph Airline cheduling Baeball eliminaion Plan: deign and analyze algorihm for max-flow problem, hen apply o olve oher problem On he hiory of he ranporaion and maximum flow problem. Alexander Schrijver, Mah Programming,. Example Defining Flow Example/definiion on board Moivaing example Flow nework ource Flow Direced graph Source, arge Edge capaciie c(e) capaciy Flow f (e) on each edge Repec capaciy and flow conervaion Value v(f ) ink Max flow problem: find a flow of maximum value Flow Nework flow = ource Flow value = flow = ink ource ink

Flow value = flow = ource Maximum Flow Problem Find - flow of maximum value. value = ink flow = ource Deigning a Max-Flow Algorihm dea (fale ar): repeaedly chooe pah and augmen flow on hoe pah unil we can no longer do o Board work Explore hi idea See where i ge uck nroduce and define reidual graph f Forward edge Backward edge Augmening pah Boleneck edge Ford-Fulkeron Algorihm ink Augmening Pah Revied dea: ue pah in he reidual graph o augmen flow Augmen flow f on pah P in f Augmen(f, P ) Le b = boleneck(p, f ). lea reidual capaciy in P for edge e = (u, v) in P do if e i a forward edge hen f (e) = f (e) + b. increae flow on forward edge ele f (e) = f (e) b. decreae flow on backward edge end if end for Example on board Ford-Fulkeron Algorihm Repeaedly find augmening pah in he reidual graph and ue hem o augmen flow! Repeaedly find augmening pah in he reidual graph and ue hem o augmen flow! Ford-Fulkeron(,, ). niially, no flow niialize f (e) = for all edge e niialize f = Ford-Fulkeron(,, ). niially, no flow niialize f (e) = for all edge e niialize f =. Augmen flow a long a i i poible while here exi an - pah P in f do f = Augmen(f, P ) updae f end while reurn f

Ford-Fulkeron Example Example : Toy example on board Flow value = Example Example f Flow value = f Flow value = Example Example f Flow value = f Flow value =

Example Example f Flow value = Ford-Fulkeron Analyi Sep : argue ha F-F reurn a flow Sep : analyze erminaion and running ime Sep : argue ha F-F reurn a maximum flow Sep : F-F reurn a flow Sep : F-F reurn a flow Claim: Le f be a flow and le f = Augmen(f, P ). Then f i a flow. max flow = f Proof idea. Verify wo condiion for f o be a flow Sep : F-F reurn a flow Claim: Le f be a flow and le f = Augmen(f, P ). Then f i a flow. Claim: Le f be a flow and le f = Augmen(f, P ). Then f i a flow. Proof idea. Verify wo condiion for f o be a flow Proof idea. Verify wo condiion for f o be a flow f aifie capaciy conrain f aifie capaciy conrain f aifie flow conervaion f aifie flow conervaion Example and proof kech on board

Sep : Terminaion and Running Time Sep : Terminaion and Running Time Aumpion: all capaciie are ineger. Then, by naure of F-F, all flow value and reidual capaciie remain ineger during he algorihm. Aumpion: all capaciie are ineger. Then, by naure of F-F, all flow value and reidual capaciie remain ineger during he algorihm. Claim: F-F erminae in a mo v(f) ieraion, where f i he reurned flow. Proof? Sep : Terminaion and Running Time Sep : Terminaion and Running Time Aumpion: all capaciie are ineger. Then, by naure of F-F, all flow value and reidual capaciie remain ineger during he algorihm. Claim: F-F erminae in a mo v(f) ieraion, where f i he reurned flow. Proof? Running ime: Le C be he oal capaciy of edge leaving ource Then v(f) apple C. So F-F erminae in a mo C ieraion Aumpion: all capaciie are ineger. Then, by naure of F-F, all flow value and reidual capaciie remain ineger during he algorihm. Claim: F-F erminae in a mo v(f) ieraion, where f i he reurned flow. Proof? Running ime: Le C be he oal capaciy of edge leaving ource Then v(f) apple C. So F-F erminae in a mo C ieraion Running ime per ieraion? Sep : Terminaion and Running Time Sep : F-F reurn a maximum flow Aumpion: all capaciie are ineger. Then, by naure of F-F, all flow value and reidual capaciie remain ineger during he algorihm. Claim: F-F erminae in a mo v(f) ieraion, where f i he reurned flow. Proof? Running ime: Le C be he oal capaciy of edge leaving ource Then v(f) apple C. So F-F erminae in a mo C ieraion We will prove hi by eablihing a deep connecion beween flow and cu in graph: he max-flow min-cu heorem. Board work: cu definiion - cu (A, B) Capaciy c(a, B) Example Running ime per ieraion? O(m + n) o find an augmening pah

Flow Value Lemma Corollary: Cu and Flow Fir relaionhip beween cu and flow Lemma: lef be any flow and (A, B) be any - cu. Then Really imporan corollary of flow-value lemma Corollary: Lef be any - flow and le (A, B) be any - cu. v(f) = e ou of A e ino A Proof and picure on board Corollary: Cu and Flow Corollary: Cu and Flow Really imporan corollary of flow-value lemma Corollary: Lef be any - flow and le (A, B) be any - cu. Proof: Really imporan corollary of flow-value lemma Corollary: Lef be any - flow and le (A, B) be any - cu. Proof: v(f) = e ou of A e ino A Corollary: Cu and Flow Corollary: Cu and Flow Really imporan corollary of flow-value lemma Corollary: Lef be any - flow and le (A, B) be any - cu. Proof: v(f) = apple e ou of A e ou of A e ino A Really imporan corollary of flow-value lemma Corollary: Lef be any - flow and le (A, B) be any - cu. Proof: v(f) = apple apple e ou of A e ou of A c(e) e ou of A e ino A

Corollary: Cu and Flow Dualiy Really imporan corollary of flow-value lemma Corollary: Lef be any - flow and le (A, B) be any - cu. Proof: v(f) = apple apple e ou of A e ou of A e ou of A = c(a, B) c(e) e ino A lluraion on board (leave up). Dualiy Dualiy F-F reurn a maximum flow lluraion on board (leave up). Dualiy Claim: Suppoe f i an - flow uch ha here are no reidual pah in f (e.g., he flow reurned by F-F)... Claim f here i a flow f and cu (A,B ) uch ha v(f )=c(a,b ),hen f i a maximum flow (A,B ) i a minimum cu F-F reurn a maximum flow F-F reurn a maximum flow Claim: Suppoe f i an - flow uch ha here are no reidual pah in f (e.g., he flow reurned by F-F)...... and le (A,B ) be he - cu where A coni of all node reachable from in he reidual graph. Claim: Suppoe f i an - flow uch ha here are no reidual pah in f (e.g., he flow reurned by F-F)...... and le (A,B ) be he - cu where A coni of all node reachable from in he reidual graph. Then he following are rue:

F-F reurn a maximum flow F-F reurn a maximum flow Claim: Suppoe f i an - flow uch ha here are no reidual pah in f (e.g., he flow reurned by F-F)...... and le (A,B ) be he - cu where A coni of all node reachable from in he reidual graph. Then he following are rue: v(f )=C(A,B ) Claim: Suppoe f i an - flow uch ha here are no reidual pah in f (e.g., he flow reurned by F-F)...... and le (A,B ) be he - cu where A coni of all node reachable from in he reidual graph. Then he following are rue: v(f )=C(A,B ) f i a maximum flow F-F reurn a maximum flow F-F reurn a maximum flow Claim: Suppoe f i an - flow uch ha here are no reidual pah in f (e.g., he flow reurned by F-F)...... and le (A,B ) be he - cu where A coni of all node reachable from in he reidual graph. Then he following are rue: v(f )=C(A,B ) f i a maximum flow (A,B ) i a minimum cu Claim: Suppoe f i an - flow uch ha here are no reidual pah in f (e.g., he flow reurned by F-F)...... and le (A,B ) be he - cu where A coni of all node reachable from in he reidual graph. Then he following are rue: v(f )=C(A,B ) f i a maximum flow (A,B ) i a minimum cu Corollary: F-Freurnamaximumflow. F-F reurn a maximum flow Max-Flow Min-Cu Theorem Claim: Suppoe f i an - flow uch ha here are no reidual pah in f (e.g., he flow reurned by F-F)...... and le (A,B ) be he - cu where A coni of all node reachable from in he reidual graph. Then he following are rue: v(f )=C(A,B ) f i a maximum flow (A,B ) i a minimum cu Theorem: in every flow nework, he value of he maximum - flow i equal o he value of he minimum - cu. Proof? Corollary: F-Freurnamaximumflow. Prove claim on board

Max-Flow Min-Cu Theorem Max-Flow Min-Cu Theorem Theorem: in every flow nework, he value of he maximum - flow i equal o he value of he minimum - cu. Proof? For any flow nework, run F-F o ge a maximum flow f and minimum-cu (A,B ) uch ha v(f )=c(a,b ).