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)

Similar documents
Problem Set If all directed edges in a network have distinct capacities, then there is a unique 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

Graphs III - Network Flow

Network Flows: Introduction & Maximum Flow

Matching. Slides designed by Kevin Wayne.

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

1 Motivation and Basic Definitions

Algorithmic Discrete Mathematics 6. Exercise Sheet

Reminder: Flow Networks

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

Maximum Flow and Minimum Cut

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

Algorithm Design and Analysis

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

18 Extensions of Maximum Flow

Main Reference: Sections in CLRS.

Randomized Perfect Bipartite Matching

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

Soviet Rail Network, 1955

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

Network Flow. Data Structures and Algorithms Andrei Bulatov

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

CSE 521: Design & Analysis of Algorithms I

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

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

Algorithm Design and Analysis

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

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

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

Introduction to Congestion Games

Today: Max Flow Proofs

Network Flows UPCOPENCOURSEWARE number 34414

Soviet Rail Network, 1955

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

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

16 Max-Flow Algorithms and Applications

Maximum Flow in Planar Graphs

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

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

Network Flow Applications

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

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

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

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.

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

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

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

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

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

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

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

EECE 301 Signals & Systems Prof. Mark Fowler

Discussion Session 2 Constant Acceleration/Relative Motion Week 03

arxiv: v1 [cs.cg] 21 Mar 2013

Average Case Lower Bounds for Monotone Switching Networks

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

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

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

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

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

Solutions for Assignment 2

Algorithms. Algorithms 6.4 MAXIMUM FLOW

Lecture 2-1 Kinematics in One Dimension Displacement, Velocity and Acceleration Everything in the world is moving. Nothing stays still.

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

Topics in Combinatorial Optimization May 11, Lecture 22

We just finished the Erdős-Stone Theorem, and ex(n, F ) (1 1/(χ(F ) 1)) ( n

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

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

18.03SC Unit 3 Practice Exam and Solutions

Lecture 26. Lucas and Stokey: Optimal Monetary and Fiscal Policy in an Economy without Capital (JME 1983) t t

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

u(t) Figure 1. Open loop control system

Graph Theory: Network Flow

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

Math 116 Practice for Exam 2

KINEMATICS IN ONE DIMENSION

Performance Comparison of LCMV-based Space-time 2D Array and Ambiguity Problem

Bipartite Matching. Matching. Bipartite Matching. Maxflow Formulation

Maximum Network Lifetime in Wireless Sensor Networks with Adjustable Sensing Ranges

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

Introduction to SLE Lecture Notes

CHAPTER 7: SECOND-ORDER CIRCUITS

Physics 240: Worksheet 16 Name

Linear Algebra Primer

Designing Information Devices and Systems I Spring 2019 Lecture Notes Note 17

How to Solve System Dynamic s Problems

PHYSICS Solving Equations

Analyze patterns and relationships. 3. Generate two numerical patterns using AC

Mathcad Lecture #8 In-class Worksheet Curve Fitting and Interpolation

15. Bicycle Wheel. Graph of height y (cm) above the axle against time t (s) over a 6-second interval. 15 bike wheel

Fishing limits and the Logistic Equation. 1

Physics 235 Chapter 2. Chapter 2 Newtonian Mechanics Single Particle

Geometric Path Problems with Violations

Electrical and current self-induction

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Civil and Environmental Engineering

6.8 Laplace Transform: General Formulas

Optimal State-Feedback Control Under Sparsity and Delay Constraints

16 Max-Flow Algorithms

Module 2 F c i k c s la l w a s o s f dif di fusi s o i n

d = ½(v o + v f) t distance = ½ (initial velocity + final velocity) time

Transcription:

/0/ dmin lunch oday rading MX LOW PPLIION 0, pring avid Kauchak low graph/nework low nework direced, weighed graph (V, ) poiive edge weigh indicaing he capaciy (generally, aume ineger) conain a ingle ource V wih no incoming edge conain a ingle ink/arge V wih no ougoing edge every verex i on a pah from o 0 0 0 low conrain in-flow = ou-flow for every verex (excep, ) flow along an edge canno exceed he edge capaciy flow are poiive 0 0 0

/0/ Max flow problem Nework flow properie iven a flow nework: wha i he maximum flow we can end from o ha mee he flow conrain? 0 If one of hee i rue hen all are rue (i.e. each implie he he oher): f i a maximum flow f (reidual graph) ha no pah from o f = minimum capaciy cu 0 0 ord-ulkeron pplicaion: biparie graph maching ord-ulkeron(,, ) flow = 0 for all edge f = reidualraph() while a imple pah exi from o in f end a much flow along he pah a poible f = reidualraph() reurn flow iparie graph a graph where every verex can be pariioned ino wo e X and Y uch ha all edge connec a verex u X and a verex v Y

/0/ pplicaion: biparie graph maching pplicaion: biparie graph maching maching M i a ube of edge uch ha each node occur a mo once in M maching M i a ube of edge uch ha each node occur a mo once in M maching pplicaion: biparie graph maching pplicaion: biparie graph maching maching M i a ube of edge uch ha each node occur a mo once in M maching M i a ube of edge uch ha each node occur a mo once in M maching no a maching

/0/ pplicaion: biparie graph maching pplicaion: biparie graph maching maching can be hough of a pairing he verice iparie maching problem: find he large maching in a biparie graph Where migh hi problem come up? - deparmen ha n coure and m faculy - very inrucor can each ome of he coure - Wha coure hould each peron each? - nyime we wan o mach n hing wih m, bu no all hing can mach pplicaion: biparie graph maching pplicaion: biparie graph maching iparie maching problem: find he large maching in a biparie graph eup a a flow problem: idea? - greedy? - dynamic programming?

/0/ pplicaion: biparie graph maching pplicaion: biparie graph maching eup a a flow problem: edge weigh? eup a a flow problem: all edge weigh are pplicaion: biparie graph maching pplicaion: biparie graph maching eup a a flow problem: afer we find he flow, how do we find he maching? eup a a flow problem: mach hoe node wih flow beween hem

/0/ pplicaion: biparie graph maching pplicaion: biparie graph maching I i correc? ume i no here i a beer maching becaue of how we eup he graph flow = # of mache herefore, he beer maching would have a higher flow conradicion (max-flow algorihm find maximal!) Run-ime? o o build he flow? O() n each exiing edge ge a capaciy of n inroduce V new edge (o and from and ) n V i O() (for non-degenerae biparie maching problem) Max-flow calculaion? aic ord-ulkeron: O(max-flow * ) dmund-karp: O(V ) Preflow-puh: O(V ) pplicaion: biparie graph maching pplicaion: biparie graph maching Run-ime? o o build he flow? O() n each exiing edge ge a capaciy of n inroduce V new edge (o and from and ) n V i O() (for non-degenerae biparie maching problem) Max-flow calculaion? aic ord-ulkeron: O(max-flow * ) n max-flow = O(V) n O(V ) iparie maching problem: find he large maching in a biparie graph - deparmen ha n coure and m faculy - very inrucor can each ome of he coure - Wha coure hould each peron each? - ach faculy can each a mo coure a emeer? hange he edge weigh (repreening faculy) o

/0/ urvey eign urvey eign eign a urvey wih he following requiremen: eign urvey aking n conumer abou m produc an only urvey conumer abou a produc if hey own i Queion conumer abou a mo q produc ach produc hould be urveyed a mo ime Maximize he number of urvey/queion aked How can we do hi? each conumer can anwer a mo q queion q q q q conumer c c c produc capaciy edge if conumer owned produc p p each produc can be queioned abou a mo ime p c urvey deign I i correc? ach of he commen above he flow graph mach he problem conrain max-flow find he maximum maching, given he problem conrain dge ijoin Pah wo pah are edge-dijoin if hey have no edge in common Wha i he run-ime? aic ord-ulkeron: O(max-flow * ) dmund-karp: O(V ) Preflow-puh: O(V )

/0/ dge ijoin Pah dge ijoin Pah Problem wo pah are edge-dijoin if hey have no edge in common iven a direced graph = (V, ) and wo node and, find he max number of edge-dijoin pah from o Why migh hi be ueful? dge ijoin Pah Problem dge ijoin Pah iven a direced graph = (V, ) and wo node and, find he max number of edge-dijoin pah from o lgorihm idea? Why migh hi be ueful? edge are unique reource (e.g. communicaion, ranporaion, ec.) how many concurren (non-conflicing) pah do we have from o 8

/0/ dge ijoin Pah Max flow formulaion: aign uni capaciy o every edge dge ijoin Pah Max flow formulaion: aign uni capaciy o every edge Wha doe he max flow repreen? Why? - max-flow = maximum number of dijoin pah - correcne: - each edge can have a mo flow =, o can only be ravered once - herefore, each uni ou of repreen a eparae pah o Max-flow variaion Wha if we have muliple ource and muliple ink (e.g. he Ruian rain problem ha muliple ink)? Max-flow variaion reae a new ource and ink and connec up wih infinie capaciie capaciy nework capaciy nework 9

/0/ Max-flow variaion Max-flow variaion Verex capaciie: in addiion o having edge capaciie we can alo reric he amoun of flow hrough each verex Verex capaciie: in addiion o having edge capaciie we can alo reric he amoun of flow hrough each verex 0/ 0 0/ 0/0 0 0 0 0/0 0/ 0 0/0 Wha i he max-flow now? uni Max-flow variaion Max-flow variaion Verex capaciie: in addiion o having edge capaciie we can alo reric he amoun of flow hrough each verex 0 0 0 0 How can we olve hi problem? or each verex v - creae a new node v - creae an edge wih he verex capaciy from v o v - move all ougoing edge from v o v 0 0 0 0 an you now prove i correc? 0

/0/ Max-flow variaion Max-flow variaion Proof:. how ha if a oluion exi in he original graph, hen a oluion exi in he modified graph. how ha if a oluion exi in he modified graph, hen a oluion exi in he original graph Proof: we know ha he verex conrain are aified n no incoming flow can exceed he verex capaciy ince we have a ingle edge wih ha capaciy from v o v we can obain he oluion, by collaping each v and v back o he original v node n in-flow = ou-flow ince here i only a ingle edge from v o v n becaue here i only a ingle edge from v o v and all he in edge go in o v and ou o v, hey can be viewed a a ingle node in he original graph More problem: maximum independen pah wo pah are independen if hey have no verice in common More problem: maximum independen pah wo pah are independen if hey have no verice in common

/0/ More problem: maximum independen pah ind he maximum number of independen pah Idea? maximum independen pah Max flow formulaion: - aign uni capaciy o every edge (hough any value would work) - aign uni capaciy o every verex ame idea a he maximum edge-dijoin pah, bu now we alo conrain he verice More problem: wirele nework he campu ha hired you o eup he wirele nework here are currenly m wirele aion poiioned a variou (x,y) coordinae on campu he range of each of hee aion i r (i.e. he ignal goe a mo diance r) ny paricular wirele aion can only ho k people conneced You ve calculae he n mo popular locaion on campu and have heir (x,y) coordinae ould he curren nework uppor n differen people rying o connec a each of he n mo popular locaion (i.e. one peron per locaion)? Prove correcne and ae run-ime noher maching problem n people node and m aion node if di(p i,w j ) < r hen add an edge from pi o wj wih weigh (where di i euclidean diance) add edge -> p i wih weigh add edge w j -> wih weigh k add edge if di(p i, w j ) < r p w k p w m n - olve for max-flow - check if flow = m k

/0/ orrecne If here i flow from a peron node o a wirele node hen ha peron i aached o ha wirele node if di(pi,wj) < r hen add an edge from pi o wj wih weigh (where di i euclidean diance) only people able o connec o node could have flow add edge -> pi wih weigh each peron can only connec o one wirele node add edge wj -> wih weigh L a mo L people can connec o a wirele node If flow = m, hen every peron i conneced o a node Runime = O(mn): every peron i wihin range of every node V = m + n + max-flow = O(m), ha a mo m ou-flow O(max-flow * ) = O(m n): ord-ulkeron O(V ) = O((m+n)m n ): dmund-karp O(V ) = O((m+n) ): preflow-puh varian