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

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

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

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

Soviet Rail Network, 1955

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

Today: Max Flow Proofs

Main Reference: Sections in CLRS.

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

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

Network Flow. Data Structures and Algorithms Andrei Bulatov

Graphs III - Network Flow

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

Soviet Rail Network, 1955

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

Matching. Slides designed by Kevin Wayne.

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

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

1 Motivation and Basic Definitions

Maximum Flow and Minimum Cut

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

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

Warm Up. Correct order: s,u,v,y,x,w,t

Network Flows: Introduction & Maximum Flow

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

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

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

Algorithm Design and Analysis

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

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

CSE 521: Design & Analysis of Algorithms I

Algorithm Design and Analysis

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

Network Flows UPCOPENCOURSEWARE number 34414

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)

Algorithms. Algorithms 6.4 MAXIMUM FLOW

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

16 Max-Flow Algorithms and Applications

Introduction to Congestion Games

18 Extensions of Maximum Flow

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

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.

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

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

Algorithmic Discrete Mathematics 6. Exercise Sheet

Randomized Perfect Bipartite Matching

Reminder: Flow Networks

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

introduction Ford-Fulkerson algorithm

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

Lecture 16 (Momentum and Impulse, Collisions and Conservation of Momentum) Physics Spring 2017 Douglas Fields

Network Flow Applications

introduction Ford-Fulkerson algorithm

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

COMPETITIVE LOCAL ROUTING WITH CONSTRAINTS

On the Submodularity of Influence in Social Networks

23 Maximum Flows and Minimum Cuts

On Line Supplement to Strategic Customers in a Transportation Station When is it Optimal to Wait? A. Manou, A. Economou, and F.

Maximum Flow in Planar Graphs

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

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

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

16 Max-Flow Algorithms

Competitive Routing in the Half-θ 6 -Graph

Chapter 3 Kinematics in Two Dimensions

Physics Notes - Ch. 2 Motion in One Dimension

I. OBJECTIVE OF THE EXPERIMENT.

ME 425: Aerodynamics

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

Energy Problems 9/3/2009. W F d mgh m s 196J 200J. Understanding. Understanding. Understanding. W F d. sin 30

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

2. VECTORS. R Vectors are denoted by bold-face characters such as R, V, etc. The magnitude of a vector, such as R, is denoted as R, R, V

PHYSICS 151 Notes for Online Lecture #4

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 SLE Lecture Notes

Chapter 5. Localization. 5.1 Localization of categories

arxiv: v1 [cs.cg] 21 Mar 2013

EECE 301 Signals & Systems Prof. Mark Fowler

u(t) Figure 1. Open loop control system

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

Math 221: Mathematical Notation

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

Differential Geometry: Revisiting Curvatures


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

, 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

MIXED BOUNDARY VALUE PROBLEM FOR A QUARTER-PLANE WITH A ROBIN CONDITION

Brock University Physics 1P21/1P91 Fall 2013 Dr. D Agostino. Solutions for Tutorial 3: Chapter 2, Motion in One Dimension

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

HYPOTHESIS TESTING. four steps. 1. State the hypothesis and the criterion. 2. Compute the test statistic. 3. Compute the p-value. 4.

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

Chapter 7. Network Flow. CS 350: Winter 2018

Topics in Combinatorial Optimization May 11, Lecture 22

CHAPTER 7: SECOND-ORDER CIRCUITS

Greedy algorithms. Shortest paths in weighted graphs. Tyler Moore. Shortest-paths problem. Shortest path applications.

6.302 Feedback Systems Recitation : Phase-locked Loops Prof. Joel L. Dawson

Star coloring of sparse graphs

Notes for Lecture 17-18

Transcription:

CMP 6610/4610 Fall 2016 Flow Nework Carola Wenk lide adaped rom lide by Charle Leieron

Max low and min c Fndamenal problem in combinaorial opimizaion Daliy beween max low and min c Many applicaion: Biparie maching Image egmenaion Airline chedling Nework reliabiliy rey deign Baeball eliminaion Gene ncion predicion 2

Flow nework Deiniion. A low nework i a direced graph G = V E wih wo diingihed erice: a orce and a ink. Each edge E ha a nonnegaie capaciy c. I E hen c = 0. We reqire ha i E hen E. 2 Example: 3 3 1 1 3 2 3 2 3

Flow nework Deiniion. A poiie low on G i a ncion : V V R aiying he ollowing: Capaciy conrain: For all V 0 c. Flow coneraion: For all V \{ } V V The ale o a low i he ne low o o he orce: V V 0 4

A low on a nework low capaciy 1:3 2:2 2:3 1:3 1:1 2:2 2:3 1:2 Flow coneraion like Kircho crren law: Flow ino i 2 + 1 = 3. Flow o o i 1 + 2 = 3. The ale o hi low i 1 + 2 = 3. 5

The maximm-low problem Maximm-low problem: Gien a low nework G ind a low o maximm ale on G. 2:3 2:2 2:3 0:3 1:1 2:2 3:3 2:2 The ale o he maximm low i 4. 6

7 C Deiniion. A c T o a low nework G = V E i a pariion o V ch ha and T. I i a low on G hen he ne low acro he c i The capaciy o he c i T T T T c T c

C 2:3 0:3 2:2 1:1 2:3 T 2:2 2:2 3:3 T = 2 + 2+1+2 2+1 = 4 ct = 2+3+1+3 = 9 8

9 Anoher characerizaion o low ale Lemma. For any low and any c T we hae = T. } \{ T T T T T V V V V V V V V Proo: 0

10 Upper bond on he maximm low ale Theorem. The ale o any low i bonded rom aboe by he capaciy o any c: ct.. Proo. T c c T T T T T

Flow ino he ink 2:3 2:2 2:3 0:3 1:1 2:2 3:3 2:2 = {} V\{} = V\{} = 4 11

Reidal nework Deiniion. Le be a low on G = V E. The reidal nework G V E i he graph wih reidal capaciie c ie c = i E 0 oherwie Edge in E admi more low. Lemma. E 2 E. 12

Agmening pah Deiniion. Le p be a pah rom o in G. The reidal capaciy o p i c p min { c }. p I c p > 0 hen p i called an agmening pah in G wih repec o. The low ale can be increaed along an agmening pah p by c p. Ex.: G: 3:5 2:6 4:5 2:3 2:5 c p = 2 G : p 2 4 4 2 3 3 2 1 1 2 13

Agmening pah con. G: c p = 2 G : p 3:5 2:6 2 4 4:5 2:3 4 2 2:5 3 G: 3 5:5 2 4:6 1. 2:5 0:3 1 4:5 2 G : 0 2 2 0 5 4 3 3 1 4 14

Max-low min-c heorem Theorem. The ollowing are eqialen: 1. = c T or ome c T. min-c 2. i a maximm low. 3. admi no agmening pah. Proo. 1 2: ince c T or any c T he ampion ha c T implie ha i a maximm low. 2 3: I here wa an agmening pah he low ale cold be increaed conradicing he maximaliy o. 15

Proo conined 3 1: Deine = { V : here exi an agmening pah in G rom o } and le T = V \. ince admi no agmening pah here i no pah rom o in G. Hence and T and h T i a c. Conider any erice and T. pah in G T We m hae c = 0 ince i c > 0 hen no T a amed. Th = c i E ince c = c. And oherwie =0. mming oer all and T yield T = c T and ince = T he heorem ollow. 16

Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 10 9 10 9 1 10 9 10 9 17

Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 0:10 9 0:10 9 0:1 0:10 9 0:10 9 18

Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 0:10 9 0:10 9 0:1 0:10 9 0:10 9 19

Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 1:10 9 0:10 9 1:1 0:10 9 1:10 9 20

Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 1:10 9 0:10 9 1:1 0:10 9 1:10 9 21

Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 1:10 9 1:10 9 0:1 1:10 9 1:10 9 22

Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 1:10 9 1:10 9 0:1 1:10 9 1:10 9 23

Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Can be low: G: 2:10 9 1:10 9 1:1 1:10 9 2:10 9 2 billion ieraion on a graph wih 4 erice! 24

Ford-Flkeron max-low algorihm Algorihm: [ ] 0 or all E while an agmening pah p in G wr exi: agmen by c p Rnime: Le * be he ale o a maximm low and ame i i an inegral ale. The iniializaion ake O E ime There are a mo * ieraion o he loop Find an agmening pah wih DF in O V + E ime Each agmenaion ake O V ime O E * ime in oal 25

Edmond-Karp algorihm Edmond and Karp noiced ha many people implemenaion o Ford-Flkeron agmen along a breadh-ir agmening pah: a hore pah in G rom o where each edge wih poiie capaciy ha weigh 1. Thee implemenaion wold alway rn relaiely a. ince a breadh-ir agmening pah can be ond in O V + E ime heir analyi which proided he ir polynomial-ime bond on maximm low oce on bonding he nmber o low agmenaion. In independen work Dinic alo gae polynomial-ime bond. 26

Rnning ime o Edmond- Karp One can how ha he nmber o low agmenaion i.e. he nmber o ieraion o he while loop i O V E. Breadh-ir earch rn in O V + E ime All oher bookkeeping i O V per agmenaion. The Edmond-Karp maximm-low algorihm rn in O V E 2 ime. 27

Monooniciy lemma Lemma. Le = be he breadh-ir diance rom o in G. Dring he Edmond- Karp algorihm increae monoonically. Proo. ppoe ha i a low on G and agmenaion prodce a new low. Le =. We ll how ha by indcion on. For he bae cae = 0. For he indcie cae conider a breadh-ir pah in G. We m hae + 1 ince bpah o hore pah are hore pah. Cerainly E and now conider wo cae depending on wheher E. 28

Cae 1 Cae: E. We hae + 1 riangle ineqaliy + 1 indcion = breadh-ir pah and h monooniciy o i eablihed. 29

Cae 2 Cae: E. ince E he agmening pah p ha prodced rom m hae inclded. Moreoer p i a breadh-ir pah in G : p =. Th we hae 1 breadh-ir pah 1 indcion 2 breadh-ir pah < hereby eablihing monooniciy or hi cae oo. 30

Coning low agmenaion Theorem. The nmber o low agmenaion in he Edmond-Karp algorihm Ford-Flkeron wih breadh-ir agmening pah i O V E. Proo. Le p be an agmening pah and ppoe ha we hae c = c p or edge p. Then we ay ha i criical and i diappear rom he reidal graph aer low agmenaion. Example: G : 2 3 4 2 7 2 1 3 2 c p = 2 31

Coning low agmenaion Theorem. The nmber o low agmenaion in he Edmond-Karp algorihm Ford-Flkeron wih breadh-ir agmening pah i O V E. Proo. Le p be an agmening pah and ppoe ha we hae c = c p or edge p. Then we ay ha i criical and i diappear rom he reidal graph aer low agmenaion. Example: G : 5 2 4 5 1 2 3 4 32

Coning low agmenaion conined The ir ime an edge i criical we hae = + 1 ince p i a breadh-ir pah. We m wai nil i on an agmening pah beore can be criical again. Le be he diance ncion when i on an agmening pah. Then we hae + 1 breadh-ir pah + 1 monooniciy + 2 breadh-ir pah. Example: 33

Coning low agmenaion conined The ir ime an edge i criical we hae = + 1 ince p i a breadh-ir pah. We m wai nil i on an agmening pah beore can be criical again. Le be he diance ncion when i on an agmening pah. Then we hae + 1 breadh-ir pah + 1 monooniciy + 2 breadh-ir pah. Example: = 5 = 6 34

Coning low agmenaion conined The ir ime an edge i criical we hae = + 1 ince p i a breadh-ir pah. We m wai nil i on an agmening pah beore can be criical again. Le be he diance ncion when i on an agmening pah. Then we hae + 1 breadh-ir pah + 1 monooniciy + 2 breadh-ir pah. Example: = 5 = 6 35

Coning low agmenaion conined The ir ime an edge i criical we hae = + 1 ince p i a breadh-ir pah. We m wai nil i on an agmening pah beore can be criical again. Le be he diance ncion when i on an agmening pah. Then we hae + 1 breadh-ir pah + 1 monooniciy + 2 breadh-ir pah. Example: 7 6 36

Coning low agmenaion conined The ir ime an edge i criical we hae = + 1 ince p i a breadh-ir pah. We m wai nil i on an agmening pah beore can be criical again. Le be he diance ncion when i on an agmening pah. Then we hae + 1 breadh-ir pah + 1 monooniciy + 2 breadh-ir pah. Example: 7 6 37

Coning low agmenaion conined The ir ime an edge i criical we hae = + 1 ince p i a breadh-ir pah. We m wai nil i on an agmening pah beore can be criical again. Le be he diance ncion when i on an agmening pah. Then we hae + 1 breadh-ir pah + 1 monooniciy + 2 breadh-ir pah. Example: 7 8 38

Rnning ime o Edmond- Karp Diance ar o nonnegaie neer decreae and are a mo V 1 nil he erex become nreachable. Th occr a a criical edge O V ime becae increae by a lea 2 beween occrrence. ince he reidal graph conain O E edge he nmber o low agmenaion i O V E. Corollary. The Edmond-Karp maximm-low algorihm rn in O V E 2 ime. Proo. Breadh-ir earch rn in O E ime and all oher bookkeeping i O V per agmenaion. 39

Be o dae The aympoically ae algorihm o dae or maximm low de o King Rao and Tarjan rn in O V E log E / V log V V ime. I we allow rnning ime a a ncion o edge weigh he ae algorihm or maximm low de o Goldberg and Rao rn in ime Omin{ V 2/3 E 1/2 } E log V 2 / E + 2 log C where C i he maximm capaciy o any edge in he graph. 40