Max Flow, Min Cut. Maximum Flow and Minimum Cut. Soviet Rail Network, 1955. Minimum Cut Problem



Similar documents
2.4 Network flows. Many direct and indirect applications telecommunication transportation (public, freight, railway, air, ) logistics

Chapter 13. Network Flow III Applications Edge disjoint paths Edge-disjoint paths in a directed graphs

How Much Can Taxes Help Selfish Routing?

On the Connection Between Multiple-Unicast Network Coding and Single-Source Single-Sink Network Error Correction

Chapter 7. Response of First-Order RL and RC Circuits

Acceleration Lab Teacher s Guide

Appendix A: Area. 1 Find the radius of a circle that has circumference 12 inches.

Circle Geometry (Part 3)

Capacitors and inductors

Stock Trading with Recurrent Reinforcement Learning (RRL) CS229 Application Project Gabriel Molina, SUID

The Transport Equation

AP Calculus BC 2010 Scoring Guidelines

A Note on Using the Svensson procedure to estimate the risk free rate in corporate valuation

Mathematics in Pharmacokinetics What and Why (A second attempt to make it clearer)

Random Walk in 1-D. 3 possible paths x vs n. -5 For our random walk, we assume the probabilities p,q do not depend on time (n) - stationary

Optimal Investment and Consumption Decision of Family with Life Insurance

1 A B C D E F G H I J K L M N O P Q R S { U V W X Y Z 1 A B C D E F G H I J K L M N O P Q R S { U V W X Y Z

The Role of Science and Mathematics in Software Development

Fortified financial forecasting models: non-linear searching approaches

The Role of the Scientific Method in Software Development. Robert Sedgewick Princeton University

Globally-Optimal Greedy Algorithms for Tracking a Variable Number of Objects

Chapter 6: Business Valuation (Income Approach)

Inductance and Transient Circuits

AP Calculus AB 2013 Scoring Guidelines

Top-K Structural Diversity Search in Large Networks

Morningstar Investor Return

Signal Rectification

Heat demand forecasting for concrete district heating system

RC (Resistor-Capacitor) Circuits. AP Physics C

Chapter 8: Regression with Lagged Explanatory Variables

Signal Processing and Linear Systems I

Chapter 2 Kinematics in One Dimension

Single-machine Scheduling with Periodic Maintenance and both Preemptive and. Non-preemptive jobs in Remanufacturing System 1

Chapter 8 Student Lecture Notes 8-1

cooking trajectory boiling water B (t) microwave time t (mins)

A Comparative Study of Linear and Nonlinear Models for Aggregate Retail Sales Forecasting

MTH6121 Introduction to Mathematical Finance Lesson 5

THE FIRM'S INVESTMENT DECISION UNDER CERTAINTY: CAPITAL BUDGETING AND RANKING OF NEW INVESTMENT PROJECTS

Optimal Path Routing in Single and Multiple Clock Domain Systems

The Application of Multi Shifts and Break Windows in Employees Scheduling

Stability. Coefficients may change over time. Evolution of the economy Policy changes

AP Calculus AB 2007 Scoring Guidelines

Multiprocessor Systems-on-Chips

Suggested Reading. Signals and Systems 4-2

Smooth Priorities for Multi-Product Inventory Control

Mechanical Fasteners Tensile and Shear Stress Areas

µ r of the ferrite amounts to It should be noted that the magnetic length of the + δ

Lecture 15 Isolated DC-DC converters

9. Capacitor and Resistor Circuits

STABILITY OF LOAD BALANCING ALGORITHMS IN DYNAMIC ADVERSARIAL SYSTEMS

PROFIT TEST MODELLING IN LIFE ASSURANCE USING SPREADSHEETS PART ONE

Quality Assurance in Software Development

Better Bounds for Online Load Balancing on Unrelated Machines

11/6/2013. Chapter 14: Dynamic AD-AS. Introduction. Introduction. Keeping track of time. The model s elements

Module 4. Single-phase AC circuits. Version 2 EE IIT, Kharagpur

Online Convex Programming and Generalized Infinitesimal Gradient Ascent

Mortality Variance of the Present Value (PV) of Future Annuity Payments

Two-Group Designs Independent samples t-test & paired samples t-test. Chapter 10

INTEREST RATE FUTURES AND THEIR OPTIONS: SOME PRICING APPROACHES

Empirical heuristics for improving Intermittent Demand Forecasting

Physical Topology Discovery for Large Multi-Subnet Networks

Making a Faster Cryptanalytic Time-Memory Trade-Off

Analogue and Digital Signal Processing. First Term Third Year CS Engineering By Dr Mukhtiar Ali Unar

Dividend taxation, share repurchases and the equity trap

Fair Stateless Model Checking

Diagnostic Examination

Task is a schedulable entity, i.e., a thread

AP Calculus AB 2010 Scoring Guidelines

Communication Networks II Contents

Strategic Optimization of a Transportation Distribution Network

Economics Honors Exam 2008 Solutions Question 5

Dynamic programming models and algorithms for the mutual fund cash balance problem

Chapter 6 Interest Rates and Bond Valuation

Module 3. R-L & R-C Transients. Version 2 EE IIT, Kharagpur

On Certain Properties of Random Apollonian Networks

Newton s Laws of Motion

Transient Analysis of First Order RC and RL circuits

Differential Equations and Linear Superposition

THE PRESSURE DERIVATIVE

Name: Algebra II Review for Quiz #13 Exponential and Logarithmic Functions including Modeling

Individual Health Insurance April 30, 2008 Pages

INTRODUCTION TO MARKETING PERSONALIZATION. How to increase your sales with personalized triggered s

Answer, Key Homework 2 David McIntyre Mar 25,

Planning Demand and Supply in a Supply Chain. Forecasting and Aggregate Planning

Principal components of stock market dynamics. Methodology and applications in brief (to be updated ) Andrei Bouzaev, bouzaev@ya.

4. International Parity Conditions

Genetic Algorithm Search for Predictive Patterns in Multidimensional Time Series

TEMPORAL PATTERN IDENTIFICATION OF TIME SERIES DATA USING PATTERN WAVELETS AND GENETIC ALGORITHMS

ANALYSIS AND COMPARISONS OF SOME SOLUTION CONCEPTS FOR STOCHASTIC PROGRAMMING PROBLEMS

Trends in TCP/IP Retransmissions and Resets

1 HALF-LIFE EQUATIONS

Chapter 2 Problems. 3600s = 25m / s d = s t = 25m / s 0.5s = 12.5m. Δx = x(4) x(0) =12m 0m =12m

CALCULATION OF OMX TALLINN

Q-SAC: Toward QoS Optimized Service Automatic Composition *

CHARGE AND DISCHARGE OF A CAPACITOR

Imagine a Source (S) of sound waves that emits waves having frequency f and therefore


Ecodesign Requirements for Electric Motors Towards a System-Approach. Demonstrating the benefits of motor starters for fixed speed applications

CHAPTER FIVE. Solutions for Section 5.1

Transcription:

Maximum Flow and Minimum u Max Flow, Min u Max flow and min cu. Two very rich algorihmic problem. ornerone problem in combinaorial opimizaion. eauiful mahemaical dualiy. Minimum cu Maximum flow Max-flow min-cu heorem Ford-Fulkeron augmening pah algorihm dmond-karp heuriic iparie maching Nonrivial applicaion / reducion. Nework conneciviy. iparie maching. aa mining. Open-pi mining. irline cheduling. Image proceing. Projec elecion. aeball eliminaion. Nework reliabiliy. ecuriy of aiical daa. iribued compuing. galiarian able maching. iribued compuing. Many many more... Princeon Univeriy O lgorihm and aa rucure pring Kevin Wayne hp://www.princeon.u/~co ovie Rail Nework, Minimum u Problem Nework: abracion for maerial FLOWING hrough he edge. ireced graph. apaciie on edge. ource node, ink node. Min cu problem. elee "be" e of edge o diconnec from. ource ink capaciy ource: On he hiory of he ranporaion and maximum flow problem. lexander chrijver in Mah Programming, :,.

u u cu i a node pariion (, T) uch ha i in and i in T. capaciy(, T) = um of weigh of edge leaving. cu i a node pariion (, T) uch ha i in and i in T. capaciy(, T) = um of weigh of edge leaving. apaciy = apaciy = Minimum u Problem Maximum Flow Problem cu i a node pariion (, T) uch ha i in and i in T. capaciy(, T) = um of weigh of edge leaving. Min cu problem. Find an - cu of minimum capaciy. Nework: abracion for maerial FLOWING hrough he edge. ireced graph. ame inpu a min cu problem apaciie on edge. ource node, ink node. Max flow problem. ign flow o edge o a o: qualize inflow and ouflow a every inermediae verex. Maximize flow en from o. ource capaciy ink apaciy =

Flow Flow flow f i an aignmen of weigh o edge o ha: apaciy: f(e) u(e). Flow conervaion: flow leaving v = flow enering v. excep a or flow f i an aignmen of weigh o edge o ha: apaciy: f(e) u(e). Flow conervaion: flow leaving v = flow enering v. excep a or capaciy flow Value = capaciy flow Value = Maximum Flow Problem Flow and u Max flow problem: find flow ha maximize ne flow ino ink. Obervaion. Le f be a flow, and le (, T) be any - cu. Then, he ne flow en acro he cu i equal o he amoun reaching. capaciy flow Value = Value =

Flow and u Flow and u Obervaion. Le f be a flow, and le (, T) be any - cu. Then, he ne flow en acro he cu i equal o he amoun reaching. Obervaion. Le f be a flow, and le (, T) be any - cu. Then, he ne flow en acro he cu i equal o he amoun reaching. Value = Value = Flow and u Max Flow and Min u Obervaion. Le f be a flow, and le (, T) be any - cu. Then he value of he flow i a mo he capaciy of he cu. Obervaion. Le f be a flow, and le (, T) be an - cu whoe capaciy equal he value of f. Then f i a max flow and (, T) i a min cu. u capaciy = Flow value u capaciy = Flow value Flow value =

Max-Flow Min-u Theorem Toward an lgorihm Max-flow min-cu heorem. (Ford-Fulkeron, ): In any nework, he value of max flow equal capaciy of min cu. Proof IOU: we find flow and cu uch ha Obervaion applie. Find - pah where each arc ha f(e) < u(e) and "augmen" flow along i. Min cu capaciy = Max flow value = flow Flow value = capaciy Toward an lgorihm Toward an lgorihm Find - pah where each arc ha f(e) < u(e) and "augmen" flow along i. Greedy algorihm: repea unil you ge uck. Find - pah where each arc ha f(e) < u(e) and "augmen" flow along i. Greedy algorihm: repea unil you ge uck. Fail: need o be able o "backrack." flow Flow value = flow Flow value = capaciy X X X capaciy X X X oleneck capaciy of pah = Flow value =

Reidual Graph ugmening Pah Original graph. Flow f(e). dge e = v-w v flow = f(e) capaciy = u(e) w ugmening pah = pah in reidual graph. Increae flow along forward edge. ecreae flow along backward edge. Reidual edge. dge e = v-w or w-v. "Undo" flow en. Reidual graph. ll he edge ha have ricly poiive reidual capaciy. v reidual capaciy = u(e) f(e) w reidual capaciy = f(e) reidual original X X X X X ugmening Pah Ford-Fulkeron ugmening Pah lgorihm Obervaion. If augmening pah, hen no ye a max flow. Q. If no augmening pah, i i a max flow? Ford-Fulkeron algorihm. Generic mehod for olving max flow. reidual while (here exi an augmening pah) { Find augmening pah P ompue boleneck capaciy of P ugmen flow along P original Flow value = X X X X X Queion. oe hi lead o a maximum flow? ye How do we find an augmening pah? - pah in reidual graph How many augmening pah doe i ake? How much effor do we pending finding a pah?

Max-Flow Min-u Theorem Proof of Max-Flow Min-u Theorem ugmening pah heorem. flow f i a max flow if and only if here are no augmening pah. Max-flow min-cu heorem. The value of he max flow i equal o he capaciy of he min cu. We prove boh imulaneouly by howing he following are equivalen: (i) f i a max flow. (ii) There i no augmening pah relaive o f. (iii) There exi a cu whoe capaciy equal he value of f. (i) (ii) equivalen o no (ii) no (i), which wa Obervaion (ii) (iii) nex lide (iii) (i) hi wa Obervaion (ii) (iii). If here i no augmening pah relaive o f, hen here exi a cu whoe capaciy equal he value of f. Proof. Le f be a flow wih no augmening pah. Le be e of verice reachable from in reidual graph. conain ; ince no augmening pah, doe no conain all edge e leaving in original nework have f(e) = u(e) all edge e enering in original nework have f(e) = f e ou of e ou of f ( e) u( e) capaciy (, T) e in o f ( e) T reidual nework Max Flow Nework Implemenaion Ford-Fulkeron lgorihm: Implemenaion dge in original graph may correpond o or reidual edge. May need o ravere edge e = v-w in forward or revere direcion. Flow = f(e), capaciy = u(e). Iner wo copie of each edge, one in adjacency li of v and one in w. Ford-Fulkeron main loop. // while here exi an augmening pah, ue i while (augpah()) { public cla dge { privae in v, w; privae in cap; privae in flow; // from, o // capaciy from v o w // flow from v o w public dge(in v, in w, in cap) {... public in cap() { reurn cap; public in flow() { reurn flow; public boolean from(in v) { reurn hi.v == v; public in oher(in v) { reurn from(v)? hi.w : hi.v; public in capro(in v) { reurn from(v)? flow : cap - flow; public void addflowro(in v, in d) { flow += from(v)? -d : d; // compue boleneck capaciy in bole = INFINITY; for (in v = ; v!= ; v = T(v)) bole = Mah.min(bole, pred[v].capro(v)); // augmen flow for (in v = ; v!= ; v = T(v)) pred[v].addflowro(v, bole); // keep rack of oal flow en from o value += bole;

Ford-Fulkeron lgorihm: nalyi hooing Good ugmening Pah umpion: all capaciie are ineger beween and U. Ue care when elecing augmening pah. Invarian: every flow value and every reidual capaciie remain an ineger hroughou he algorihm. Theorem: he algorihm erminae in a mo f * V U ieraion. orollary: if U =, hen algorihm run in V ieraion. no polynomial in inpu ize! Inegraliy heorem: if all arc capaciie are ineger, hen here exi a max flow f for which every flow value i an ineger. Original Nework hooing Good ugmening Pah hooing Good ugmening Pah Ue care when elecing augmening pah. Ue care when elecing augmening pah. X X X Original Nework Original Nework

hooing Good ugmening Pah hooing Good ugmening Pah Ue care when elecing augmening pah. Ue care when elecing augmening pah. X X X Original Nework Original Nework ieraion poible! hooing Good ugmening Pah hore ugmening Pah Ue care when elecing augmening pah. ome choice lead o exponenial algorihm. lever choice lead o polynomial algorihm. Opimal choice for real world problem??? eign goal i o chooe augmening pah o ha: an find augmening pah efficienly. Few ieraion. hooe augmening pah wih: dmond-karp () Fewe number of arc. (hore pah) Max boleneck capaciy. (fae pah) hore augmening pah. ay o implemen wih F. Find augmening pah wih fewe number of arc. while (!q.impy()) { in v = q.dequeue(); InIeraor i = G.neighbor(v); while(i.hanex()) { dge e = i.nex(); in w = e.oher(v); if (e.capro(w) > ) { // i v-w a reidual edge? if (w[w] > w[v] + ) { w[w] = w[v] + ; pred[w] = e; // keep rack of hore pah q.enqueue(w); reurn (w[] < INFINITY); // i here an augmening pah?

hore ugmening Pah nalyi Fae ugmening Pah Lengh of hore augmening pah increae monoonically. ricly increae afer a mo augmenaion. mo V oal augmening pah. O( V) running ime. Fae augmening pah. Find augmening pah whoe boleneck capaciy i maximum. eliver mo amoun of flow o ink. olve uing ijkra-yle (PF) algorihm. X v reidual capaciy w if (w[w] < Mah.min(w[v], e.capro(w)) { w[w] = Mah.min(w[v], e.capro(w)); pred[w] = v; Finding a fae pah. O( log V) per augmenaion wih binary heap. Fac. O( log U) augmenaion if capaciie are beween and U. hooing an ugmening Pah Hiory of Wor-ae Running Time hooing an augmening pah. ny pah will do wide laiude in implemening Ford-Fulkeron. Generic prioriy fir earch. ome choice lead o good wor-cae performance. hore augmening pah fae augmening pah variaion on a heme: PF verage cae no well underood. Reearch challenge. Pracice: olve max flow problem on real nework in linear ime. Theory: prove i for wor-cae nework. Year... icoverer Mehod ympoic Time anzig implex V U Ford, Fulkeron ugmening pah V U dmond-karp hore pah V dmond-karp Max capaciy log U ( + V log V) iniz Improved hore pah V dmond-karp, iniz apaciy caling log U iniz-gabow Improved capaciy caling V log U Karzanov Preflow-puh V leaor-tarjan ynamic ree V log V Goldberg-Tarjan FIFO preflow-puh V log (V / )......... Goldberg-Rao Lengh funcion / log (V / ) log U V / log (V / ) log U rc capaciie are beween and U.

n pplicaion iparie Maching Jon placemen. ompanie make job offer. uden have job choice. an we fill every job? iparie maching. Inpu: undireced and biparie graph G. e of edge M i a maching if each verex appear a mo once. Max maching: find a max cardinaliy maching. an we employ every uden? lice-dobe ob-yahoo arol-hp ave-pple liza-im Frank-un Maching M -, -, - L R iparie Maching iparie Maching iparie maching. Inpu: undireced and biparie graph G. e of edge M i a maching if each verex appear a mo once. Max maching: find a max cardinaliy maching. Reduce o max flow. reae a direced graph G'. irec all arc from L o R, and give infinie (or uni) capaciy. dd ource, and uni capaciy arc from o each node in L. dd ink, and uni capaciy arc from each node in R o. L R Maching M -, -, -, - L R G G'

iparie Maching: Proof of orrecne iparie Maching: Proof of orrecne laim. Maching in G of cardinaliy k induce flow in G' of value k. Given maching M = { -, -, - of cardinaliy. onider flow f ha end uni along each of pah: --- --- ---. f i a flow, and ha cardinaliy. laim. Flow f of value k in G' induce maching of cardinaliy k in G. y inegraliy heorem, here exi / valued flow f of value k. onider M = e of edge from L o R wih f(e) =. each node in L and R inciden o a mo one edge in M M = k L R L R G G' G G' Reducion Reducion. Given an inance of biparie maching. Tranform i o a max flow problem. olve max flow problem. Tranform max flow oluion o biparie maching oluion. Iue. How expenive i ranformaion? O( + V) I i beer o olve problem direcly? O( V / ) biparie maching oom line: max flow i an exremely rich problem-olving model. Many imporan pracical problem reduce o max flow. We know good algorihm for olving max flow problem.