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

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

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

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

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

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

Main Reference: Sections in CLRS.

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

1 Motivation and Basic Definitions

Graphs III - Network Flow

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

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

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

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

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

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

Network Flows: Introduction & Maximum Flow

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

Randomized Perfect Bipartite Matching

Soviet Rail Network, 1955

Soviet Rail Network, 1955

Network Flow Applications

Matching. Slides designed by Kevin Wayne.

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

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

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

Maximum Flow and Minimum Cut

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

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.

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

Algorithmic Discrete Mathematics 6. Exercise Sheet

Today: Max Flow Proofs

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)

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

Star coloring of sparse graphs

CSE 521: Design & Analysis of Algorithms I

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

Algorithm Design and Analysis

Algorithm Design and Analysis

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.

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

Reminder: Flow Networks

18 Extensions of Maximum Flow

Competitive Routing in the Half-θ 6 -Graph

Network Flows UPCOPENCOURSEWARE number 34414

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

Introduction to Congestion Games

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

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

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

introduction Ford-Fulkerson algorithm

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

Fall 2014 David Wagner MT2 Soln

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

introduction Ford-Fulkerson algorithm

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

Algorithms. Algorithms 6.4 MAXIMUM FLOW

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.

CHAPTER 7: SECOND-ORDER CIRCUITS

Chapter 8 Objectives

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

COMPETITIVE LOCAL ROUTING WITH CONSTRAINTS

, 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

Rectilinear Kinematics

EECE 301 Signals & Systems Prof. Mark Fowler

16 Max-Flow Algorithms and Applications

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

Math 2214 Solution Test 1 B Spring 2016

Q2.1 This is the x t graph of the motion of a particle. Of the four points P, Q, R, and S, the velocity v x is greatest (most positive) at

DESIGN OF TENSION MEMBERS

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

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

Graph Theory: Network Flow

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

Connectivity and Menger s theorems

Matchings in Cayley Graphs of S n. North Carolina State University, Box Abstract

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

TP B.2 Rolling resistance, spin resistance, and "ball turn"

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

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

6.8 Laplace Transform: General Formulas

HYPOTHESIS TESTING. four steps. 1. State the hypothesis. 2. Set the criterion for rejecting. 3. Compute the test statistics. 4. Interpret the results.

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

5.2 GRAPHICAL VELOCITY ANALYSIS Polygon Method

EE Control Systems LECTURE 2

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

18.03SC Unit 3 Practice Exam and Solutions

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

On the usage of Sorting Networks to Big Data

Physics Notes - Ch. 2 Motion in One Dimension

Phys 221 Fall Chapter 2. Motion in One Dimension. 2014, 2005 A. Dzyubenko Brooks/Cole

3.6 Derivatives as Rates of Change

Selfish Routing and the Price of Anarchy. Tim Roughgarden Cornell University

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

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

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

Transcription:

Maximm Flo 5/6/17 21:08 Preenaion for e ih he exbook, Algorihm Deign and Applicaion, by M. T. Goodrich and R. Tamaia, Wiley, 2015 Maximm Flo χ 4/6 4/7 1/9 2015 Goodrich and Tamaia Maximm Flo 1 Flo Neork A flo neork (or j neork) N coni of n A eighed digraph G ih nonnegaie ineger edge eigh, here he eigh of an edge e i called he capaciy c(e) of e n To diingihed erice, and of G, called he orce and ink, repeciely, ch ha ha no incoming edge and ha no ogoing edge. Example: 5 6 3 1 1 2 3 7 9 5 2015 Goodrich and Tamaia Maximm Flo 2 1

Maximm Flo 5/6/17 21:08 Flo A flo f for a neork N i i an aignmen of an ineger ale f(e) o each edge e ha aifie he folloing properie: Capaciy Rle: For each edge e, 0 f (e) c(e) Coneraion Rle: For each erex, f ( e) = f e E ( ) + e E ( ) ( e) here E - () and E + () are he incoming and ogoing edge of, rep. The ale of a flo f, denoed f, i he oal flo from he orce, hich i he ame a he oal flo ino he ink Example: 1/3 3/7 2/9 4/5 2015 Goodrich and Tamaia Maximm Flo 3 Maximm Flo A flo for a neork N i aid o be maximm if i ale i he large of all flo for N The maximm flo problem coni of finding a maximm flo for a gien neork N Applicaion n Hydralic yem n Elecrical circi n Traffic moemen n Freigh ranporaion 1/3 3/7 2/9 4/5 Flo of ale 8 = 2 + 3 + 3 = 1 + 3 + 4 4/6 3/7 2/9 4/5 Maximm flo of ale 10 = 4 + 3 + 3 = 3 + 3 + 4 2015 Goodrich and Tamaia Maximm Flo 4 2

Maximm Flo 5/6/17 21:08 C A c of a neork N ih orce and ink i a pariion χ = (V,V ) of he erice of N ch ha V and V n Forard edge of c χ: origin in V n and deinaion in V Backard edge of c χ: origin in V and deinaion in V Flo f(χ) acro a c χ: oal flo of forard edge min oal flo of backard edge Capaciy c(χ) of a c χ: oal capaciy of forard edge Example: n c(χ) = 24 n f(χ) = 8 2015 Goodrich and Tamaia Maximm Flo 5 5 6 χ χ 3 1 1 2 3 1/3 7 9 3/7 2/9 5 4/5 Flo and C Lemma: The flo f(χ) acro any c χ i eqal o he flo ale f Lemma: The flo f(χ) acro a c χ i le han or eqal o he capaciy c(χ) of he c Theorem: The ale of any flo i le han or eqal o he capaciy of any c, i.e., for any flo f and any c χ, e hae f c(χ) χ 1 χ 2 1/3 3/7 2/9 4/5 c(χ 1 ) = 12 = 6 + 3 + 1 + 2 c(χ 2 ) = 21 = 3 + 7 + 9 + 2 f = 8 2015 Goodrich and Tamaia Maximm Flo 6 3

Maximm Flo 5/6/17 21:08 Agmening Pah Conider a flo f for a neork N Le e be an edge from o : n Reidal capaciy of e from o : Δ f (, ) = c(e) - f (e) n Reidal capaciy of e from o : Δ f (, ) = f (e) Le π be a pah from o n The reidal capaciy Δ f (π) of π i he malle of he reidal capaciie of he edge of π in he direcion from o A pah π from o i an agmening pah if Δ f (π) > 0 2015 Goodrich and Tamaia Maximm Flo 7 2/5 π 1/3 2/7 2/9 Δ f (,) = 3 Δ f (,) = 1 Δ f (,) = 1 Δ f (,) = 2 Δ f (π) = 1 f = 7 4/5 Flo Agmenaion Lemma: Le π be an agmening pah for flo f in neork N. There exi a flo fʹ for N of ale fʹ = f + Δ f (π) Proof: We compe flo fʹ by modifying he flo on he edge of π 2/3 n Forard edge: fʹ (e) = f(e) + Δ f (π) 2/7 n Backard edge: fʹ (e) = f(e) - Δ f (π) 2/9 4/5 2015 Goodrich and Tamaia Maximm Flo 8 2/5 π 1/3 2/7 2/9 Δ f (π) = 1 π 4/5 f = 7 fʹ = 8 4

Maximm Flo 5/6/17 21:08 The Ford-Flkeron Algorihm Iniially, f(e) = 0 for each edge e Repeaedly n Search for an agmening pah π n Agmen by Δ f (π) he flo along he edge of π A pecialiaion of DFS (or BFS) earche for an agmening pah n An edge e i raered from o proided Δ f (, ) > 0 2015 Goodrich and Tamaia Maximm Flo 9 Max-Flo and Min-C Terminaion of Ford- Flkeron algorihm n There i no agmening pah from o ih repec o he crren flo f Define V e of erice reachable from by agmening pah V e of remaining erice C χ = (V,V ) ha capaciy c(χ) = f n Forard edge: f(e) = c(e) n Backard edge: f(e) = 0 Th, flo f ha maximm ale and c χ ha minimm capaciy Theorem: The ale of a maximm flo i eqal o he capaciy of a minimm c 4/6 χ 4/7 1/9 c(χ) = f = 10 2015 Goodrich and Tamaia Maximm Flo 10 5

Maximm Flo 5/6/17 21:08 Example (1) 0/6 0/3 0/2 0/3 1/7 0/9 0/5 1/6 1/3 0/3 2/7 0/9 0/3 1/3 0/6 1/6 1/7 2/7 1/3 2/3 0/9 0/9 2015 Goodrich and Tamaia Maximm Flo 11 Example (2) 3/6 2/3 2/7 0/9 4/6 o ep 3/7 1/9 2/5 3/6 4/6 2/7 4/7 1/9 2/5 1/9 2015 Goodrich and Tamaia Maximm Flo 12 6

Maximm Flo 5/6/17 21:08 Analyi In he or cae, Ford- Flkeron algorihm perform f* flo agmenaion, here f* i a maximm flo Example n The agmening pah fond alernae beeen π 1 and π 2 n The algorihm perform 100 agmenaion Finding an agmening pah and agmening he flo ake O(n + m) ime The rnning ime of Ford- Flkeron algorihm i O( f* (n + m)) 2015 Goodrich and Tamaia Maximm Flo 13 0/50 0 0/50 0 π 1 π 2 0 0 0 0 Maximm Biparie Maching In he maximm biparie maching problem, e are gien a conneced ndireced graph ih he folloing properie: n The erice of G are pariioned ino o e, X and Y. n Eery edge of G ha one endpoin in X and he oher endpoin in Y. Sch a graph i called a biparie graph. A maching in G i a e of edge ha hae no endpoin in common ch a e pair p erice in X ih erice in Y o ha each erex ha a mo one parner in he oher e. The maximm biparie maching problem i o find a maching ih he greae nmber of edge. 2015 Goodrich and Tamaia Maximm Flo 14 7

Maximm Flo 5/6/17 21:08 Redcion o Max Flo Gien a flo f for H, e e f o define a e M of edge of G ing he rle ha an edge e i in M heneer f(e) = 1. 2015 Goodrich and Tamaia Maximm Flo 15 Example and Analyi Rnning ime i O(nm), becae G i conneced. 2015 Goodrich and Tamaia Maximm Flo 16 8

Maximm Flo 5/6/17 21:08 Baeball Eliminaion Le T be a e of eam in a por leage, hich, for hiorical reaon, le ame i baeball. A any poin dring he eaon, each eam, i, in T, ill hae ome nmber, i, of in, and ill hae ome nmber, g i, of game lef o play. The baeball eliminaion problem i o deermine heher i i poible for eam i o finih he eaon in fir place, gien he game i ha already on and he game i ha lef o play. Noe ha hi depend on more han j he nmber of game lef for eam i, hoeer; i alo depend on he repecie chedle of eam i and he oher eam. 2015 Goodrich and Tamaia Maximm Flo 17 Baeball Eliminaion Example Le g i,j denoe he nmber of game remaining beeen eam i and eam j, o ha g i i he m, oer all j, of he g i,j. 2015 Goodrich and Tamaia Maximm Flo 18 9

Maximm Flo 5/6/17 21:08 Redcion o Max Flo Le ame no ingle eam eliminae eam k (ince hi i eay o check). 2015 Goodrich and Tamaia Maximm Flo 19 Creaing he Graph To conider ho a combinaion of eam and game ocome migh eliminae eam k, e creae a graph, G, ha ha a i erice a orce,, a ink,, and he e T and L. Then, le inclde he folloing edge in G: 2015 Goodrich and Tamaia Maximm Flo 20 10

Maximm Flo 5/6/17 21:08 Creaing he Graph, Example 2015 Goodrich and Tamaia Maximm Flo 21 Iniion and Analyi We can ole baeball eliminaion for any eam in a e of n eam by oling a ingle maximm flo problem on a neork ih a mo O(n 2 ) erice and edge. 2015 Goodrich and Tamaia Maximm Flo 22 11