Lecture 22 Network Flow, Part 2

Slides:



Advertisements
Similar presentations
Maximum flow Main goals of the lecture:
Advertisements

1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
1 Maximum flow sender receiver Capacity constraint Lecture 6: Jan 25.
CSE 421 Algorithms Richard Anderson Lecture 23 Network Flow 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.
Advanced Algorithm Design and Analysis (Lecture 8) SW5 fall 2004 Simonas Šaltenis E1-215b
Lectures on Network Flows
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.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Maximum Flow Maximum Flow Problem The Ford-Fulkerson method
CSE 421 Algorithms Richard Anderson Lecture 24 Network Flow Applications.
CSEP 521 Applied Algorithms
CS774. Markov Random Field : Theory and Application Lecture 13 Kyomin Jung KAIST Oct
CSE 421 Algorithms Richard Anderson Lecture 24 Network Flow Applications.
Theory of Computing Lecture 13 MAS 714 Hartmut Klauck.
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)
Maximum Flow Chapter 26. Flow Concepts Source vertex s – where material is produced Sink vertex t – where material is consumed For all other vertices.
15.082J & 6.855J & ESD.78J October 7, 2010 Introduction to Maximum Flows.
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
CSEP 521 Applied Algorithms Richard Anderson Lecture 8 Network Flow.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
Iterative Improvement for Domain-Specific Problems Lecturer: Jing Liu Homepage:
CSE 421 Algorithms Richard Anderson Lecture 21 Shortest Paths and Network Flow.
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.
Instructor Neelima Gupta Edited by Divya Gaur(39, MCS '09) Thanks to: Bhavya(9), Deepika(10), Deepika Bisht(11) (MCS '09)
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
The Maximum Network Flow Problem
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
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
CS4234 Optimiz(s)ation Algorithms
Algorithm Design and Analysis
Lectures on Network Flows
Richard Anderson Lecture 23 Network Flow
Lecture 22 Network Flow, Part 2
Network Flow 2016/04/12.
Instructor: Shengyu Zhang
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
CSE Algorithms Max Flow Problems 11/21/02 CSE Max Flow.
Lecture 10 Network flow Max-flow and Min-cut Ford-Fulkerson method
Flow Networks Topics Flow Networks Residual 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 General Characteristics Applications
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
EE5900 Advanced Embedded System For Smart Infrastructure
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
Text Book: Introduction to algorithms By C L R S
Lecture 21 Network Flow, Part 1
Introduction to Maximum Flows
Richard Anderson Lecture 22 Network Flow
Lecture 21 Network Flow, Part 1
Richard Anderson Lecture 23 Network Flow Applications
Introduction to Maximum Flows
Richard Anderson Lecture 22 Network Flow
Maximum Flow Problems in 2005.
Presentation transcript:

Lecture 22 Network Flow, Part 2 CSE 421 Algorithms Lecture 22 Network Flow, Part 2

Network Flow

Outline Network flow definitions Flow examples Augmenting Paths Residual Graph Ford Fulkerson Algorithm Cuts Maxflow-MinCut Theorem Simple applications of Max Flow

Ford-Fulkerson Algorithm (1956) while not done Construct residual graph GR Find an s-t path P in GR with capacity b > 0 Add b units along in G If the sum of the capacities of edges leaving s is at most C, then the algorithm takes at most C iterations

Cuts in a graph Cut: Partition of V into disjoint sets S, T with s in S and t in T. Cap(S,T): sum of the capacities of edges from S to T Flow(S,T): net flow out of S Sum of flows out of S minus sum of flows into S Flow(S,T) <= Cap(S,T)

What is Cap(S,T) and Flow(S,T) S={s, a, b, e, h}, T = {c, f, i, d, g, t} 20/20 20/20 a d g 0/5 0/5 20/20 20/20 5/5 0/5 0/5 5/5 0/20 25/30 20/20 30/30 s b e h t 20/20 0/5 5/5 20/20 0/5 0/10 15/20 15/25 c f i 20/20 10/10 Cap(S,T) = 95, Flow(S,T) = 80 – 15 = 65

Minimum value cut u 10 40 10 s t 10 40 v

Find a minimum value cut 6 6 5 8 10 3 6 2 t s 7 4 5 3 8 5 4

Find a minimum value cut 6 6 5 8 10 3 6 2 t s 7 4 5 3 8 5 4

Find a minimum value cut 6:5 6:5 5:5 8:0 10:3 3:3 6:5 t s 7:6 2:2 4:4 5:4 3:3 8:3 5:0 4:3

MaxFlow – MinCut Theorem 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 S be the set of vertices in GR reachable from s with paths of positive capacity s t

Let S be the set of vertices in GR reachable from s with paths of positive capacity u v s t y x T S What can we say about the flows and capacity between u and v? x and y?

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.

Performance The worst case performance of the Ford-Fulkerson algorithm is horrible u 1000 1000 1 s t 1000 1000 v

Better methods of finding augmenting paths Find the maximum capacity augmenting path O(m2log(C)) time algorithm for network flow Find the shortest augmenting path O(m2n) time algorithm for network flow Find a blocking flow in the residual graph O(mnlog n) time algorithm for network flow

Problem Reduction Reduce Problem A to Problem B Practical Theoretical Convert an instance of Problem A to an instance of Problem B Use a solution of Problem B to get a solution to Problem A Practical Use a program for Problem B to solve Problem A Theoretical Show that Problem B is at least as hard as Problem A

Problem Reduction Examples Reduce the problem of finding the Maximum of a set of integers to finding the Minimum of a set of integers Find the maximum of: 8, -3, 2, 12, 1, -6 Construct an equivalent minimization problem

Undirected Network Flow Undirected graph with edge capacities Flow may go either direction along the edges (subject to the capacity constraints) u 10 20 5 s t 20 10 v Construct an equivalent flow problem

Bipartite Matching A graph G=(V,E) is bipartite if the vertices can be partitioned into disjoints sets X,Y A matching M is a subset of the edges that does not share any vertices Find a matching as large as possible

Application A collection of teachers A collection of courses And a graph showing which teachers can teach which courses RA 311 PB 331 ME 332 DG 401 AK 421

Converting Matching to Network Flow s t

Finding edge disjoint paths Construct a maximum cardinality set of edge disjoint paths