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

Similar documents
Network Flows: Introduction & Maximum Flow

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

Graphs III - Network Flow

1 Motivation and Basic Definitions

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)

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

18 Extensions of 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

Randomized Perfect Bipartite Matching

Today: Max Flow Proofs

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

Algorithmic Discrete Mathematics 6. Exercise Sheet

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

Maximum Flow and Minimum Cut

Network Flow. Data Structures and Algorithms Andrei Bulatov

Algorithm Design and Analysis

Matching. Slides designed by Kevin Wayne.

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

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

Soviet Rail Network, 1955

Algorithm Design and Analysis

Soviet Rail Network, 1955

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

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

Reminder: Flow Networks

Main Reference: Sections in CLRS.

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

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

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

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

CSE 521: Design & Analysis of Algorithms I

Network Flows UPCOPENCOURSEWARE number 34414

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

16 Max-Flow Algorithms and Applications

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

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

Introduction to Congestion Games

Maximum Flow in Planar Graphs

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.

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

, 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

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

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

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

Graph Theory: Network Flow

Introduction to SLE Lecture Notes

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

Average Case Lower Bounds for Monotone Switching Networks

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

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

EECE 301 Signals & Systems Prof. Mark Fowler

23 Maximum Flows and Minimum Cuts

18.03SC Unit 3 Practice Exam and Solutions

CHAPTER 7: SECOND-ORDER CIRCUITS

Chapter 7: Inverse-Response Systems

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

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

6.8 Laplace Transform: General Formulas

Math 111 Midterm I, Lecture A, version 1 -- Solutions January 30 th, 2007

u(t) Figure 1. Open loop control system

Chapter 7: Solving Trig Equations

Algorithms. Algorithms 6.4 MAXIMUM FLOW

CONTROL SYSTEMS. Chapter 10 : State Space Response

Sample Final Exam (finals03) Covering Chapters 1-9 of Fundamentals of Signals & Systems

Network Flow Applications

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

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

Let. x y. denote a bivariate time series with zero mean.

Physics 240: Worksheet 16 Name

NECESSARY AND SUFFICIENT CONDITIONS FOR LATENT SEPARABILITY

Exponential Sawtooth

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

Topics in Combinatorial Optimization May 11, Lecture 22

13.1 Circuit Elements in the s Domain Circuit Analysis in the s Domain The Transfer Function and Natural Response 13.

To become more mathematically correct, Circuit equations are Algebraic Differential equations. from KVL, KCL from the constitutive relationship

Chapter 9 - The Laplace Transform

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

Biol. 356 Lab 8. Mortality, Recruitment, and Migration Rates

EE 315 Notes. Gürdal Arslan CLASS 1. (Sections ) What is a signal?

Price of Stability and Introduction to Mechanism Design

arxiv: v1 [cs.cg] 21 Mar 2013

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

Linear Motion, Speed & Velocity

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

CHAPTER 12 DIRECT CURRENT CIRCUITS

How to Solve System Dynamic s Problems

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

Ensamble methods: Bagging and Boosting

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

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

ARTIFICIAL INTELLIGENCE. Markov decision processes

Linear Algebra Primer

Solutions for Assignment 2

5.2 GRAPHICAL VELOCITY ANALYSIS Polygon Method

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

TRADITIONAL. MAP: Multi-Constrained Anypath Routing in Wireless Mesh Networks. 1 Introduction

Buckling of a structure means failure due to excessive displacements (loss of structural stiffness), and/or

04. Kinetics of a second order reaction

Transcription:

CSE 202: Deign and Analyi of Algorihm Winer 2013 Problem Se 3 Inrucor: Kamalika Chaudhuri Due on: Tue. Feb 26, 2013 Inrucion For your proof, you may ue any lower bound, algorihm or daa rucure from he ex or in cla, and heir correcne and analyi, bu pleae cie he reul ha you ue. Problem 1 i worh 18 poin. Problem 2 i worh 12 poin. If you do no prove ha your algorihm i correc, we will aume ha i i incorrec. If you do no provide an analyi of he running ime, we will aume you do no know wha he running ime i. Problem 1 The following aemen may or may no be correc. For each aemen, if i i correc, provide a hor proof of correcne. If i i incorrec, provide a couner-example o how ha i i incorrec. 1. In he capaciy-caling algorihm, an edge e can be preen in he reidual graph G f (D) in a mo one D-caling phae. 2. The max-flow problem wih node capaciie i defined a follow. We are given a direced graph G = (V, E) wih ource, ink and capaciie c v 0 for all node v V (bu no edge capaciie c e ). A flow f i feaible in G if for all v oher han and, he oal flow ino node v i a mo c v, and he ize of a feaible flow f i he oal flow ou of. Given hi inpu, he max-flow problem wih node capaciie i o compue a feaible flow of maximum ize. Compuing a max-flow wih node capaciie can be reduced o he regular max-flow problem. 3. Le f and h be a preflow and a labeling compaible wih he preflow. Le (u, v) be an edge in he original graph G, and le h(v) = 4 and h(u) = 2. Then, f(u, v) = 0. 4. Suppoe you have already compued a maximum (, )-flow f in a flow nework G wih ineger capaciie. Le k be an arbirary poiive ineger, and le e be an arbirary edge in G whoe capaciy i a lea k. Now uppoe we increae he capaciy of e by k uni. Then, he maximum flow in he updaed graph can be compued in O( E k) ime. 5. If all direced edge in a nework have diinc capaciie, hen here i a unique maximum flow. 6. If we replace each direced edge in a nework wih wo direced edge in oppoie direcion wih he ame capaciy and connecing he ame verice, hen he value of he maximum flow remain unchanged. Soluion 1. Fale. In he following graph G, he (, a) edge i preen in wo D-caling phae D = 2 5 and D = 1.

2 5 + 1 2 5 a 2. True. The reducion i a follow. We build a graph G, which, for each node v in G wih node capaciy c v, ha wo node wo node v 1 and v 2. All incoming edge o v connec o v 1, and all ougoing edge from v connec from v 2. Finally, add he edge (v 1, v 2 ) wih edge capaciy c v. Now any flow f in G which repec he node capaciy conrain can be convered o a flow f in G which alo repec he edge capaciy conrain. To conver f o f, e f (u 2, v 1 ) = f(u, v) for any edge (u, v) G, and f (v 1, v 2 ) o be he oal incoming flow a node v. A he node capaciy conrain on v i aified in G, f (v 1, v 2 ) c v, and hence f aifie he edge capaciy conrain in G. f alo aifie conervaion conrain becaue f aifie conervaion conrain and becaue of he way we e f (v 1, v 2 ). Moreover, any flow f in G can be convered o a flow f in G ha aifie he node capaciy conrain. To conver f o f, e f(u, v) = f (u 2, v 1 ) for any edge (u, v) G. f aifie node capaciy conrain becaue f aifie capaciy and conervaion conrain; hi enure ha he oal flow hrough any node v i a mo c v. Finally f aifie conervaion conrain becaue f aifie conervaion conrain oo. Thu he max flow in G correpond o a flow in G of maximum ize ha repec he node capaciy conrain. 3. True. Proof i by conradicion. If f(u, v) 0, hen (v, u) i in he reidual graph G f. Noe ha h(v) > h(u) + 1; hi violae he compaibiliy propery for he edge (v, u) G f. 4. True. Simply compue he reidual graph and run he hill-climbing Ford-Fulkeron algorihm from ha poin. The min cu capaciy increae by a mo k. Thu he max flow ize will increae by a mo k. A each ieraion of Ford Fulkeron ake O( E ) ime, and each ieraion improve he max flow by a lea 1, he oal running ime will be O(k E ). 5. Fale. In he following graph G, all he edge capaciie are unique; ye here are a lea wo max-flow f 1 and f 2 of ize 1. Here f 1 (, a) = f 1 (a, v) = f 1 (v, ) = 1, and f 1 (e) = 0 for all oher edge e; f 2 (, b) = f 2 (b, v) = f 2 (v, ) = 1, and f 2 (e) = 0 for all oher edge e.

2 a 3 v 1 4 5 b 6. Fale. Aume ha edge capaciie are 1. In G 1, he max-flow ha ize 0, wherea in G 2, he ize of he max-flow i 1. G1 G2 Problem 2 In a public building uch a a movie heaer, i i imporan o have a plan of exi in he even of a fire. We will deign uch an emergency exi plan in hi queion uing max-flow. Suppoe a movie heaer i repreened by a graph G = (V, E), where each room, landing, or oher locaion i repreened by a verex and each corridor or airway i repreened by an edge. Each corridor ha an aociaed capaciy c, meaning ha a mo c people can pa hrough he corridor a once. Travering a corridor from one end o he oher ake one imeep. (Travering a room ake zero ime.) 1. Suppoe all people are iniially in a ingle room, and here i a ingle exi. Show how o ue maximum flow o find a fae way o ge everyone ou of he building. (Hin: creae anoher graph G ha ha verice o repreen each room a each ime ep.) 2. Show how he ame idea can be ued when people are iniially in muliple locaion and here are muliple exi. 3. Finally, uppoe ha i ake differen (bu ineger) amoun of ime o cro differen corridor or airway, and ha for each uch corridor or airway e, you are alo given an ineger (e) which i he number of econd required o cro e. Now how how o ranform your algorihm in Par (1) o find a fae way o ge everyone ou of he building.

Soluion 1. Suppoe ha here are M people ha need o be moved ou. Fir, we provide an algorihm o decide if all people can be moved ou in T ep. Given hi algorihm, we can do a binary earch on T beween 1 o V M/c o find he hore ime in which all he people can move ou. Our algorihm i a follow: given he graph G, we conruc G T a follow. For each v V, we make T copie of v: v 1,..., v T, where copy v i correpond o ime ep i. For each i, we conruc an edge from v i o v i+1 a ime wih infinie capaciy (people can ju ay in room a a ime ep). We hen conruc an edge from v i o w i+1 wih capaciy c if here exi an edge from v o w wih capaciy c in G. Suppoe everyone i in room a iniially, and he exi i room b. Then we e he ource = a 1, and he ink = b T. To e if all he people can ge from he ource o he ink in T imeep, we check if he max flow in G T i greaer han or equal o he number of people iniially a he ource. If o, we can move all he people acro hi graph in T imeep. 2. We can ue he ame overall idea: conruc a graph G T, and compue i max flow. If i max flow i greaer han or equal o he oal number of people we are rying o move, hen T ime uni uffice o move all he people acro he graph. The conrucion of G T i he ame, excep for he following. We creae a ink and ource. Le S be he ar verice correponding o he room ha iniially conain all he people, and le U be he ink verice ha correpond o all he exi. We creae a link from o each x 1, for each x S wih capaciy equal o he number of people aring a x. Similarly, we creae a link from each x T (for each x U) o T wih infinie capaciie. 3. Again, he overall idea i he ame. Bu when we conruc G T now, we creae edge beween he layer in a differen way: conruc he edge linking v i o w i + (v, w) wih capaciy c if here i an edge beween v and w in G wih rani ime (v, w). Correcne. Suppoe he number of ep oupu by he algorihm i T, and iniially here are M people. To how he correcne, we need o how he following wo aemen. Fir, if here i a way o ge everyone ou of he building in T ep, hen, here exi a flow of ize M in G T. Second, if here exi a flow of ize M in G T, hen, here i a way o ge everyone ou of he building in T ep. We prove hee aemen for par (a) of he queion below; he proof for par (b) and (c) are analogou. For he fir par, conider a chedule for geing everyone ou of he building in ime T. We how ha hi chedule can be convered o a valid flow f of ize M in G T. Given he chedule, we build f a follow: if m people are en hrough he corridor (v, w) a ime i, e f((v i, w i+1 )) = m. If m people linger a room v a ime i, e f((v i, v i+1 )) = m. Se f((u, v)) = 0 for any oher edge (u, v) G T. Since no more han c people can go hrough a corridor a any ime, f aifie all capaciy conrain. Moreover, becaue he chedule enure ha anyone who ener an inermediae room v oher han and ulimaely leave i, and becaue of he way we e f((v i, v i+1 )), f alo aifie conervaion conrain. Finally, he ize of f i he number of people ulimaely moving ou of room a, which i M. Thu if a valid chedule exi, hen, G T ha a max flow of ize M. For he econd par, conider a flow of ize M in G T, and conver i o a chedule a follow: end f((v i, w i+1 )) people from room v o room w hrough he corridor connecing hee room a ime i. Thi i a valid chedule by conrucion of G : all people ar from he ource, and end up a he exi, and people who ener corridor (v, w) a ime i leave a ime i + 1. Moreover, becaue f aifie capaciy conrain, no corridor ha more han c people a any ime; becaue f aifie conervaion conrain, people who ener a room mu ulimaely leave he room. Finally, hi chedule ge everyone ou of he building in ime T, becaue everyone i a he exi a ime T. Thu, if here i a flow of ize M in G T, hen here i a chedule o ge everyone ou of he building in ime T. The correcne proof for par (b) and (c) i analogou.

Running Time. Suppoe he movie heaer ha n room and m corridor. Then for a given T, he conruced G T ha O(T n) node and O(T (m + n)) edge, regardle of which verion of he problem i being olved. The maximum flow value i M and he reducion will work wih a maximum edge capaciy of O(M). The running ime for he max flow problem in ieraion T i hu O(min((m + n)t M, (m + n) 2 T 2 log M, (m + n)n 2 T 3 )), depending on he relaive value of M, T, m and n. We can find he opimal value of T by doing a binary earch fir we double unil we can ge everyone ou of he building in ep; if he fir uch value of we encouner i, hen we can do a binary earch on he inerval [ /2, ] o ge o he correc value of T. Thi procedure will involve O(log T ) invocaion of max flow, each invoked for a 2T. Thu he oal running ime i: O ( log T min((m + n)t M, (m + n) 2 T 2 log M, (m + n)n 2 T 3 ) )