Running Time. Assumption. All capacities are integers between 1 and C.

Similar documents
Algorithm Design and Analysis

Algorithm Design and Analysis

Algorithms and Theory of Computation. Lecture 11: Network Flow

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

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

directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time

The max flow problem. Ford-Fulkerson method. A cut. Lemma Corollary Max Flow Min Cut Theorem. Max Flow Min Cut Theorem

CMPSCI 611: Advanced Algorithms

10 Max-Flow Min-Cut Flows and Capacitated Graphs 10 MAX-FLOW MIN-CUT

Soviet Rail Network, 1955

Algorithms: Lecture 12. Chalmers University of Technology

Today. Flow review. Augmenting paths. Ford-Fulkerson Algorithm. Intro to cuts (reason: prove correctness)

Algorithms: COMP3121/3821/9101/9801

1 Review for Lecture 2 MaxFlow

Lecture 2: Network Flows 1

Maximum Flow. Jie Wang. University of Massachusetts Lowell Department of Computer Science. J. Wang (UMass Lowell) Maximum Flow 1 / 27

CSC 373: Algorithm Design and Analysis Lecture 12

Exposition of the Dinitz algorithm

Problem set 1. (c) Is the Ford-Fulkerson algorithm guaranteed to produce an acyclic maximum flow?

Max Flow: Algorithms and Applications

Flow Network. The following figure shows an example of a flow network:

Algorithm Design and Analysis

CS 1501 Recitation. Xiang Xiao

The min cost flow problem Course notes for Optimization Spring 2007

Two Applications of Maximum Flow

The min cost flow problem Course notes for Search and Optimization Spring 2004

Part V. Matchings. Matching. 19 Augmenting Paths for Matchings. 18 Bipartite Matching via Flows

Maximum Flow. Reading: CLRS Chapter 26. CSE 6331 Algorithms Steve Lai

Lecture 1. 1 Overview. 2 Maximum Flow. COMPSCI 532: Design and Analysis of Algorithms August 26, 2015

Types of Networks. Internet Telephone Cell Highways Rail Electrical Power Water Sewer Gas

We say that a flow is feasible for G (or just feasible if the graph and capacity function in question are obvious) if

Graph Algorithms -2: Flow Networks. N. H. N. D. de Silva Dept. of Computer Science & Eng University of Moratuwa

CS 170 DISCUSSION 10 MAXIMUM FLOW. Raymond Chan raychan3.github.io/cs170/fa17.html UC Berkeley Fall 17

Flows and Cuts. 1 Concepts. CS 787: Advanced Algorithms. Instructor: Dieter van Melkebeek

22 Max-Flow Algorithms

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11

Basics on the Graphcut Algorithm. Application for the Computation of the Mode of the Ising Model

Algorithm Design and Analysis

Mathematics for Decision Making: An Introduction. Lecture 13

The maximum flow problem

Preliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)}

Flows. Chapter Circulations

Discrete Optimization 2010 Lecture 3 Maximum Flows

Chapter 7. Network Flow. CS 350: Winter 2018

Energy minimization via graph-cuts

Maximum flow problem

Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths

CSE 326: Data Structures Network Flow. James Fogarty Autumn 2007

The Simplest and Smallest Network on Which the Ford-Fulkerson Maximum Flow Procedure May Fail to Terminate

CSC2420: Algorithm Design, Analysis and Theory Fall 2017

Parallel Graph Algorithms (con4nued)

Maximum flow problem (part I)

Network Flows made simple

Lecture 8 Network Optimization Algorithms

Algorithms. Algorithms 6.4 MAXIMUM FLOW

Internet Routing Example

Maximum Integer Flows in Directed Planar Graphs with Multiple Sources and Sinks and Vertex Capacities

Lecture 21 November 11, 2014

Data Structures and Algorithms CMPSC 465

CSC2420: Algorithm Design, Analysis and Theory Spring (or Winter for pessimists) 2017

Lecture 3. 1 Polynomial-time algorithms for the maximum flow problem

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)

Chapter 6. Dynamic Programming. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Parallel Graph Algorithms (con4nued)

GRAPH ALGORITHMS Week 7 (13 Nov - 18 Nov 2017)

Analysis of Algorithms. Outline. Single Source Shortest Path. Andres Mendez-Vazquez. November 9, Notes. Notes

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

Lecture 13: Polynomial-Time Algorithms for Min Cost Flows. (Reading: AM&O Chapter 10)

Maximum flow problem CE 377K. February 26, 2015

Discrete Wiskunde II. Lecture 5: Shortest Paths & Spanning Trees

The Steiner Network Problem

Combinatorial Optimization

Computer Science & Engineering 423/823 Design and Analysis of Algorithms

Breadth-First Search of Graphs

Maximum Flow Problem (Ford and Fulkerson, 1956)

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

Bipartite Matchings and Stable Marriage

Single Source Shortest Paths

Friday, September 21, Flows

CS 4407 Algorithms Lecture: Shortest Path Algorithms

Chapter 10. Maximum flow

Soviet Rail Network, 1955

CSCE423/823. Introduction. Flow Networks. Ford-Fulkerson Method. Edmonds-Karp Algorithm. Maximum Bipartite Matching 2/35 CSCE423/823.

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

CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs. Instructor: Shaddin Dughmi

Single Source Shortest Paths

p 3 p 2 p 4 q 2 q 7 q 1 q 3 q 6 q 5

ORIE 633 Network Flows October 4, Lecture 10

Algorithms. Algorithms 6.4 MAXIMUM FLOW

Network Flow Problems Luis Goddyn, Math 408

Design and Analysis of Algorithms

LINEAR PROGRAMMING III

The Budget-Constrained Maximum Flow Problem

6.046 Recitation 11 Handout

7.5 Bipartite Matching

1 Matchings in Non-Bipartite Graphs

Discrete Optimization Lecture 5. M. Pawan Kumar

Algorithms 6.4 MAXIMUM FLOW. overview Ford-Fulkerson algorithm analysis Java implementation applications

Design and Analysis of Algorithms

CS Algorithms and Complexity

Transcription:

Running Time Assumption. All capacities are integers between and. Invariant. Every flow value f(e) and every residual capacities c f (e) remains an integer throughout the algorithm. Theorem. The algorithm terminates in at most v(f*) n iterations. Pf. Each augmentation increase value by at least. orollary. If =, Ford-Fulkerson runs in O(mn) time. Integrality theorem. If all capacities are integers, then there exists a max flow f for which every flow value f(e) is an integer. Pf. Since algorithm terminates, theorem follows from invariant.

7.3 hoosing Good Augmenting Paths

Ford-Fulkerson: Exponential Number of Augmentations Q. Is generic Ford-Fulkerson algorithm polynomial in input size? m, n, and log A. No. If max capacity is, then algorithm can take iterations. X0 0 X0 X0 s X 0 t s X0 X 0 t 0 X0 X0 X0 2 2 3

hoosing Good Augmenting Paths Use care when selecting augmenting paths. Some choices lead to exponential algorithms. lever choices lead to polynomial algorithms. If capacities are irrational, algorithm not guaranteed to terminate! Goal: choose augmenting paths so that: an find augmenting paths efficiently. Few iterations. hoose augmenting paths with: [Edmonds-Karp 972, Dinitz 970] Max bottleneck capacity. Sufficiently large bottleneck capacity. Fewest number of edges. 4

hoosing Shortest Augmenting Path Definition. d f (s,u) denotes the shortest path distance from s to u in residual graph G f. Lemma. d f (s,u) is monotonically increasing with each flow augmentation. Proof Strategy. onsider flow f which gets augmented to flow f. Assume for contradiction vertex v is the closest vertex to s for which d f (s,v) < d f (s,v). Let u precede v in the shortest path from s to t in G f. Edge (u,v) cannot be present in G f. Why? Edge (v,u) is present in a shortest path from s to t in G f. Why? d f (s,u) = d f (s,v) +. d f (s,v) = d f (s,u) +. d f (s,u) d f (s,u). The above three equations imply d f (s,v) = d f (s,u) + d f (s,u) + = d f (s,v) + 2. 5 hoose augmenting paths with: [Edmonds-Karp 972, Dinitz 970]

hoosing Shortest Augmenting Path Definition. Edge (u,v) is critical if c(u,v) in G f is the bottleneck capacity. Lemma 2. Edge (u,v) becomes critical at most V /2 times. Proof Strategy. Let edge (u,v) be a critical edge in G f. d f (s,v) = d f (s,u) +. For edge (u,v) to become critical again, there must be flow augmentation from v to u in some subsequent flow f. d f (s,u) = d f (s,v) +. d f (s,v) d f (s,v). The above three imply d f (s,u) = d f (s,v) + d f (s,v) = d f (s,u) +. 6

hoosing Good Augmenting Paths Use care when selecting augmenting paths. Some choices lead to exponential algorithms. lever choices lead to polynomial algorithms. If capacities are irrational, algorithm not guaranteed to terminate! Goal: choose augmenting paths so that: an find augmenting paths efficiently. Few iterations. hoose augmenting paths with: [Edmonds-Karp 972, Dinitz 970] Max bottleneck capacity. Sufficiently large bottleneck capacity. Fewest number of edges. 7

apacity Scaling Intuition. hoosing path with highest bottleneck capacity increases flow by max possible amount. Don't worry about finding exact highest bottleneck path. Maintain scaling parameter Δ. Let G f (Δ) be the subgraph of the residual graph consisting of only arcs with capacity at least Δ. 4 4 0 02 0 02 s t s t 22 70 22 70 2 2 G f G f (00) 8

apacity Scaling Scaling-Max-Flow(G, s, t, c) { foreach e E f(e) 0 Δ smallest power of 2 greater than or equal to G f residual graph } while (Δ ) { G f (Δ) Δ-residual graph while (there exists augmenting path P in G f (Δ)) { f augment(f, c, P) update G f (Δ) } Δ Δ / 2 } return f 9

apacity Scaling: orrectness Assumption. All edge capacities are integers between and. Integrality invariant. All flow and residual capacity values are integral. orrectness. If the algorithm terminates, then f is a max flow. Pf. By integrality invariant, when Δ = G f (Δ) = G f. Upon termination of Δ = phase, there are no augmenting paths. 0

apacity Scaling: Running Time Lemma. The outer while loop repeats + log 2 times. Pf. Initially Δ < 2. Δ decreases by a factor of 2 each iteration. Lemma 2. Let f be the flow at the end of a Δ-scaling phase. Then the value of the maximum flow is at most v(f) + m Δ. proof on next slide Lemma 3. There are at most 2m augmentations per scaling phase. Let f be the flow at the end of the previous scaling phase. L2 v(f*) v(f) + m (2Δ). Each augmentation in a Δ-phase increases v(f) by at least Δ. Theorem. The scaling max-flow algorithm finds a max flow in O(m log ) augmentations. It can be implemented to run in O(m 2 log ) time.

apacity Scaling: Running Time Lemma 2. Let f be the flow at the end of a Δ-scaling phase. Then value of the maximum flow is at most v(f) + m Δ. Pf. (almost identical to proof of max-flow min-cut theorem) We show that at the end of a Δ-phase, there exists a cut (A, B) such that cap(a, B) v(f) + m Δ. hoose A to be the set of nodes reachable from s in G f (Δ). By definition of A, s A. By definition of f, t A. A B t s original network 2