Advanced Algorithms Piyush Kumar (Lecture 5: Preflow Push) Welcome to COT5405.

Slides:



Advertisements
Similar presentations
COMP 482: Design and Analysis of Algorithms
Advertisements

Lecture 7. Network Flows We consider a network with directed edges. Every edge has a capacity. If there is an edge from i to j, there is an edge from.
Min Cost Flow: Polynomial Algorithms. Overview Recap: Min Cost Flow, Residual Network Potential and Reduced Cost Polynomial Algorithms Approach Capacity.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Max Flows 2: The Excess Scaling Algorithm and Variants. James Orlin.
1 Maximum flow sender receiver Capacity constraint Lecture 6: Jan 25.
Chapter 6 Maximum Flow Problems Flows and Cuts Augmenting Path Algorithm.
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
MAXIMUM FLOW Max-Flow Min-Cut Theorem (Ford Fukerson’s Algorithm)
CSCI 256 Data Structures and Algorithm Analysis Lecture 18 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
1 Maximum Flow 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 
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
4/5/05Tucker, Sec Applied Combinatorics, 4rth Ed. Alan Tucker Section 4.3 Graph Models Prepared by Jo Ellis-Monaghan.
1 Maximum Flow Networks Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘capacity’ u ij. Goal: Determine the maximum amount.
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
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.
A New Approach to the Maximum-Flow Problem Andrew V. Goldberg, Robert E. Tarjan Presented by Andrew Guillory.
CSE 589 Part III The computer is useless It can only answer questions. -- Pablo Picasso.
1 Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Maximum flow Algorithms and Networks. A&N: Maximum flow2 Today Maximum flow problem Variants Applications Briefly: Ford-Fulkerson; min cut max flow theorem.
7. Preflow-Push Demo. 2 Preflow-Push Algorithm s 2 1 t 10 2 G: 5 3 s 2 1 t G f :
3/3/ Alperovich Alexander. Motivation  Find a maximal flow over a directed graph  Source and sink vertices are given 3/3/
A New Approach to the Maximum-Flow Problem Andrew V. Goldberg, Robert E. Tarjan Presented by Andrew Guillory.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Advanced Algorithms Piyush Kumar (Lecture 5: Weighted Matching) Welcome to COT5405 Based on Kevin Wayne’s slides.
Advanced Algorithms Piyush Kumar (Lecture 5: Weighted Matching) Welcome to COT5405 Based on Kevin Wayne’s slides.
Advanced Algorithms Piyush Kumar (Lecture 4: MaxFlow MinCut Applications) Welcome to COT5405.
15.082J and 6.855J and ESD.78J October 19, 2010 Max Flows 3 Preflow-Push Algorithms.
1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf.
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Finding Max Flow.
Max flows in O(nm) time, and sometimes less. by James B. Orlin MIT Sloan School.
Max Flow – Min Cut Problem. Directed Graph Applications Shortest Path Problem (Shortest path from one point to another) Max Flow problems (Maximum material.
Chapter 7 April 28 Network Flow.
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.
Flow Networks Ching-Chen Huang Hsi-Yue Hsiao. CONTENTS Network flows on directed acyclic graphs Ford-fulkerson Algorithms -Residual networks.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 23.
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.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
15.082J and 6.855J and ESD.78J October 21, 2010 Max Flows 4.
1 Maximum Flows CONTENTS Introduction to Maximum Flows (Section 6.1) Introduction to Minimum Cuts (Section 6.1) Applications of Maximum Flows (Section.
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Flow A flow f for a network N is is an assignment of an integer value f(e) to each edge e that satisfies the following properties: Capacity Rule: For each.
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
Algorithms and Networks Hans Bodlaender
Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Algorithms and Networks
Instructor: Shengyu Zhang
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
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.
3.4 Push-Relabel(Preflow-Push) Maximum Flow Alg.
Flow Networks Topics Flow Networks Residual networks
(Push-relabel algorithms)
Richard Anderson Lecture 21 Network Flow
Max Flow Min Cut, Bipartite Matching Yin Tat Lee
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
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
Lecture 21 Network Flow, Part 1
7. Preflow-Push Demo.
Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Piyush Kumar (Lecture 3: Preflow Push)
Richard Anderson Lecture 22 Network Flow
Max Flows 3 Preflow-Push Algorithms
Class 11 Max Flows Obtain a network, and use the same network to illustrate the shortest path problem for communication networks, the max flow.
Presentation transcript:

Advanced Algorithms Piyush Kumar (Lecture 5: Preflow Push) Welcome to COT5405

Today Preflow Push

Review: Augmenting Path Maintains a flow in each iteration Finds a path in the residual graph Saturates the path to make progress.

Def. An s-t flow is a function that satisfies: –For each e  E: (capacity) –For each v  V – {s, t}: (conservation) Def. The value of a flow f is: Flows Value = 4 0 capacity flow s t

Def. An preflow is a function that satisfies: –For each e  E: (capacity) –For each v  V – {s, t}: (weak conservation) Def. The excess of a preflow f at node v : –Required to be non-negative except s,t A Preflow 1.Algorithm maintains preflow (not flow) 2.Each vertex is associated with a height 3.Flow is “downhill” 4.Vertices with excess are sometimes “lifted/relabeled”.

A Preflow Total excess = flow out of s - flow into t Nodes with +ve Excess are called Active s 2 1 t 10/10 2/2 G: 5/5 3/3 7/10 e=9

Labelling/Height function H: V -> N –Source and Sink condition h(s) = n h(t) = 0 –Steepness condition For all (v,w) in E f, h(v) <= h(w)+1 Here E f is the residual graph. Invariant Compatibility of preflows and labellings

Lemma If s-t preflow f is compatible with the labelling h, then there is no s-t path in the residual graph G f. Cor: If s-t flow f is compatible with a labelling h, then f is a flow of maximum value.

Initial Preflow f h(v) = 0 for all v <> s h(s) = n f(e) = c e for all e=(s,v) f(e) = 0 for all other edges. The algorithm gradually transforms a preflow to a flow. Why?

Lemma An s-t preflow f is compatible with a labelling h, then there is no s-t path in the residual graph G f. Cor: An s-t flow f is maximum when its compatible with labelling h.

e=10 Preflow-Push Algorithm Initialization example s 2 1 t 10/10 2 G: 5 3 s 2 1 t G f : 10/10 e=10

Basic Operation 1 Push forward edge Suppose e(u)>0, c f (u,v)>0, (u,v) in E f (u,v) is a forward edge h[u]= h[v]+1 Push as much flow across (u,v) as possible r = min (e[u], c(u,v) – f(e)) Increase f(e) by r.

Basic Operation 2 Push backward edge Suppose e(u)>0, c f (u,v)>0, (u,v) in E f (u,v) is a backward edge h[u]= h[v]+1 Push as much flow across (u,v) as possible r = min (e[u], f(e)) Decrease f(e) by r. The preflow push algorithm will try to push from Active nodes towards the sink (maintaining compatibility with the labelling/heights of the nodes)

Basic Operation 3 Lift/Relabel When no push can be done from overflowing vertex (except s,t) Suppose e[u]>0, and for all (u,v) in E f : h[u]  h[v], u  s, u  t –Set h[u] = h[u] + 1

Preflow-Push Initialize While there is a node v <> t with e f (v) > 0 –If w such that push (f,h,v,w) is possible Push(f,h,v,w) –Else Relabel(f,h,v) E

Preflow push demo

Invariants 1.The labels are >= 0 and integers 2. f is a preflow, if the capacities are integral, the preflows are integral. 3.The preflow f and labelling h are compatible. 4.The height of a node never decreases.

Lemma Lef f be a preflow. If excess f (v) > 0 then there is a path in G f from v to source s. Pf: Let A denote all the nodes that have a path to s in G f. B = V \ A. What happens to edges inside B? If e has only its head in B? If e has only its tail in B? –f out (B)

Lemmas The height of a node is upper bounded by 2n-1. Cor: Each node is relabeled at most 2n-1 times, hence total relabels is upper bounded by 2n 2

Lemma: Saturating Pushes Throughout the algorithm, the number of saturating push operations is at most 2mn. Pf: Look at a saturating push along an edge. When can another saturating push happen thru the same edge? (If it needs lifting, how many lifts can one do on such a node in total?)

Potential function arguments Consider a joint bank account held by A, B, and C The account starts with an initial deposit of at most n 2. –A only makes withdrawals, each for 1 or more. –B makes fewer than n 2 deposits. Each deposit is for at most 1. –C makes fewer than nm withdrawals and deposits. Each deposit is for at most n. –The account never goes below 0. What is the maximum number of withdrawals for A?

Lemma: Non-Saturating Pushes Potential Functions Argument Lemma: The number of non-saturating push operations is bounded by 4mn 2 Pf: Define: A non saturating push decreases it by at least 1. A saturating push increases it by at most 2n-1 A relabel increases it by exactly 1. If we pick the active node at maximum height For pushing, we can get O(n^3) non-sat. pushes.

Modifications A simple modification gives O(n 3 ). Theorem: The total running time of the algorithm is upper bounded by O(mn 2 )

References R.K. Ahuja, T.L. Magnanti, and J.B. Orlin. Network Flows. Prentice Hall, (Reserved in Dirac) K. Mehlhorn and S. Naeher. The LEDA Platform for Combinatorial and Geometric Computing. Cambridge University Press, pagesThe LEDA Platform for Combinatorial and Geometric Computing