Algorithm Design and Analysis

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

Soviet Rail Network, 1955

Maximum Flow and Minimum Cut

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

Soviet Rail Network, 1955

Today: Max Flow Proofs

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

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

Graphs III - Network Flow

Algorithm Design and Analysis

Network Flows: Introduction & 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

Network Flow. Data Structures and Algorithms Andrei Bulatov

Algorithm Design and Analysis

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

Matching. Slides designed by Kevin Wayne.

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

1 Motivation and Basic Definitions

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

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

Main Reference: Sections in CLRS.

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

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

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.

CSE 521: Design & Analysis of Algorithms I

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

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

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

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

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

Reminder: Flow Networks

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

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

Randomized Perfect Bipartite Matching

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)

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

Chapter 7. Network Flow. CS 350: Winter 2018

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

Network Flows UPCOPENCOURSEWARE number 34414

Algorithmic Discrete Mathematics 6. Exercise Sheet

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

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

18 Extensions of Maximum Flow

Algorithms. Algorithms 6.4 MAXIMUM FLOW

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

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

Introduction to Congestion Games

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

16 Max-Flow Algorithms and Applications

introduction Ford-Fulkerson algorithm

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

introduction Ford-Fulkerson algorithm

Maximum Flow in Planar Graphs

23 Maximum Flows and Minimum Cuts

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

Average Case Lower Bounds for Monotone Switching Networks

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

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

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

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

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

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

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

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

Ford-Fulkerson Algorithm for Maximum Flow

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

Graph Theory: Network Flow

Solutions to Assignment 1

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

Network Flow Applications

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

Solutions for Assignment 2

Price of Stability and Introduction to Mechanism Design

16 Max-Flow Algorithms

Topics in Combinatorial Optimization May 11, Lecture 22

Introduction to SLE Lecture Notes

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

CS4800: Algorithms & Data Jonathan Ullman

Algorithm Design and Analysis

ARTIFICIAL INTELLIGENCE. Markov decision processes

18.03SC Unit 3 Practice Exam and Solutions

Flow Networks Alon Efrat Slides courtesy of Charles Leiserson with small changes by Carola Wenk. Flow networks. Flow networks CS 445

Journal of Discrete Algorithms. Approximability of partitioning graphs with supply and demand

Max-flow and min-cut

Timed Circuits. Asynchronous Circuit Design. Timing Relationships. A Simple Example. Timed States. Timing Sequences. ({r 6 },t6 = 1.

Max-flow and min-cut

Math 333 Problem Set #2 Solution 14 February 2003

EECE 301 Signals & Systems Prof. Mark Fowler

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

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

Efficient Algorithms for Computing Disjoint QoS Paths

Chapter 2. First Order Scalar Equations

Note: For all questions, answer (E) NOTA means none of the above answers is correct.

Giambattista, Ch 3 Problems: 9, 15, 21, 27, 35, 37, 42, 43, 47, 55, 63, 76

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

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

ln 2 1 ln y x c y C x

6.8 Laplace Transform: General Formulas

Transcription:

Algorihm Deign and Analyi LECTURES 17 Nework Flow Dualiy of Max Flow and Min Cu Algorihm: Ford-Fulkeron Capaciy Scaling Sofya Rakhodnikova S. Rakhodnikova; baed on lide by E. Demaine, C. Leieron, A. Smih, K. Wayne L17.1

Nework Flow S. Rakhodnikova; baed on lide by E. Demaine, C. Leieron, A. Smih, K. Wayne L17.

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. 9 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 9 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 we don coun edge ino A 9 3 8 A 3 7 Capaciy = 9 + + 8 + 3 =

Minimum Cu Problem Min - cu problem. Find an - cu of minimum capaciy. 9 3 8 A 3 7 Capaciy = + 8 + = 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 Waer flowing in and ou of v 9 3 8 capaciy flow 3 7 Value =

Maximum Flow Problem Max flow problem. Find - flow of maximum value. 9 9 1 9 8 9 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 9 3 8 8 3 8 A 1 11 11 3 7 Value =

Flow and Cu Weak dualiy. Le f be any flow. Then, for any - cu (A, B), v(f) cap(a, B). Proof. 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

Review Queion True/Fale Le G be an arbirary flow nework, wih a ource, and ink, and a poiive ineger capaciy c e on every edge e. 1) If f i a maximum - flow in G, hen f aurae every edge ou of wih flow (i.e., for all edge e ou of, we have f(e) = c e ). ) Le (A,B) be a minimum - cu wih repec o hee capaciie. If we add 1 o every capaciy, hen (A,B) i ill a minimum - cu wih repec o he new capaciie.

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 =

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 =

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. How can we ge from greedy o op here? Wha if we puh waer back acro middle edge? 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) > }.

Ford-Fulkeron Algorihm G: 8 capaciy 3 9 1

Augmening Pah Algorihm 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 Augmen(f, c, P) { b boleneck-capaciy(p) foreach e P { } if (e E) f(e) f(e) + b ele f(e R ) f(e R ) - b } reurn f Min reidual capaciy of an edge in P forward edge revere edge

Ford-Fulkeron: Analyi Ford-Fulkeron ummary: While you can, Greedily puh flow Updae reidual graph Lemma 1 (Feaibiliy): Ford-Fulkeron oupu a valid flow. Proof: Check capaciy and conervaion condiion. (Deail in KT) Sill o do: Opimaliy: Doe i oupu a maximum flow? Running ime (in paricular, erminaion!)

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 19] The value of he max flow i equal o he value of he min cu. Proof raegy. We prove boh imulaneouly by howing ha 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, ource A. By definiion of f, ink A. Obervaion: No edge of he reidual graph go from A o B. Claim 1: If e goe from A o B, hen f(e) =c(e). Proof: Oherwie here would be reidual capaciy, and he reidual graph would have an edge A o B. original nework A B Claim : If e goe from B o A, hen f(e)=. Proof: Oherwie reidual edge would go from A o B. v( f ) f (e) f (e) e ou of A e in o A c(e) e ou of A cap(a, B)

Ford-Fulkeron: Analyi Ford-Fulkeron ummary: While you can, Greedily puh flow Updae reidual graph Lemma 1 (Feaibiliy): Ford-Fulkeron oupu a valid flow. Augmening pah heorem. Flow f i a max flow iff here are no augmening pah. Opimaliy: If Ford-Fulkeron erminae hen he oupu i a max flow. Sill o do: Running ime (in paricular, erminaion!)