CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25.

Slides:



Advertisements
Similar presentations
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Advertisements

1 Maximum flow sender receiver Capacity constraint Lecture 6: Jan 25.
EMIS 8374 Vertex Connectivity Updated 20 March 2008.
CSE 421 Algorithms Richard Anderson Lecture 23 Network Flow Applications.
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2012 Lecture 19.
The Maximum Network Flow Problem. CSE Network Flows.
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Lectures on Network Flows
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf.
Advanced Algorithms Piyush Kumar (Lecture 2: Max Flows) Welcome to COT5405 Slides based on Kevin Wayne’s slides.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
1 Maximum Flow Maximum Flow Problem The Ford-Fulkerson method Maximum bipartite matching.
The max flow problem
Maximum Flows Lecture 4: Jan 19. Network transmission Given a directed graph G A source node s A sink node t Goal: To send as much information from s.
Flows sourcesink s t Flows sourcesink edge-weights = capacities.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
CSEP 521 Applied Algorithms
Advanced Algorithms Piyush Kumar (Lecture 4: MaxFlow MinCut Applications) Welcome to COT5405.
CS774. Markov Random Field : Theory and Application Lecture 13 Kyomin Jung KAIST Oct
CSE 421 Algorithms Richard Anderson Lecture 24 Network Flow Applications.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 33.
1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf.
Max Flow – Min Cut Problem. Directed Graph Applications Shortest Path Problem (Shortest path from one point to another) Max Flow problems (Maximum material.
Maximum Flow Problem (Thanks to Jim Orlin & MIT OCW)
Chapter 7 April 28 Network Flow.
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
10/11/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURE 21 Network.
Chapter 7 May 3 Ford-Fulkerson algorithm Step-by-step walk through of an example Worst-case number of augmentations Edmunds-Karp modification Time complexity.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
CSCI 256 Data Structures and Algorithm Analysis Lecture 20 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 23.
CSEP 521 Applied Algorithms Richard Anderson Lecture 8 Network Flow.
1 Network Flow CSC401 – Analysis of Algorithms Chapter 8 Network Flow Objectives: Flow networks –Flow –Cut Maximum flow –Augmenting path –Maximum flow.
Fall 2003Maximum Flow1 w s v u t z 3/33/3 1/91/9 1/11/1 3/33/3 4/74/7 4/64/6 3/53/5 1/11/1 3/53/5 2/22/2 
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Prof. Swarat Chaudhuri COMP 382: Reasoning about Algorithms Fall 2015.
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Markov Random Fields in Vision
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 3.
CS 312: Algorithm Design & Analysis Lecture #29: Network Flow and Cuts This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported.
The Maximum Network Flow Problem
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
CS4234 Optimiz(s)ation Algorithms
Algorithm Design and Analysis
Richard Anderson Lecture 23 Network Flow
Lecture 22 Network Flow, Part 2
Edmonds-Karp Algorithm
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Network Flow and Connectivity in Wireless Sensor Networks
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 23 Network Flow
Vertex Covers, Matchings, and Independent Sets
Richard Anderson Lecture 21 Network Flow
Problem Solving 4.
Max Flow Min Cut, Bipartite Matching Yin Tat Lee
Flow Networks and Bipartite Matching
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
Algorithms (2IL15) – Lecture 7
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Lecture 21 Network Flow, Part 1
Richard Anderson Lecture 22 Network Flow
Lecture 21 Network Flow, Part 1
Lecture 22 Network Flow, Part 2
Richard Anderson Lecture 22 Network Flow
Vertex Covers and Matchings
Presentation transcript:

CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25

Certificate of Optimality Corollary: Let f be any flow, and let (A, B) be any cut. If v(f) = cap(A, B), then f is a max flow and (A, B) is a min cut Value of flow = 28 Cut capacity = 28  Flow value  s t A

Max-Flow Min-Cut Theorem The Ford-Fulkerson algorithm terminates when the flow has not s-t path in the residual graph There exists a flow which has the same value of the minimum cut –Proof: Consider a flow where the residual graph has no s-t path with positive capacity –Let A be the set of vertices in the residual graph reachable from s with paths of positive capacity –What can we say about the flows and capacity between u and v? stuv A B PROOF DONE IN CLASS

Max-Flow Min-Cut Theorem Ford-Fulkerson algorithm finds a flow where the residual graph is disconnected, hence FF finds a maximum flow If we want to find a minimum cut, we begin by looking for a maximum flow

Problem Reduction Reduce Problem A to Problem B –Convert an instance of A to an instance of B –Use a solution of B to get a solution to A Practical –Use a program for B to solve A Theoretical –Show that B is at least as hard as A E.g., reduce the problem of finding the Maximum of a set of integers to finding the Minimum of a set of integers Network flow can be applied to many problems that on the surface do not resemble network flow

Bipartite Matching Input: Bipartite graph –A graph G = (V, E) is bipartite if V can be partitioned into sets L and R such that every edge in E has one end in L and the other end in R Goal: Find maximum cardinality matching –A matching is M  E with property that each node in V appears in at most one edge of M C A E 3 B D4 professors courses can teach From Lecture #3: Five Representative Problems n k max-flow based algorithm

Bipartite Matching Bipartite matching –Input: undirected, bipartite graph G = (L  R, E) –M  E is a matching if each node appears in at most edge in M –Max matching: find a max cardinality matching ' 3' 5' 2 4 2' 4' matching 1-2', 3-1', 4-5' RL

Bipartite Matching Bipartite matching –Input: undirected, bipartite graph G = (L  R, E) –M  E is a matching if each node appears in at most edge in M –Max matching: find a max cardinality matching ' 3' 5' 2 4 2' 4' RL max matching 1-1', 2-2', 3-3' 4-4'

Converting Matching to Network Flow ts

Bipartite Matching Max flow formulation –Create digraph G' = (L  R  {s, t}, E' ) –Direct all edges from L to R, and assign unit capacity –Add source s, and unit capacity edges from s to each node in L –Add sink t, and unit capacity edges from each node in R to t s ' 3' 5' t 2 4 2' 4' RL G'

Bipartite Matching: Proof of Correctness Theorem: Max cardinality matching in G = value of max flow in G‘. Pf.  –Given max matching M of cardinality k –Consider flow f that sends 1 unit along each of k paths –f is a flow, and has cardinality k s ' 3' 5' t 2 4 2' 4' ' 3' 5' 2 4 2' 4' G' G

Bipartite Matching: Proof of Correctness Theorem: Max cardinality matching in G = value of max flow in G'. Pf.  –Let f be a max flow in G' of value k –Consider M = set of edges from L to R with f(e) = 1 Each node in L and R participates in at most one edge in M |M| = k: consider cut (L  s, R  t) ' 3' 5' 2 4 2' 4' G s ' 3' 5' t 2 4 2' 4' G'