Algorithm Design and Analysis

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

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

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

Algorithm Design and Analysis

Algorithm Design and Analysis

Soviet Rail Network, 1955

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

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

1 Motivation and Basic Definitions

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

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

CSE 521: Design & Analysis of Algorithms I

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

Maximum Flow and Minimum Cut

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

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

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

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

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

Network Flows: Introduction & Maximum Flow

Reminder: Flow Networks

Soviet Rail Network, 1955

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

Today: Max Flow Proofs

Algorithmic Discrete Mathematics 6. Exercise Sheet

Main Reference: Sections in CLRS.

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

Graphs III - Network 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)

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

Randomized Perfect Bipartite Matching

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

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

Algorithms. Algorithms 6.4 MAXIMUM FLOW

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

CSE 421 Introduction to Algorithms Winter The Network Flow Problem

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

Network Flows UPCOPENCOURSEWARE number 34414

Network Flow. Data Structures and Algorithms Andrei Bulatov

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

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

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

18 Extensions of Maximum Flow

7. NETWORK FLOW I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 11/22/17 6:11 AM

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.

7. NETWORK FLOW I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 11/22/17 6:11 AM

Network Flow Applications

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

7.5 Bipartite Matching

Algorithm Design and Analysis

16 Max-Flow Algorithms and Applications

introduction Ford-Fulkerson algorithm

Algorithm Design and Analysis

introduction Ford-Fulkerson algorithm

Introduction to Congestion Games

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

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

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

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

Maximum Flow in Planar Graphs

u(t) Figure 1. Open loop control system

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

Chapter 7. Network Flow. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

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

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

Ford Fulkerson algorithm max-flow min-cut theorem. max-flow min-cut theorem capacity-scaling algorithm

Price of Stability and Introduction to Mechanism Design

Average Case Lower Bounds for Monotone Switching Networks

Chapter 7. Network Flow. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

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

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

EECE 301 Signals & Systems Prof. Mark Fowler

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

Bipartite Matching. Matching. Bipartite Matching. Maxflow Formulation

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

EE Control Systems LECTURE 2

6.302 Feedback Systems Recitation : Phase-locked Loops Prof. Joel L. Dawson

Agenda. Soviet Rail Network, We ve done Greedy Method Divide and Conquer Dynamic Programming

Introduction to SLE Lecture Notes

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

23 Maximum Flows and Minimum Cuts

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

Chapter 7. Network Flow. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Topics in Combinatorial Optimization May 11, Lecture 22

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

, 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

Exponential Sawtooth

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

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

Ford-Fulkerson Algorithm for Maximum Flow

Chapter 7: Inverse-Response Systems

CHAPTER 7. Definition and Properties. of Laplace Transforms

6.8 Laplace Transform: General Formulas

NECESSARY AND SUFFICIENT CONDITIONS FOR LATENT SEPARABILITY

Dynamic Programming 11/8/2009. Weighted Interval Scheduling. Weighted Interval Scheduling. Unweighted Interval Scheduling: Review

16 Max-Flow Algorithms

18.03SC Unit 3 Practice Exam and Solutions

Max-flow and min-cut

Chapter 9 - The Laplace Transform

Transcription:

Algorihm Deign and Analyi LECTURE 0 Nework Flow Applicaion Biparie maching Edge-dijoin pah Adam Smih 0//0 A. Smih; baed on lide by E. Demaine, C. Leieron, S. Rakhodnikova, K. Wayne

La ime: Ford-Fulkeron Find max - flow & min - cu in O(mnC) ime All capaciie are ineger C (We will dicu how o remove hi aumpion) Dualiy: Max flow value = min cu capaciy Inegraliy: if capaciie are ineger, hen FF algorihm produce an inegral max flow 0//0 A. Smih; baed on lide by E. Demaine, C. Leieron, S. Rakhodnikova, K. Wayne

Today: Applicaion when C= Maximum biparie maching Reducing MBM o max-flow Hall heorem Edge-dijoin pah anoher reducion Coming up: faer algorihm for large C and applicaion 0//0 A. Smih; baed on lide by E. Demaine, C. Leieron, S. Rakhodnikova, K. Wayne

Maching Maching. Inpu: undireced graph G = (V, E). M E i a maching if each node appear in a mo edge in M. Max maching: find a max cardinaliy maching.

Biparie Maching Biparie maching. Inpu: undireced, biparie graph G = (L R, E). M E i a maching if each node appear in a mo edge in M. Max maching: find a max cardinaliy maching. ' ' ' maching -', -', -' ' L ' R

Biparie Maching Biparie maching. Inpu: undireced, biparie graph G = (L R, E). M E i a maching if each node appear in a mo edge in M. Max maching: find a max cardinaliy maching. ' ' ' max maching -', -', -' -' ' L ' R

Reducion Roughly: Problem A reduce o problem B if here i a imple algorihm for A ha ue an algorihm for problem B a a ubrouine. Uually: Given inance x of problem A we find a inance x of problem B Solve x Ue he oluion o build a oluion o x Ueful kill: quickly idenifying problem where exiing oluion may be applied. Good programmer do hi all he ime

Reducing Biparie Maching o Maximum Flow Reducion o Max flow. Creae digraph G' = (L R {, }, E' ). Direc all edge from L o R, and aign capaciy. Add ource, and capaciy edge from o each node in L. Add ink, and capaciy edge from each node in R o. G' ' ' ' ' L ' R

Biparie Maching: Proof of Correcne Theorem. Max cardinaliy maching in G = value of max flow in G. Proof: We need wo aemen max. maching in G max flow in G max. maching in G max flow in G

Biparie Maching: Proof of Correcne Theorem. Max cardinaliy maching in G = value of max flow in G'. Pf. Given max maching M of cardinaliy k. Conider flow f ha end uni along each of k pah. f i a flow, and ha cardinaliy k. ' ' ' ' ' ' ' ' G ' ' G'

Biparie Maching: Proof of Correcne Theorem. Max cardinaliy maching in G = value of max flow in G'. Pf. Le f be a max flow in G' of value k. Inegraliy heorem f i inegral; all capaciie are f i 0-. Conider M = e of edge from L o R wih f(e) =. each node in L and R paricipae in a mo one edge in M M = k: conider cu (L, R ) ' ' ' ' ' ' ' ' G' ' ' G

Exercie Give an example where he greedy algorihm for MBM fail. How bad can he greedy algorihm be, i.e. how far can he ize of he maximum maching (global max) be from he ize of he greedy maching (local max)? Wha do augmening pah look like in hi max-flow inance?

Perfec Maching Def. A maching M E i perfec if each node appear in exacly one edge in M. Q. When doe a biparie graph have a perfec maching? Srucure of biparie graph wih perfec maching. Clearly we mu have L = R. Wha oher condiion are neceary? Wha condiion are ufficien?

Perfec Maching Noaion. Le S be a ube of node, and le N(S) be he e of node adjacen o node in S. Obervaion. If a biparie graph G = (L R, E), ha a perfec maching, hen N(S) S for all ube S L. Pf. Each node in S ha o be mached o a differen node in N(S). ' ' ' No perfec maching: S = {,, } N(S) = { ', ' }. ' L ' R

Marriage Theorem Marriage Theorem. [Frobeniu 97, Hall 9] Le G = (L R, E) be a biparie graph wih L = R. Then, G ha a perfec maching iff N(S) S for all ube S L. Pf. Thi wa he previou obervaion. ' ' ' No perfec maching: S = {,, } N(S) = { ', ' }. ' L ' R

Proof of Marriage Theorem Pf. Suppoe G doe no have a perfec maching. Formulae a a max flow problem wih conrain on edge from L o R and le (A, B) be min cu in G'. Key propery #: of hi graph: min-cu canno ue edge. So cap(a, B) = L B + R A Key propery #: inegral flow i ill a maching By max-flow min-cu, cap(a, B) < L. Chooe S = L A. Since min cu can' ue edge: N(S) R A. N(S ) R A = cap(a, B) - L B < L - L B = S. G' A ' ' S = {,, } L B = {, } ' ' ' R A = {', '} N(S) = {', '}

Biparie Maching: Running Time Which max flow algorihm o ue for biparie maching? Generic augmening pah: O(m val(f*) ) = O(mn). Capaciy caling: O(m log C ) = O(m ). Shore augmening pah (no covered in cla): O(m n / ). Non-biparie maching. Srucure of non-biparie graph i more complicaed, bu well-underood. [Tue-Berge, Edmond-Galai] Bloom algorihm: O(n ). [Edmond 96] Be known: O(m n / ). [Micali-Vazirani 980] Recenly: beer algorihm for dene graph, e.g. O(n.8 ) [Harvey, 006]

Exercie A biparie graph i k-regular if L = R and every verex (regardle of which ide i i on) ha exacly k neighbor Prove or diprove: every k-regular biparie graph ha a perfec maching

7.6 Dijoin Pah 0//0 A. Smih; baed on lide by E. Demaine, C. Leieron, S. Rakhodnikova, K. Wayne

Edge Dijoin Pah Dijoin pah problem. Given a digraph G = (V, E) and wo node and, find he max number of edge-dijoin - pah. Def. Two pah are edge-dijoin if hey have no edge in common. Ex: communicaion nework. 6 7

Edge Dijoin Pah Dijoin pah problem. Given a digraph G = (V, E) and wo node and, find he max number of edge-dijoin - pah. Def. Two pah are edge-dijoin if hey have no edge in common. Ex: communicaion nework. 6 7

Edge Dijoin Pah Max flow formulaion: aign uni capaciy o every edge. Theorem. Max number edge-dijoin - pah equal max flow value.

Edge Dijoin Pah Max flow formulaion: aign uni capaciy o every edge. Theorem. Max number edge-dijoin - pah equal max flow value. Pf. Suppoe here are k edge-dijoin pah P,..., P k. Se f(e) = if e paricipae in ome pah P i ; ele e f(e) = 0. Since pah are edge-dijoin, f i a flow of value k.

Edge Dijoin Pah Max flow formulaion: aign uni capaciy o every edge. Theorem. Max number edge-dijoin - pah equal max flow value. Pf. Suppoe max flow value i k. Inegraliy heorem here exi 0- flow f of value k. Conider edge (, u) wih f(, u) =. by conervaion, here exi an edge (u, v) wih f(u, v) = coninue unil reach, alway chooing a new edge Produce k (no necearily imple) edge-dijoin pah. can eliminae cycle o ge imple pah if deired

Nework Conneciviy Nework conneciviy. Given a digraph G = (V, E) and wo node and, find min number of edge whoe removal diconnec from. Def. A e of edge F E diconnec from if all - pah ue a lea one edge in F. (Tha i, removing F would make unreachable from.) 6 7

Edge Dijoin Pah and Nework Conneciviy Theorem. [Menger 97] The max number of edge-dijoin - pah i equal o he min number of edge whoe removal diconnec from. Pf. Suppoe he removal of F E diconnec from, and F = k. All - pah ue a lea one edge of F. Hence, he number of edgedijoin pah i a mo k. 6 6 7 7

Dijoin Pah and Nework Conneciviy Theorem. [Menger 97] The max number of edge-dijoin - pah i equal o he min number of edge whoe removal diconnec from. Pf. Suppoe max number of edge-dijoin pah i k. Then max flow value i k. Max-flow min-cu cu (A, B) of capaciy k. Le F be e of edge going from A o B. F = k and diconnec from. A 6 6 7 7