Graph Theory: Network Flow

Similar documents
CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

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

1 Motivation and Basic Definitions

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

Main Reference: Sections in CLRS.

Algorithmic Discrete Mathematics 6. Exercise Sheet

Graphs III - Network Flow

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

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

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

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)

18 Extensions of Maximum Flow

Introduction to Congestion Games

Today: Max Flow Proofs

Maximum Flow and Minimum Cut

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

Network Flow. Data Structures and Algorithms Andrei Bulatov

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

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

CSE 521: Design & Analysis of Algorithms I

Network Flows UPCOPENCOURSEWARE number 34414

Introduction to SLE Lecture Notes

Soviet Rail Network, 1955

Algorithm Design and Analysis

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

Soviet Rail Network, 1955

Algorithm Design and Analysis

Matching. Slides designed by Kevin Wayne.

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

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

CHAPTER 7: SECOND-ORDER CIRCUITS

Reminder: Flow Networks

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

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

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

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

16 Max-Flow Algorithms and Applications

Discussion Session 2 Constant Acceleration/Relative Motion Week 03

, 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

Notes on cointegration of real interest rates and real exchange rates. ρ (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

EECE 301 Signals & Systems Prof. Mark Fowler

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

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

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

6.8 Laplace Transform: General Formulas

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

13.1 Accelerating Objects

arxiv: v1 [cs.cg] 21 Mar 2013

Chapter 7: Inverse-Response Systems

FLAT CYCLOTOMIC POLYNOMIALS OF ORDER FOUR AND HIGHER

NECESSARY AND SUFFICIENT CONDITIONS FOR LATENT SEPARABILITY

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

Average Case Lower Bounds for Monotone Switching Networks

Physics 240: Worksheet 16 Name

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

u(t) Figure 1. Open loop control system

ARTIFICIAL INTELLIGENCE. Markov decision processes

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

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

FIXED POINTS AND STABILITY IN NEUTRAL DIFFERENTIAL EQUATIONS WITH VARIABLE DELAYS

Notes for Lecture 17-18

Maximum Flow in Planar Graphs

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

Price of Stability and Introduction to Mechanism Design

EE202 Circuit Theory II

Physics 235 Chapter 2. Chapter 2 Newtonian Mechanics Single Particle

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

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

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

Inventory Analysis and Management. Multi-Period Stochastic Models: Optimality of (s, S) Policy for K-Convex Objective Functions

Network Flow Applications

Algorithms. Algorithms 6.4 MAXIMUM FLOW

23 Maximum Flows and Minimum Cuts

T-Rough Fuzzy Subgroups of Groups

Mechtild Stoer * Frank Wagner** Abstract. fastest algorithm known. The runtime analysis is straightforward. In contrast to

Math 2142 Exam 1 Review Problems. x 2 + f (0) 3! for the 3rd Taylor polynomial at x = 0. To calculate the various quantities:

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

Mon Apr 2: Laplace transform and initial value problems like we studied in Chapter 5

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

Optimal State-Feedback Control Under Sparsity and Delay Constraints

FUZZY n-inner PRODUCT SPACE

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

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

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 Review of Zero-Sum Games

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

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 12 DIRECT CURRENT CIRCUITS

Linear Response Theory: The connection between QFT and experiments

Exponential Sawtooth

23.2. Representing Periodic Functions by Fourier Series. Introduction. Prerequisites. Learning Outcomes

ū(e )(1 γ 5 )γ α v( ν e ) v( ν e )γ β (1 + γ 5 )u(e ) tr (1 γ 5 )γ α ( p ν m ν )γ β (1 + γ 5 )( p e + m e ).

Let us start with a two dimensional case. We consider a vector ( x,

Phys1112: DC and RC circuits

EE Control Systems LECTURE 2

Generalized Orlicz Spaces and Wasserstein Distances for Convex-Concave Scale Functions

Transcription:

Univeriy of Wahingon Mah 336 Term Paper Graph Theory: Nework Flow Auhor: Ellio Broard Advier: Dr. Jame Morrow 3 June 200

Conen Inroducion...................................... 2 2 Terminology...................................... 2 3 Shore Pah Problem............................... 3 3. Dijkra Algorihm............................... 3.2 Example Uing Dijkra Algorihm...................... 5 3.3 The Correcne of Dijkra Algorihm.................... 7 3.3. Lemma (Triangle Inequaliy for Graph)................ 8 3.3.2 Lemma (Upper-Bound Propery).................... 8 3.3.3 Lemma................................... 8 3.3. Lemma................................... 9 3.3.5 Lemma (Convergence Propery)..................... 9 3.3.6 Theorem (Correcne of Dijkra Algorihm)............. 9 Maximum Flow Problem.............................. 0. Terminology.................................... 0.2 Saemen of he Maximum Flow Problem................... 2.3 Ford-Fulkeron Algorihm............................ 2. Example Uing he Ford-Fulkeron Algorihm................. 3.5 The Correcne of he Ford-Fulkeron Algorihm............... 6.5. Lemma................................... 6.5.2 Lemma................................... 6.5.3 Lemma................................... 7.5. Lemma................................... 8.5.5 Lemma................................... 8.5.6 Lemma................................... 8.5.7 Theorem (Max-Flow Min-Cu Theorem)................ 8 5 Concluion....................................... 9

Inroducion An imporan udy in he field of compuer cience i he analyi of nework. Inerne ervice provider (ISP), cell-phone companie, earch engine, e-commerce ie, and a variey of oher buinee receive, proce, ore, and ranmi gigabye, erabye, or even peabye of daa each day. When a uer iniiae a connecion o one of hee ervice, he end daa acro a wired or wirele nework o a rouer, modem, erver, cell ower, or perhap ome oher device ha in urn forward he informaion o anoher rouer, modem, ec. and o forh unil i reache i deinaion. For any given ource, here are ofen many poible pah along which he daa could ravel before reaching i inended recipien. When I iniiae a connecion o Google from my lapop here a he Univeriy of Wahingon, for example, packe of daa fir ravel from my wirele card o my rouer, hen from my rouer o a hub in he underworking of McCary Hall, hen o he cenral erver of he Univeriy of Wahingon, which ranmi hem along ome pah unknown o me unil hey finally reach one of Google many erver 0 milliecond laer. From any one ource o an inended deinaion, however, here are ofen many differen roue ha daa can ake. Under ligh raffic, he Univeriy of Wahingon migh diribue he ak of ending i Inerne uer packe hrough ju wo or hree erver, wherea under heavy raffic i migh ue wice or hree ime a many. By preading ou he raffic acro muliple erver, he Univeriy of Wahingon enure ha no one erver will bog down wih overue and low down he connecion peed of everyone uing i. The idea ha here are many poible pah beween a ource and a deinaion in a nework give rie o ome inereing queion. Specifically, if he connecion peed beween every wo inerlinked componen i known, i i poible o deermine he fae poible roue beween he ource and deinaion? Suppoing ha all of he raffic beween wo componen wa o follow a ingle pah, however, how would hi affec he performance of he individual componen and connecion along he roue? A hined above, he opimum oluion for he fae poible ranmiion of daa ofen involve preading ou raffic o oher componen, even hough one componen or connecion migh be much faer han all he oher. In hi paper, we eek o build a framework in which we can preciely ae hee queion, and one ha will allow u o provide aifacory anwer. 2 Terminology The udy of nework i ofen abraced o he udy of graph heory, which provide many ueful way of decribing and analyzing inerconneced componen. To ar our dicuion of graph heory and hrough i, nework we will fir begin wih ome erminology. Fir of all, we define a graph G = (V,E) o be a e of verice V = {v,v 2,...,v m } and a e of edge E = {e,e 2,...,e n }. An edge i a connecion beween one or wo verice in a graph; we expre an edge e i a an unordered pair (v j,v k ), where v j,v k V. If j = k, hen e i i called a loop. To illurae hee concep, conider he following graph: 2

v 2 e 5 e 2 v 3 e v e 6 e7 e e 3 v If we le G denoe hi graph, hen G = (V,E), where V = {v,v 2,v 3,v } and E = {e,e 2,e 3,e,e 5,e 6,e 7 }. We can expre he edge a e = (v,v ), e 2 = (v,v 2 ), e 3 = (v,v ), e = (v 2,v ), e 5 = (v 2,v 3 ), and e 6 = (v,v ). Noe ha e i a loop, ince i connec v o ielf. Thiypeofgraphialoknownaanundireced graph,inceiedgedonohaveadirecion. A direced graph, however, i one in which edge do have direcion, and we expre an edge e a an ordered pair (v,v 2 ). Remark ha in an undireced graph, we have (v,v 2 ) = (v 2,v ), ince edge are unordered pair. Someime i i convenien o hink of he edge of a graph a having weigh, or a cerain co aociaed wih moving from one verex o anoher along an edge. If he co of an edge e = (v,v 2 ) i c, hen we wrie w(e) = w(v,v 2 ) = c. Graph whoe edge have weigh are alo known a weighed graph. We define a pah beween wo verice v and v n o be an ordered uple of verice (v,v 2,...,v n ), where (v j,v j+ ) i an edge of he graph for each j n. Noe ha in a direced graph, if he pah (v,v 2,...,v n ) connec he wo verice v and v n, i i no necearily he cae ha (v n,v n,...,v ) i a pah connecing hem a well, ince (v i,v i+ ) (v i+,v i ). Two verice v,v 2 are aid o be pah-conneced if here i a pah from v o v 2. The oal co of a pah i he um of he co of he edge, o C = n j= w(v j,v j+ ) i he co of he pah from v o v n. 3 Shore Pah Problem A commonly occurring problem involving weighed graph, boh direced and undireced, i o find he minimum co neceary o move from one verex o anoher; ha i, o find he hore pah beween hem. The mo well-known algorihm for deermining hi pah i Dijkra Algorihm, preened by Edger Dijkra in 959, which acually olve he more general problem of finding he hore pah from a given verex o all oher verice under he rericion ha edge have non-negaive weigh. In conra, he A* Search Algorihm find he hore pah beween any wo given verice in a weighed graph wih non-negaive edge weigh, and Ford Algorihm (omeime credied a he Bellman-Ford Algorihm) find he hore pah from a given verex o all oher verice in a weighed graph wihou rericion on he ign of he edge weigh. For he purpoe of nework flow, we are concerned only wih graph ha have non-negaive edge weigh, and prefer a oluion ha olve he more general problem of hore pah from one verex o all oher verice. 3

For furher reading, however, he reader may refer o [2] for an exploraion of he A* Search Algorihm or [, p. 5] or [, ec. 2.] for an exploraion of he Bellman-Ford Algorihm. Before we preen he ep and proof of Dijkra Algorihm, we will fir formulae a precie aemen of he problem we are aemping o olve. Le G = (V,E) be a weighed graph wih he e of verice V and e of edge E, wih each e E aifying w(e) 0, and le v,v 2 V uch ha v and v 2 are pah-conneced. We will aume ha G i direced; if i i undireced, hen conider he edge (u,v) o be he ame a he edge (v,u). Which pah P = (w,w 2,...,w n ) for w = v, w n = v 2 minimize he um C = n i= w(w i,w i+ )? 3. Dijkra Algorihm Le G = (V,E) be a direced weighed graph wih he e of verice V and he e of edge E wih non-negaive weigh a above, and le v,v 2 V uch ha v and v 2 are pahconneced. We claim ha he pah P produced by he below algorihm ha he lowe oal co C of any poible pah from v o v 2.. Aign a diance value o every verex. Where d denoe diance, e d(v ) = 0 and d(v) = for all oher v V. 2. Mark each verex a unknown, and e he curren verex v c o be v. 3. Mark he curren verex v c a known.. Le N c = {v V (v c,v) E and v i unknown} be he e of unknown neighbor of v c. For each v N c, le d(v) = min{d(v),d(v c )+w(v c,v)}. If he value of d(v) change, hen e p(v) = v c. We will ue p(v) o denoe he verex hrough which hi one wa acceed. 5. Se v c = v d, where v d N c ha he propery ha d(v d ) = min v V {d(v)}. If v d = v 2, hen proceed o he nex ep; oherwie, reurn o ep 3. 6. Le P be an ordered uple of verice currenly coniing of he ingle verex v 2, and le v c = v 2. 7. Le N c = {v V (v,v c ) E}, and le v d N c uch ha for all v N c, d(v d ) d(v). Iner v d a he fron of P. 8. If v d v, hen e v c = v d and reurn o ep 7. If v d = v hen we are done; P i he lowe-co pah from v o v 2. Noe ha a ep 5 of he algorihm, replacing he check for v c = v 2 wih he condiion ha all verice are known would allow he algorihm o coninue unil he hore diance from v o any any verex i known. For hi o be guaraneed o work, however, we would need o add he rericion ha here i a lea one pah from v o all oher verice, ince oherwie i would fail when here i no pah from a known node o any of he unknown node. A for wheher erminaing he algorihm when v 2 i known i ignificanly faer on average han allowing i o run unil all verice are known, Thoma Cormen [, p. 92] wrie ha no algorihm for [he ingle-pair hore pah] problem are known ha run aympoically faer han he be ingle-ource algorihm in he wor cae.

We can alo expre Dijkra Algorihm in peudocode a follow. Some of he deail of hi code borrow from [6, ec. 9.3]. Pah dijkra(graph g, Verex ar, Verex end) { 2 for each Verex v in g { 3 v.di = INFINITY; v.known = fale; 5 } 6 7 ar.di = 0; 8 ar.known = rue; 9 0 while(rue) { v = unknown Verex wih malle diance 2 3 // if he hore diance o he end verex i known, exi he loop if(v == end) 5 break; 6 7 v.known = rue; 8 9 for each Verex w where (v, w) i an edge { 20 if(v.di + Co(v, w) < w.di) { 2 // updae he diance o w 22 w.di = v.di + Co(v, w); 23 2 // remember ha we raveled hrough v o ge o w 25 w.pah = v; 26 } 27 } 28 } 29 30 // he hore diance o he end verex i known, o ieraively conruc he pah 3 // from end o ar 32 Pah p = new Pah; 33 p.inerafron(end); 3 35 Verex curren = end; 36 while(curren!= ar) { 37 // move o he nex verex on he hore pah o he aring verex 38 curren = curren.pah; 39 p. inerafron( curren); 0 } 2 reurn p; 3 } 3.2 Example Uing Dijkra Algorihm Here we will ep hrough an example applicaion of Dijkra Algorihm. In hi example, we would like o find he hore pah beween he verice v and v 8 in he picured graph. To how he proce of he algorihm, we will ue he value nex o he name of each verex o denoe i curren diance d, and we will mark a verex a known by diplaying i label in bold. For he ake of pace, he value of p(v) i no hown. A each new verex i marked known, he diance of i neighboring verice are updaed o reflec he new poible pah o hem. 5

v 0 3 v 2 v 3 2 5 v 0 3 v 2 3 v 3 2 5 v 2 v 5 v 2 v 5 5 3 v 6 v 7 v 8 5 3 v 6 v 7 v 8 (a) Se up diance (b) v i marked a known v 0 3 v 2 3 v 3 2 5 v 0 3 v 2 3 v 3 7 2 5 v 6 2 v 5 v 5 2 v 5 8 5 3 v 6 v 7 v 8 5 3 v 6 v 7 v 8 (c) v 6 i marked a known (d) v 2 i marked a known v 0 3 v 2 3 v 3 7 2 5 v 0 3 v 2 3 v 3 7 2 5 v 5 2 v 5 7 v 5 2 v 5 7 5 3 5 3 v 6 v 7 v 8 v 6 v 7 v 8 (e) v i marked a known (f) v 3 i marked a known 6

v 0 3 v 2 3 v 3 7 2 5 v 0 3 v 2 3 v 3 7 2 5 v 5 2 v 5 7 v 5 2 v 5 7 5 3 5 3 v 6 v 7 8 v 8 0 v 6 v 7 8 v 8 9 (g) v 5 i marked a known (h) v 7 i marked a known v 0 3 v 2 3 v 3 7 2 5 v 5 2 v 5 7 5 3 v 6 v 7 8 v 8 9 (i) v 8 i marked a known A hi poin, he algorihm would race he hore pah from v 8 back o v, which in hi cae i (v,v 2,v,v 5,v 7,v 9 ). A i urned ou, he algorihm marked ha every oher verex wa known before i marked v 8 a known, o he algorihm explored every verex poible before proceeding. If he weigh of edge (v 5,v 8 ) were exchanged wih he weigh of (v 7,v 8 ), hough, he algorihm would have marked v 8 a known before v 7 and hence proceeded o conrucing he hore pah wihou acually exploring every node. 3.3 The Correcne of Dijkra Algorihm We know urn our aenion o a proof ha Dijkra Algorihm will ucceed in finding he hore pah in general. The idea for he following proof i imilar o ha preened in [, ec. 2.3]. To aid in he developmen of hi proof, we will fir define he funcion δ : V V Z o be he minimum-co pah from i fir parameer o he econd (0 if he wo parameer are he ame verex), or if no pah exi. We will alo define Relax(u,v) o be he operaion of eing d(v) = min{d(v),d(u)+w(u,v)} and eing p(v) = u if d(v) changed. Wha we would like o how i ha for a aring verex v and an ending verex v 2, a he compleion of Dijkra algorihm we have d(v 2 ) = δ(v,v 2 ). To do hi, we will fir prove ome lemma concerning hore pah and he relaxaion of edge. 7

3.3. Lemma (Triangle Inequaliy for Graph) Le G(V, E) be a direced, weighed graph wih non-negaive edge weigh, and uppoe ha v V i he aring verex of G, where here i a lea one pah from v o any oher verex. Then for all edge (u,v) E, δ(v,v) δ(v,u)+w(u,v). Proof: Le v V. Since here i pah from v o v, here i a hore pah P from v o v, he oal co of which i le han or equal o any oher pah from v o v. So if (u,v) E, hen he co of any pah from v o u and hen from u o v i no le han he co of P, and hence he hore pah from v o v ha pae hrough u ha a lea a much co a P. In paricular, δ(v,v) δ(v,u)+w(u,v), which i wha we waned o how. 3.3.2 Lemma (Upper-Bound Propery) Le G(V, E) be a direced, weighed graph wih non-negaive edge weigh, and uppoe ha v V i he aring verex of G, where here i a lea one pah from v o any oher verex. Iniialize d(v ) = 0, d(v) = for v v. Then d(v) δ(v,v) for all v V, and hi propery hold even if we apply any equence of operaion Relax(v j,v k ) o (v j,v k ) E. Furhermore, if d(v) = δ(v,v) a ome poin in hi equence, hen d(v) = δ(v,v) afer each ubequen operaion. Proof: We will proceed by inducion o how ha he aemen d(v) δ(v,v) for all verice v V hold afer each operaion Relax(v j,v k ) in he equence. Bae cae: Before any edge are relaxed, we have d(v ) = 0 δ(v,v ) = 0. d(v) = δ(v,v), ince here i a pah from v o v, o he aemen hold. Inducive ep: Now aume ha he aemen hold for all operaion Relax(v i,v j ) in he equence prior o he operaion Relax(v k,v l ). We know ha d(v) δ(v,v) for all v V prior o hi operaion by he inducive hypohei, and ince Relax(v k,v l ) can only change d(v l ), we need only o how ha d(v l ) δ(v,v l ). Since d(v l ) δ(v,v l ) before he operaion Relax(v k,v l ) by he inducive hypohei, uppoe ha Relax(v k,v l ) change he value of d(v l ). Then d(v l ) = d(v k )+w(v k,v l ) δ(v,v k )+w(v k,v l ) δ(v,v l ), (Byheinducivehypohei) (ByheTriangleInequaliyforGraph) which complee he inducive proof. Furhermore, a any ep in he equence of relaxaion, if d(v) = δ(v,v), hen d(v) will remain unchanged pa ha poin. Thi follow from he fac ha Relax(v j,v k ) e d(v k ) o he minimum of d(v k ) and d(v j )+w(v j,v k ), neiher of which can be le han δ(v,v k ) by he definiion of δ, and relaxing he edge canno increae d(v k ). 3.3.3 Lemma LeG(V,E)beadireced, weighedgraphwihnon-negaiveedgeweigh, andle(u,v) E. Then immediaely afer he operaion Relax(u,v), we have d(v) d(u)+w(u,v). 8

Proof: Suppoe ha ju before relaxing he edge (u, v), d(v) > d(u) + w(u, v). Then d(v) = d(u)+w(u,v) aferward, o he deired inequaliy hold. Now uppoe ha d(v) d(u) + w(u,v) ju before he edge (u,v) i relaxed. Then neiher d(u) nor d(v) change during he operaion, o d(v) d(u)+w(u,v) aferward a well, which i wha we waned o how. 3.3. Lemma Le G(V, E) be a direced, weighed graph wih non-negaive edge weigh. Le P = (v,v 2,...,v n ) be a hore pah from v o v n, and denoe he ubpah (v i,v i+,...,v j ) a P ij. Then P ij i he hore pah from v i o v j. Proof: Noice ha w(p) = w(p i )+w(p ij )+w(p jn ). Aume ha here i ome pah P ij from v i o v j wih weigh w(p ij) < w(p ij ). Then P i P ij P jn i a pah from v o v n wih weigh w(p i )+w(p ij)+w(p jn ) < w(p). Bu hi i a conradicion, ince P i he hore pah from v o v n, o P ij i he hore pah from v i o v j a we waned o how. 3.3.5 Lemma (Convergence Propery) Le G(V, E) be a direced, weighed graph wih non-negaive edge weigh. Suppoe ha v V i he aring verex of G, and le P be he hore pah from v o v, where u precede v on he pah. Furher uppoe ha we iniialize d(v ) = 0, d(v) = for v v and hen apply Relax(v j,v k ) o a ube of edge (v j,v k ) E conaining (u,v). Then if d(u) = δ(v,u) a ome poin before hi erie of operaion, d(v) = δ(v,v) afer he erie of operaion. Proof: By he Upper-Bound Propery, if d(u) = δ(v,u) a ome poin before he operaion Relax(u, v), hen he ame equaliy hold afer all ubequen relax operaion. Afer he edge (u,v) i relaxed, we have d(v) d(u)+w(u,v) = δ(v,u)+w(u,v) (ByLemma3.3.3) = δ(v,v) (ByLemma3.3.) 3.3.6 Theorem (Correcne of Dijkra Algorihm) We now have he mean o prove he validiy of he Dijkra Algorihm. Le G = (V, E) be a graph, eiher undireced or direced, wih non-negaive edge weigh, and le v,v 2 V uch ha v and v 2 are pah-conneced. Then he pah P produced by Dijkra Algorihm ha he lowe oal co of any pah connecing v and v 2. Proof: We proceed by examining he ae of he known verice denoed S, and how ha each ieraion of Dijkra Algorihm, d(v) = δ(v,v) for all v S. For he ake of noaion, we will aume ha v i pah-conneced o every oher v V, ince Dijkra Algorihm only operae on pah-conneced verice anyway. Noe ha a he beginning of Dijkra Algorihm, he fir verex o be marked a known i v, and d(v ) i e o 0, o d(v ) = δ(v,v ) = 0 a we wan. We now wan o how ha in each proceeding ieraion of Dijkra Algorihm, if he unknown verex v V S i marked a known, hen d(v) = δ(v,v). In order o do hi, we 9

will uppoe ha hi i no rue and eablih a conradicion, o le u V be he fir verex added o S for which d(u) δ(v,u). We already know ha d(v ) = δ(v,v ) = 0, o u v, and hence S. v and u are pah-conneced, o here mu be a hore pah P from v o u. Before u wa marked a known, P conneced he verex v S o he verex u V S, o we have a verex y along P uch ha y V S and a predeceor x S. Noice ha x S, o ince u wa choen a he fir verex wih d(u) δ(v,u), we know ha d(x) = δ(v,x) when x wa added o S. We alo applied Relax(x,y) when x wa added o S, o by he Convergence Propery, d(y) = δ(v,y). Becaue y occur on he pah P and all of he edge of E are non-negaive, we have ha δ(v,y) δ(v,u) and hence d(y) = δ(v,y) δ(v,u) d(u) by he Upper-Bound Propery. Since boh u and y were in V S when u wa choen, however, we have ha d(u) d(y), o in fac d(y) = δ(v,y) = δ(v,y) = d(u). Bu hen δ(v,u) = d(u), which i a conradicion of how u wa choen. So d(u) = δ(v,u) when u i added o S, and hence d(v) = δ(v,v) for all v S a each ep of he algorihm. In paricular, d(v 2 ) = δ(v,v 2 ), o he pah ha Dijkra Algorihm conruc from v o v 2 i in fac he hore poible pah. Maximum Flow Problem Wih Dijkra Algorihm, we have olved one of he major problem ha we poed a he beginning of hi paper. We have hown ha given a graph wih a cerain co aociaed o each edge, we can find he pah of lowe co from one verex o any oher verex, or more pecifically, ha given a nework wih a cerain peed aociaed o each connecion beween componen, we can find he fae poible roue from one componen o anoher. Sending all of a nework raffic over a ingle pah, however, can caue performance degradaion for all he connecion ha ue i. For each connecion beween componen, here i a limi o how much raffic can pa over i a once wihou negaively impacing i peed or reliabiliy, which in compuer cience i known a channel capaciy. In hi ecion, we will explore he problem of maximizing he flow of daa over a nework from one componen o anoher given a channel capaciy for each connecion. More generally, hi i known a he maximum flow problem for flow nework.. Terminology We will begin he dicuion of maximum flow wih ome erminology. A flow nework i a direced graph G = (V,E) in which each edge (u,v) E ha a capaciy c(u,v) 0. For edge (u,v) / E, we define c(u,v) = 0. A oppoed o ar and end verice, we inead refer o he origin and deinaion verice in a flow nework a he ource and he ink, repecively. We will aume ha in a flow nework G = (V,E) wih ource and ink, for any verex v V here i a pah from o ha pae hrough v. A flow in a flow nework G = (V,E) wih ource and ink i a funcion f : V V R ha aifie he following properie:. Capaciy Conrain: For all u,v V, f(u,v) c(u,v). 2. Skew Symmery: For all u,v V, f(u,v) = f(v,u). 0

3. Flow Conervaion: If u V and u, u, hen v V f(u,v) = 0. We ay ha f(u,v) i he flow from verex u o verex v. For wo e of verice X and Y and a flow funcion f, we define f(x,y) = f(x,y) and c(x,y) = c(x,y). x X y Y x X y Y The value of a flow f, no o be confued wih abolue value or norm, i denoed f and defined a f = f(,v); i.e. he oal flow ou of he ource. v V The following i an example of a flow nework ha illurae hee concep: v 6 v 2 3 7 2 5 2 5 v 3 5 v (a)aflowneworkg = (V,E)whereeachedge(u,v) E i labeled wih c(u,v). v 5/6 v 2 3/3 6/7 2/ 2/2 0/5 /2 /5 / / v 3 2/5 v (b) The ame flow nework G, where each edge (u,v) E i labeled wih f(u,v)/c(u,v) for a flow funcion f. In he fir figure, we have conruced a flow nework G = (V,E) wih verice V = {,v,v 2,v 3,v,} and edge E a indicaed, where he capaciy c(u,v) of each edge (u,v) i labeled. In he econd figure, we have labeled he flow acro each edge of a flow funcion f o helefofeachedge capaciy. Thoughnopicuredforeveryedge, weef(v,u) = f(u,v) for all (u,v) E. The reader may quickly verify ha f aifie he Capaciy Conrain and he Skew Symmery properie, and by umming he flow ino and ou of each verex, ha f alo aifie he Flow Conervaion propery of flow funcion. The value of he flow f, in hi cae, i f = 7, which i he oal flow ou of he ource and ino he ink. Addiionally, for a flow nework G = (V,E) and a flow f, we define he reidual capaciy of

an edge (u,v) E o be c f (u,v) = c(u,v) f(u,v); ha i, he difference beween he flow currenly being en acro an edge and he capaciy of he edge. The reidual nework of G induced by he flow f i G f = (V,E f ), where E f = {(u,v) u,v Eandc f (u,v) > 0}. The reidual nework G f of he flow nework given in he above example i picured below: 5 v v 2 3 6 6 3 2 v 3 v 3 (c) The reidual nework G f of he flow nework picured above. Each edge (u,v) i labeled wih c f (u,v)..2 Saemen of he Maximum Flow Problem Wih hi erminology in mind, we can formulae a precie aemen of he maximum flow problem: For a flow nework G = (V,E) wih ource and ink, wha flow funcion f maximize f? We will olve hi problem uing he Ford-Fulkeron algorihm, which wa fir preened by Leer Ford, Jr. and Delber Fulkeron in 956 [5]. Similar o he preenaion of Dijkra Algorihm, we will fir give he Ford-Fulkeron Algorihm a a equence of ep and hen again in peudocode..3 Ford-Fulkeron Algorihm Le G = (V,E) be a flow nework wih ource and ink. We claim ha i produce a flow funcion f ha maximize f. Noe ha c f (P) i imply a emporary variable for he reidual capaciy of he pah P.. For each edge (u,v) E, iniialize f(u,v) = f(v,u) = 0. 2. If here i a pah P from o in he reidual nework G f, coninue o ep 3, oherwie erminae. 3. Se c f (P) = min (u,v) P c f(u,v).. For each (u,v) P, e f(u,v) = f(u,v)+c f (P) and f(v,u) = f(u,v). 5. Reurn o ep 2. 2

In peudocode, we can expre hi algorihm a follow: FlowFuncion fordfulkeron( FlowNework G, Verex, Verex ) { 2 FlowFuncion f = new FlowFuncion(); 3 // iniialize he value of f for each edge in G o 0 5 for each Edge e in G { 6 f.evalue(e.from, e.o) = 0; 7 f.evalue(e.o, e.from) = 0; 8 } 9 0 // recall ha he reidual nework of G ha he ame verice a G, bu // conain only hoe edge e of G wih a poiive reidual capaciy cf(e) 2 ReidualNework Gf = G. reidualnework( f); 3 // here we aume ha Gf.gePah(, ) reurn any pah from o in Gf 5 // (i doe no maer which one) or null if no uch pah exi 6 Pah P = Gf.gePah(, ); 7 while(p!= null) { 8 // find he minimum reidual capaciy of he edge on P 9 in cfmin = NaN; 20 for each Edge e in P { 2 if(cfmin == NaN e.reidualcapaciy(f) < cfmin) 22 cfmin = e.reidualcapaciy(f); 23 } 2 25 // updae he flow of f acro each edge on P o be i curren flow plu 26 // he minimum reidual capaciy of he edge on P 27 for each Edge e in P { 28 f.evalue(e.from, e.o) = f.gevalue(e.from, e.o) + cfmin; 29 f.evalue(e.o, e.from) = -f.gevalue(e.from, e.o); 30 } 3 } 32 33 reurn f; 3 }. Example Uing he Ford-Fulkeron Algorihm Before we prove he correcne of he Ford-Fulkeron Algorihm, we will how an example of i applicaion uing he flow nework G = (V,E) from he figure above. A each ep where we elec a new pah P, we will mark i in bold. v 0/6 v 2 0/3 0/7 0/ 0/2 0/5 0/2 0/5 0/ 0/ v 3 0/5 v (a) Iniialize he value of f for each edge o 0. Here he flow nework G i hown wih each edge (u,v) labeled a f(u,v)/c(u,v). 3

v 6 v 2 3 7 2 5 2 5 v 3 5 v (b) The flow nework G f, wih each edge (u,v) labeled a v f (u,v). v 6 v 2 3 7 2 5 2 5 v 3 5 v (c) Selec a pah P from o. In hi cae, c f (P) = 3. Here he value of c f (u,v) are hown on each edge. 3/0 v 3/6 v 2 3/0 3/0 3/3 3/7 0/ 0/2 0/5 0/2 0/5 0/ 0/ v 3 0/5 v (d) Updae he value of f along P. Here each edge (u,v) i labeled a f(u,v)/c(u,v) We have included ome edge wih zero capaciy imply o how he flow acro hem.

3 v 3 v 2 3 2 5 2 5 v 3 5 v (e) The reuling reidual nework G f, wih edge (u,v) labeled a c f (u,v). v 3 v 2 3 3 2 5 2 5 v 3 5 v (f) Selec a new pah P from o. Here c f (P) =. 3/0 v 3/6 v 2 3/0 7/0 3/3 7/7 0/ 0/2 0/5 /2 /5 / /0 v 3 /5 v /0 0/ (g) Updae he value of f for each edge along he pah. Each edge (u,v) i labeled a f(u,v)/c(u,v). 5

v 3 v 2 3 7 2 5 6 v 3 v (h) The reuling reidual nework G f, wih edge (u,v) labeled a c f (u,v). Since here i no longer a pah from o, he algorihm erminae..5 The Correcne of he Ford-Fulkeron Algorihm The correcne of he Ford-Fulkeron Algorihm i acually a reul of he Max-Flow Min-Cu Theorem, which we will prove here afer inroducing a few lemma and heir conequence. Before we begin, however, we mu fir inroduce a few more erm. Fir, for wo flow funcion f,f 2 over he e of edge E, we define heir flow um f +f 2 o be he funcion (f +f 2 )(u,v) = f (u,v)+f 2 (u,v) for (u,v) E. The cu of a flow nework G = (V,E) i a pariion of V ino wo e S and T, where S, T, and T = V S. The ne flow acro he cu (S,T) i f(s,t), and he capaciy of he cu i c(s,t). A minimum cu i a cu wih he minimum poible capaciy of any cu..5. Lemma Le G = (V,E) be a flow nework wih ource, ink, and flow funcion f. Then we have. For all X V, f(x,x) = 0. 2. For all X,Y V, f(x,y) = f(y,x). 3. ForallX,Y,Z V wihx Y =, f(x Y,Z) = f(x,z)+f(y,z)andf(z,x Y) = f(z,x)+f(z,y)..5.2 Lemma Le G = (V,E) be a flow nework wih ource, ink, and flow funcion f. Le G f be he reidual nework of G induced by f, and le f be a flow funcion of G f. Then he flow um f +f i a flow in G wih value f +f = f + f. Proof: To how ha he flow um i a flow in G, we mu verify he properie of flow 6

funcion. For he Capaciy Conrain, we have (f +f )(u,v) = f(u,v)+f (u,v) f(u,v)+(c(u,v) f(u,v)) = c(u,v), (Sincef (u,v) c f (u,v)) o he fir propery hold. For Skew Symmery, we have (f +f )(u,v) = f(u,v)+f (u,v) = f(v,u) f (v,u) = (f(v,u)+f (v,u)) = (f +f )(v,u), o he econd propery hold. For flow conervaion, for all u V, we have +f v V(f )(u,v) = (f(u,v)+f (u,v)) v V = f(u,v)+ v V v V = 0+0 = 0, f (u,v) o he hird propery hold and hu he flow um f +f i a flow of G. Finally, he value of he flow um i f +f = v V(f +f )(,v) = v V(f(,v)+f (,v)) = v V f(,v)+ v V f (,v) = f + f, which conclude he proof..5.3 Lemma Le G = (V,E) be a flow nework wih ource, ink, and flow funcion f, and le G f be he reidual nework induced by f. Le P be a pah from o in G f. Then he funcion defined by c f (P) If (u,v) P, f p (u,v) = c f (P) If (v,u) P, 0 If (u,v) / P and(v,u) / P i a flow in G f. Furhermore, i ha value f p = c f (P) > 0, ince G f ha edge wih poiive capaciie. 7

.5. Lemma Le G = (V,E) be a flow nework wih ource, ink, and flow funcion f, and le G f be he reidual nework induced by f. Le P be a pah from o in G f, and le f P a defined in Lemma.5.3. Define he flow f a f = f +f P. Then by Lemma.5.2 and Lemma.5.3, f i a flow in G wih value f = f + f P > f..5.5 Lemma Le G = (V,E) be a flow nework wih ource, ink, and flow funcion f, and le (S,T) be a cu of G. Then he ne flow f(s,t) = f. Proof: By Flow Conervaion, f(s {},V) = 0. Applying Lemma.5., we have f(s,t) = f(s,v) f(s,s) (Bypar3) = f(s,v) (Bypar) = f(,v)+f(s,v) (Bypar3) = f(,v) (ByFlowConervaion) = f..5.6 Lemma Le G = (V,E) be a flow nework wih flow funcion f. Then for any cu (S,T) of G, f c(s,t). Proof: By Lemma.5.5 and he Capaciy Conrain, we have f = f(s,t) = f(u,v) u S v T c(u, v) u S v T = c(s,t)..5.7 Theorem (Max-Flow Min-Cu Theorem) We are finally able o prove he Max-Flow Min-Cu Theorem, which how ha once he flow nework G f of a flow nework G and a flow funcion f no longer ha a pah from he ource o he ink, ha f ha he maximum value of any poible flow funcion for G. Since he Ford-Fulkeron Algorihm ierae over he pah in G f, improving upon he flow funcion f unil no pah from exi from o in G, proving he Max-Flow Min-Cu Theorem i equivalen o howing ha he Ford-Fulkeron Algorihm i correc. We ae he heorem a follow: Le G = (V,E) be a flow nework wih ource, ink, and flow funcion f, and le G f be he reidual nework of G induced by f. Then he following aemen are equivalen:. f i a maximum flow in G. 8

2. G f ha no pah from o. 3. f = c(s,t) for ome cu (S,T) of G. Proof: Fir we will how ha if () hold, hen (2) alo hold. Le f be a flow funcion ha maximize he flow in G, and uppoe ha here i ill ome pah P in G f from o. Le f P be defined a in Lemma.5.3. Then by Lemma.5., he flow um f +f P ha value f +f P = f + f P > f, which conradic he aumpion ha f maximize he flow in G. So () implie (2) a we waned. Now we will how ha (2) implie (3). Suppoe ha G f ha no pah from o, and le S = {v V here i a pah from o v in G f }, T = V S. Then (S,T) i a cu of G, ince S, and here i no pah from o in G f, o / S and hence T. Le u S, T. Then f(u,v) = c(u,v), ince if hi were no he cae, (u,v) would be an edge of G f and hence v would be in S. By Lemma.5.5, hen, f = f(s,t) = c(s,t) a we waned o how. Finally we will how ha (3) implie (). By Lemma.5.6, we have f c(s,t) for all cu (S,T) of G. Since f = c(s,t) by (3), f i a maximum flow funcion of G. Thu we have hown he equivalence of (), (2), and (3), which complee he proof. 5 Concluion In hi paper, we have olved wo relaed problem in nework heory. Fir, given a nework where he peed of he connecion beween every wo componen i known, we can find he fae poible connecion from one componen, uch a a compuer, o anoher, uch a a web erver, by applying Dijkra Algorihm o he correponding graph. Second, given a nework where here i a limi o how much raffic can pa over each connecion beween componen, we can ue he Ford-Fulkeron Algorihm o deermine a flow funcion ha give u he maximum poible raffic beween one componen and anoher. Thee wo algorihm preen bu a parial picure of nework heory, however. We can find he opimum pah from one componen o anoher, bu wha if one componen along he roue were o freeze? I would be helpful o know he econd- and hird-fae roue o he deinaion a well. In addiion, we have aken an omnicien view of he graph ha we have examined o far; how can we have he individual componen in a nework communicae effecively o olve he hore-pah or max-flow problem? There are alo more apec han peed and channel capaciy o conider in finding he be roue beween componen, ince reliabiliy, i.e. he number of packe a connecion uccefully ranmi veru how many are en over i, i ju a or perhap more imporan han peed in many cae. For furher reading, Inroducion o Algorihm [] i a grea reource on he ue and runime of graph algorihm, and Daa Srucure and Algorihm Analyi in Java [6] preen graph algorihm and heir implemenaion in code from a compuer cience perpecive. 9

Reference [] Cormen, Thoma H. Inroducion o Algorihm. 2nd ed. Cambridge, Maachue: MIT, 200. [2] Decher, Rina, and Judea Pearl. Generalized Be-fir Search Sraegie and he Opimaliy of A*. Journal of he ACM 32.3 (985): 505-36. ACM Digial Library. Web. 8 May 200. [3] Deo, Naringh. Graph Theory wih Applicaion o Engineering and Compuer Science. Englewood Cliff, NJ: Prenice-Hall, 97. [] Even, Shimon. Graph Algorihm. Compuer Science Pre, 979. [5] Ford, Jr., L. R., and D. R. Fulkeron. Maximal Flow Through a Nework. Canadian Journal of Mahemaic 8 (956): 399-0. Canadian Mahemaical Sociey. Web. 2 June 200. [6] Wei, Mark Allen. Daa Srucure and Algorihm Analyi in Java. 2nd ed. Boon: Pearon Addion-Weley, 2007. [7] Wilon, Robin. Inroducion o Graph Theory. New York, NY: Academic Pre, 972. 20