Soviet Rail Network, 1955

Similar documents
! 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.

Maximum Flow and Minimum Cut

Soviet Rail Network, 1955

Algorithm Design and Analysis

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

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

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

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

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

Today: Max Flow Proofs

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.

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

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

Matching. Slides designed by Kevin Wayne.

Main Reference: Sections in CLRS.

Algorithm Design and Analysis

Graphs III - Network Flow

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

1 Motivation and Basic Definitions

CSE 521: Design & Analysis of Algorithms I

Network Flows: Introduction & Maximum Flow

Algorithms. Algorithms 6.4 MAXIMUM FLOW

Network Flow. Data Structures and Algorithms Andrei Bulatov

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

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

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

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

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

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

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

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

Network Flows UPCOPENCOURSEWARE number 34414

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

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

Chapter 7. Network Flow. CS 350: Winter 2018

Algorithm Design and Analysis

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

introduction Ford-Fulkerson algorithm

Reminder: Flow Networks

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

introduction Ford-Fulkerson algorithm

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

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

Algorithmic Discrete Mathematics 6. Exercise Sheet

16 Max-Flow Algorithms and Applications

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

Randomized Perfect Bipartite Matching

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

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).

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

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)

18 Extensions of Maximum Flow

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

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

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

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

23 Maximum Flows and Minimum Cuts

16 Max-Flow Algorithms

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

Average Case Lower Bounds for Monotone Switching Networks

Network Flow Applications

Introduction to Congestion Games

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

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

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

Maximum Flow in Planar Graphs

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

Introduction to SLE Lecture Notes

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

Algorithm Design and Analysis

18.03SC Unit 3 Practice Exam and Solutions

Topics in Combinatorial Optimization May 11, Lecture 22

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

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

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

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

Ford-Fulkerson Algorithm for Maximum Flow

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

Random Walk with Anti-Correlated Steps

Math 333 Problem Set #2 Solution 14 February 2003

u(t) Figure 1. Open loop control system

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

Wrap up: Weighted, directed graph shortest path Minimum Spanning Tree. Feb 25, 2019 CSCI211 - Sprenkle

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

CMU-Q Lecture 3: Search algorithms: Informed. Teacher: Gianni A. Di Caro

Soviet Rail Network, 1955

Algorithm Design and Analysis

Tom Heskes and Onno Zoeter. Presented by Mark Buller

Notes for Lecture 17-18

Bipartite Matching. Matching. Bipartite Matching. Maxflow Formulation

EECE 301 Signals & Systems Prof. Mark Fowler

Efficient Algorithms for Computing Disjoint QoS Paths

, 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

Course Notes for EE227C (Spring 2018): Convex Optimization and Approximation

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

Algorithms and Theory of Computation. Lecture 11: Network Flow

Chapter 2. First Order Scalar Equations

More Digital Logic. t p output. Low-to-high and high-to-low transitions could have different t p. V in (t)

Transcription:

Sovie Rail Nework, 1 Reference: On he hiory of he ranporaion and maximum flow problem. Alexander Schrijver in Mah Programming, 1: 3,.

Maximum Flow and Minimum Cu Max flow and min cu. Two very rich algorihmic problem. Cornerone problem in combinaorial opimizaion. Beauiful mahemaical dualiy. Nonrivial applicaion / reducion. Daa mining. Open-pi mining. Projec elecion. Airline cheduling. Biparie maching. Baeball eliminaion. Image egmenaion. Nework conneciviy. Nework reliabiliy. Diribued compuing. Egaliarian able maching. Securiy of aiical daa. Nework inruion deecion. Muli-camera cene reconrucion. Many many more... 3

Minimum Cu Problem Flow nework. Abracion for maerial flowing hrough he edge. G = (V, E) = direced graph, no parallel edge. Two diinguihed node: = ource, = ink. c(e) = capaciy of edge e. ource 3 8 ink capaciy 3 7

Cu Def. An - cu i a pariion (A, B) of V wih A and B. Def. The capaciy of a cu (A, B) i: cap( A, B) = c(e) e ou of A 3 8 A 3 7 Capaciy = + + = 3

Cu Def. An - cu i a pariion (A, B) of V wih A and B. Def. The capaciy of a cu (A, B) i: cap( A, B) = c(e) e ou of A 3 8 A 3 7 Capaciy = + + 8 + 3 =

Minimum Cu Problem Min - cu problem. Find an - cu of minimum capaciy. 3 8 A 3 7 Capaciy = + 8 + = 8 7

Flow Def. An - flow i a funcion ha aifie: For each e E: f (e) c(e) (capaciy) For each v V {, }: f (e) = f (e) (conervaion) e in o v e ou of v Def. The value of a flow f i: v( f ) = f (e). e ou of 3 8 capaciy flow 3 7 Value = 8

Flow Def. An - flow i a funcion ha aifie: For each e E: f (e) c(e) (capaciy) For each v V {, }: f (e) = f (e) (conervaion) e in o v e ou of v Def. The value of a flow f i: v( f ) = f (e). e ou of 3 8 8 3 8 capaciy 1 flow 11 11 3 7 Value =

Maximum Flow Problem Max flow problem. Find - flow of maximum value. 1 8 3 8 capaciy flow 1 1 3 7 Value = 8

Flow and Cu Flow value lemma. Le f be any flow, and le (A, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. f (e) f (e) = v( f ) e ou of A e in o A 3 8 8 3 8 A 1 11 11 3 7 Value = 11

Flow and Cu Flow value lemma. Le f be any flow, and le (A, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. f (e) f (e) = v( f ) e ou of A e in o A 3 8 8 3 8 A 1 11 11 3 7 Value = + + 8-1 + 11 = 1

Flow and Cu Flow value lemma. Le f be any flow, and le (A, B) be any - cu. Then, he ne flow en acro he cu i equal o he amoun leaving. f (e) f (e) = v( f ) e ou of A e in o A 3 8 8 3 8 A 1 11 11 3 7 Value = - + 8 - + = 13

Flow and Cu Flow value lemma. Le f be any flow, and le (A, B) be any - cu. Then f (e) f (e) = v( f ). e ou of A e in o A Pf. by flow conervaion, all erm excep v = are v( f ) = f (e) e ou of = v A f (e) f (e) e ou of v e in o v = f (e) f (e). e ou of A e in o A 1

Flow and Cu Weak dualiy. Le f be any flow, and le (A, B) be any - cu. Then he value of he flow i a mo he capaciy of he cu. Cu capaciy = 3 Flow value 3 3 8 A 3 7 Capaciy = 3

Flow and Cu Weak dualiy. Le f be any flow. Then, for any - cu (A, B) we have v(f) cap(a, B). Pf. v( f ) = f (e) f (e) e ou of A e in o A f (e) e ou of A c(e) e ou of A = cap(a, B) A 8 7 B 1

Cerificae of Opimaliy Corollary. Le f be any flow, and le (A, B) be any cu. If v(f) = cap(a, B), hen f i a max flow and (A, B) i a min cu. Value of flow = 8 Cu capaciy = 8 Flow value 8 1 8 3 8 A 1 1 3 7 17

Toward a Max Flow Algorihm Greedy algorihm. Sar wih f(e) = for all edge e E. Find an - pah P where each edge ha f(e) < c(e). Augmen flow along pah P. Repea unil you ge uck. 1 3 Flow value = 18

Toward a Max Flow Algorihm Greedy algorihm. Sar wih f(e) = for all edge e E. Find an - pah P where each edge ha f(e) < c(e). Augmen flow along pah P. Repea unil you ge uck. 1 X 3 X X Flow value = 1

Toward a Max Flow Algorihm Greedy algorihm. Sar wih f(e) = for all edge e E. Find an - pah P where each edge ha f(e) < c(e). Augmen flow along pah P. Repea unil you ge uck. locally opimaliy global opimaliy 1 1 3 3 greedy = op = 3

Reidual Graph Original edge: e = (u, v) E. Flow f(e), capaciy c(e). u 17 capaciy v flow Reidual edge. "Undo" flow en. e = (u, v) and e R = (v, u). Reidual capaciy: u 11 reidual capaciy v c(e) f (e) c f (e) = if f (e) e E if e R E reidual capaciy Reidual graph: G f = (V, E f ). Reidual edge wih poiive reidual capaciy. E f = {e : f(e) < c(e)} {e R : c(e) > }. 1

Ford-Fulkeron Algorihm G: 8 capaciy 3

Augmening Pah Algorihm Augmen(f, c, P) { b boleneck(p) foreach e P { } if (e E) f(e) f(e) + b ele f(e R ) f(e) - b } reurn f forward edge revere edge Ford-Fulkeron(G,,, c) { foreach e E f(e) G f reidual graph } while (here exi augmening pah P) { f Augmen(f, c, P) updae G f } reurn f 3

Max-Flow Min-Cu Theorem Augmening pah heorem. Flow f i a max flow iff here are no augmening pah. Max-flow min-cu heorem. [Ford-Fulkeron 1] The value of he max flow i equal o he value of he min cu. Proof raegy. We prove boh imulaneouly by howing he TFAE: (i) There exi a cu (A, B) uch ha v(f) = cap(a, B). (ii) Flow f i a max flow. (iii) There i no augmening pah relaive o f. (i) (ii) Thi wa he corollary o weak dualiy lemma. (ii) (iii) We how conrapoiive. Le f be a flow. If here exi an augmening pah, hen we can improve f by ending flow along pah.

Proof of Max-Flow Min-Cu Theorem (iii) (i) Le f be a flow wih no augmening pah. Le A be e of verice reachable from in reidual graph. By definiion of A, A. By definiion of f, A. v( f ) = f (e) f (e) e ou of A e in o A = c(e) e ou of A = cap(a, B) A B original nework

Running Time Aumpion. All capaciie are ineger beween 1 and C. Invarian. Every flow value f(e) and every reidual capaciie c f (e) remain an ineger hroughou he algorihm. Theorem. The algorihm erminae in a mo v(f*) nc ieraion. Pf. Each augmenaion increae value by a lea 1. Corollary. If C = 1, Ford-Fulkeron run in O(mn) ime. Inegraliy heorem. If all capaciie are ineger, hen here exi a max flow f for which every flow value f(e) i an ineger. Pf. Since algorihm erminae, heorem follow from invarian.

7.3 Chooing Good Augmening Pah

Ford-Fulkeron: Exponenial Number of Augmenaion Q. I generic Ford-Fulkeron algorihm polynomial in inpu ize? m, n, and log C A. No. If max capaciy i C, hen algorihm can ake C ieraion. 1 1 1 X 1 X X 1 C C C C X 1 1 1 X X1 C C C C X 1 1 X X 1 8

Chooing Good Augmening Pah Ue care when elecing augmening pah. Some choice lead o exponenial algorihm. Clever choice lead o polynomial algorihm. If capaciie are irraional, algorihm no guaraneed o erminae! Goal: chooe augmening pah o ha: Can find augmening pah efficienly. Few ieraion. Chooe augmening pah wih: [Edmond-Karp 17, Diniz 17] Max boleneck capaciy. Sufficienly large boleneck capaciy. Fewe number of edge.

Capaciy Scaling Inuiion. Chooing pah wih highe boleneck capaciy increae flow by max poible amoun. Don' worry abou finding exac highe boleneck pah. Mainain caling parameer Δ. Le G f (Δ) be he ubgraph of he reidual graph coniing of only arc wih capaciy a lea Δ. 1 1 1 1 17 1 17 G f G f () 3

Capaciy Scaling Scaling-Max-Flow(G,,, c) { foreach e E f(e) Δ malle power of greaer han or equal o C G f reidual graph } while (Δ 1) { G f (Δ) Δ-reidual graph while (here exi augmening pah P in G f (Δ)) { f augmen(f, c, P) updae G f (Δ) } Δ Δ / } reurn f 31

Capaciy Scaling: Correcne Aumpion. All edge capaciie are ineger beween 1 and C. Inegraliy invarian. All flow and reidual capaciy value are inegral. Correcne. If he algorihm erminae, hen f i a max flow. Pf. By inegraliy invarian, when Δ = 1 G f (Δ) = G f. Upon erminaion of Δ = 1 phae, here are no augmening pah. 3

Capaciy Scaling: Running Time Lemma 1. The ouer while loop repea 1 + log C ime. Pf. Iniially C Δ < C. Δ decreae by a facor of each ieraion. Lemma. Le f be he flow a he end of a Δ-caling phae. Then he value of he maximum flow i a mo v(f) + m Δ. proof on nex lide Lemma 3. There are a mo m augmenaion per caling phae. Le f be he flow a he end of he previou caling phae. L v(f*) v(f) + m (Δ). Each augmenaion in a Δ-phae increae v(f) by a lea Δ. Theorem. The caling max-flow algorihm find a max flow in O(m log C) augmenaion. I can be implemened o run in O(m log C) ime. 33

Capaciy Scaling: Running Time Lemma. Le f be he flow a he end of a Δ-caling phae. Then value of he maximum flow i a mo v(f) + m Δ. Pf. (almo idenical o proof of max-flow min-cu heorem) We how ha a he end of a Δ-phae, here exi a cu (A, B) uch ha cap(a, B) v(f) + m Δ. Chooe A o be he e of node reachable from in G f (Δ). By definiion of A, A. By definiion of f, A. v( f ) = f (e) f (e) e ou of A e in o A Δ) Δ (c(e) e ou of A e in o A = c(e) Δ Δ e ou of A e ou of A e in o A cap(a, B) - mδ A B original nework 3