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

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

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

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

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)

Reminder: Flow Networks

Network Flow Applications

Algorithm Design and Analysis

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

1 Motivation and Basic Definitions

Matching. Slides designed by Kevin Wayne.

CSE 521: Design & Analysis of Algorithms I

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

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

Graphs III - Network Flow

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

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

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

Network Flows: Introduction & Maximum Flow

Randomized Perfect Bipartite Matching

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

Soviet Rail Network, 1955

Algorithmic Discrete Mathematics 6. Exercise Sheet

Maximum Flow and Minimum Cut

Soviet Rail Network, 1955

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

Maximum Flow in Planar Graphs

18 Extensions of Maximum Flow

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

Network Flow. Data Structures and Algorithms Andrei Bulatov

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

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

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

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

Main Reference: Sections in CLRS.

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

Introduction to Congestion Games

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

16 Max-Flow Algorithms and Applications

Network Flows UPCOPENCOURSEWARE number 34414

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

Algorithm Design and Analysis

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

Average Case Lower Bounds for Monotone Switching Networks

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

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

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

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

Timed Circuits. Asynchronous Circuit Design. Timing Relationships. A Simple Example. Timed States. Timing Sequences. ({r 6 },t6 = 1.

6.8 Laplace Transform: General Formulas

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

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

Algorithms. Algorithms 6.4 MAXIMUM FLOW

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

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

Topics in Combinatorial Optimization May 11, Lecture 22

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

Today: Max Flow Proofs

Y. Xiang, Learning Bayesian Networks 1

Bipartite Matching. Matching. Bipartite Matching. Maxflow Formulation

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Civil and Environmental Engineering

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

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.

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

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

Discussion Session 2 Constant Acceleration/Relative Motion Week 03

Product differentiation

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

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

Ground Rules. PC1221 Fundamentals of Physics I. Kinematics. Position. Lectures 3 and 4 Motion in One Dimension. A/Prof Tay Seng Chuan

The Arcsine Distribution

Echocardiography Project and Finite Fourier Series

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

8. Basic RL and RC Circuits

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

Monochromatic Infinite Sumsets

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

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

1 Review of Zero-Sum Games

ES.1803 Topic 22 Notes Jeremy Orloff

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

Exponential Sawtooth

Random Walk with Anti-Correlated Steps

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

CHAPTER 10 VALIDATION OF TEST WITH ARTIFICAL NEURAL NETWORK

introduction Ford-Fulkerson algorithm

Notes for Lecture 17-18

18.03SC Unit 3 Practice Exam and Solutions

2015 Practice Test #1

, 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

Ford-Fulkerson Algorithm for Maximum Flow

EXERCISES FOR SECTION 1.5

WEEK-3 Recitation PHYS 131. of the projectile s velocity remains constant throughout the motion, since the acceleration a x

Lecture Notes 2. The Hilbert Space Approach to Time Series

PSAT/NMSQT PRACTICE ANSWER SHEET SECTION 3 EXAMPLES OF INCOMPLETE MARKS COMPLETE MARK B C D B C D B C D B C D B C D 13 A B C D B C D 11 A B C D B C D

Price of Stability and Introduction to Mechanism Design

Efficient Algorithms for Computing Disjoint QoS Paths

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

Computer-Aided Analysis of Electronic Circuits Course Notes 3

Variable acceleration, Mixed Exercise 11

Transcription:

Today opic CSE Algorihm Richard Anderon Lecure Nework Flow Applicaion Prolem Reducion Undireced Flow o Flow Biparie Maching Dijoin Pah Prolem Circulaion Loweround conrain on flow Survey deign Prolem Reducion Reduce Prolem A o Prolem B Conver an inance of Prolem A o an inance Prolem B Ue a oluion of Prolem B o ge a oluion o Prolem A Pracical Ue a program for Prolem B o olve Prolem A Theoreical Show ha Prolem B i a lea a hard a Prolem A Prolem Reducion Example Reduce he prolem of finding he Maximum of a e of ineger o finding he Minimum of a e of ineger Find he maximum of: 8, -,,,, -6 Conruc an equivalen minimizaion prolem Undireced Nework Flow Undireced graph wih edge capaciie Flow may go eiher direcion along he edge (ujec o he capaciy conrain) u Biparie Maching A graph G=(V,E) i iparie if he verice can e pariioned ino dijoin e X,Y A maching M i a ue of he edge ha doe no hare any verice 5 Find a maching a large a poile v Conruc an equivalen flow prolem

Applicaion A collecion of eacher A collecion of coure And a graph howing which eacher can each which coure RA 0 Convering Maching o Nework Flow PB CC DG AK 6 0 Finding edge dijoin pah Theorem The maximum numer of edge dijoin pah equal he minimum numer of edge whoe removal eparae from Conruc a maximum cardinaliy e of edge dijoin pah Circulaion Prolem Direced graph wih capaciie, c(e) on he edge, and demand d(v) on verice Find a flow funcion ha aifie he capaciy conrain and he verex demand 0 <= f(e) <= c(e) u f in (v) f ou (v) = d(v) Circulaion fac: Feaiiliy prolem 5 d(v) < 0: ource; d(v) > 0: ink Mu have Σ v d(v)=0 o e feaile v -5 Find a circulaion in he following graph - a e 6 5 7 0 c f h 9 8 d 5 g -5

Reducing he circulaion prolem o Nework flow 5 a u v -5 Formal reducion Add ource node, and ink node For each node v, wih d(v) < 0, add an edge from o v wih capaciy -d(v) For each node v, wih d(v) > 0, add an edge from v o wih capaciy d(v) Find a maximum - flow. If hi flow ha ize Σ v cap(,v) hen he flow give a circulaion aiifying he demand Circulaion wih loweround on flow on edge Each edge ha a loweround l(e). The flow f mu aify l(e) <= f(e) <= c(e) Removing loweround on edge Loweround can e hifed o he demand a, x y -,5 0,, -, y y Formal reducion L in (v): um of loweround on incoming edge L ou (v): um of loweround on ougoing edge Creae new demand d and capaciie c on verice and edge d (v) = d(v) + l ou (v) l in (v) c (e) = c(e) l(e) Applicaion Cuomized urvey Ak cuomer aou produc Only ak cuomer aou produc hey ue Limied numer of queion you can ak each cuomer Need o ak a cerain numer of cuomer aou each produc Informaion availale aou which produc each cuomer ha ued

Deail Circulaion conrucion Cuomer C,..., C n Produc P,..., P m S i i he e of produc ued y C i Cuomer C i can e aked eween c i and c i queion Queion aou produc P j mu e aked on eween p j and p j urvey Today opic Open Pi Mining Prolem Tak Selecion Prolem Reducion o Min Cu prolem S, T i a cu if S, T i a pariion of he verice wih in S and in T The capaciy of an S, T cu i he um of he capaciie of all edge going from S o T Open Pi Mining Each uni of earh ha a profi (poily negaive) Geing o he ore elow he urface require removing he dir aove Te drilling give reaonale eimae of co Plan an opimal mining operaion Mine Graph Deermine an opimal mine -5 - - - - - -7 - - - - - - - - - - -7 7 8 6 8 6 -

Precedence graph G=(V,E) Each v in V ha a profi p(v) A e F if feaile if when w in F, and (v,w) in E, hen v in F. Find a feaile e o maximize he profi Generalizaion - 6 5 - - Min cu algorihm for profi maximizaion Conruc a flow graph where he minimum cu idenifie a feaile e ha maximize profi Precedence graph conrucion Precedence graph G=(V,E) Each edge in E ha infinie capaciy Add verice, Each verex in V i aached o and wih finie capaciy edge Show a finie value cu wih a lea wo verice on each ide of he cu Infinie Finie The ink ide of a finie cu i a feaile e No edge permied from S o T If a verex i in T, all of i anceor are in T If p(v) > 0, cap(v,) = p(v) cap(,v) = 0 If p(v) < 0 cap(,v) = -p(v) cap(v,) = 0 If p(v) = 0 cap(,v) = 0 cap(v,) = 0 Seing he co - - - 0

Enumerae all finie, cu and how heir capaciie Minimum cu give opimal oluion Why? Compuing he Profi Co(W) = Σ {w in W; p(w) < 0} -p(w) Benefi(W) = Σ {w in W; p(w) > 0} p(w) Profi(W) = Benefi(W) Co(W) Expre Cap(S,T) in erm of B, C, Co(T), Benefi(T), and Profi(T) Maximum co and enefi C = Co(V) B = Benefi(V) Summary Conruc flow graph Infinie capaciy for precedence edge Capaciie o ource/ink aed on co/enefi Finie cu give a feaile e of ak Minimizing he cu correpond o maximizing he profi Find minimum cu wih a nework flow algorihm Today opic More nework flow reducion Airplane cheduling Image egmenaion Baeall eliminaion

Airplane Scheduling Given an airline chedule, and aring locaion for he plane, i i poile o ue a fixed e of plane o aify he chedule. Schedule [egmen] Deparure, arrival pair (ciie and ime) Approach Conruc a circulaion prolem where pah of flow give egmen flown y each plane Example Seale->San Francico, 9:00 :00 Seale->Denver, 8:00 :00 San Francico -> Lo Angele, :00 :00 Sal Lake Ciy -> Lo Angele, 5:00-7:00 San Diego -> Seale, 7:0-> :00 Lo Angele -> Seale, 8:00->:00 Fligh ime: Denver->Sal Lake Ciy, hour Lo Angele->San Diego, hour Can hi chedule e full filled wih wo plane, aring from Seale? Compaile egmen Segmen S and S are compaile if he ame plane can e ued on S and S End of S equal ar of S, and enough ime for urn around eween arrival and deparure ime End of S i differen from S, u here i enough ime o fly eween ciie Graph repreenaion Each egmen, S i, i repreened a a pair of verice (d i, a i, for deparure and arrival), wih an edge eween hem. d i Add an edge eween a i and d j if S i i compaile wih S j. a i a i d j Seing up a flow prolem Reul d i, a i The plane can aify he chedule iff here i a feaile circulaion 0, a i d j - P i P i

Image Segmenaion Separae foreground from ackground Image analyi a i : value of aigning pixel i o he foreground i : value of aigning pixel i o he ackground p ij : penaly for aigning i o he foreground, j o he ackground or vice vera A: foreground, B: ackground Q(A,B) = Σ {i in A} a i + Σ {j in B} j - Σ {(i,j) in E, i in A, j in B} p ij Pixel graph o flow graph Mincu Conrucion Baeall eliminaion a v u p vu p uv v Can he Dinoaur win he league? Remaining game: AB, AC, AD, AD, AD, BC, BC, BC, BD, CD W L An Bee Cockroache Dinoaur 5 v A eam win he league if i ha ricly more win han any oher eam a he end of he eaon A eam ie for fir place if no eam ha more win, and here i ome oher eam wih he ame numer of win

Baeall eliminaion Can he Frui Flie win he league? Remaining game: AC, AD, AD, AD, AF, BC, BC, BC, BC, BC, BD, BE, BE, BE, BE, BF, CE, CE, CE, CF, CF, DE, DF, EF, EF W L An 7 Bee 6 7 Cockroache 6 7 Dinoaur Earhworm Frui Flie 5 Aume Frui Flie win remaining game Frui Flie are ied for fir place if no eam win more han 9 game Allowale win An () Bee () Cockroache () Dinoaur (5) Earhworm (5) 8 game o play AC, AD, AD, AD, BC, BC, BC, BC, BC, BD, BE, BE, BE, BE, CE, CE, CE, DE W L An 7 Bee 6 8 Cockroache 6 9 Dinoaur Earhworm Frui Flie 9 5 Remaining game AC, AD, AD, AD, BC, BC, BC, BC, BC, BD, BE, BE, BE, BE, CE, CE, CE, DE AC AD BC BD BE CE DE A B C D E Nework flow applicaion ummary Biparie Maching Dijoin Pah Airline Scheduling Survey Deign Baeall Eliminaion Projec Selecion Image Segmenaion T