A New Approach to the Maximum-Flow Problem Andrew V. Goldberg, Robert E. Tarjan Presented by Andrew Guillory.

Slides:



Advertisements
Similar presentations
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.
Advertisements

15.082J & 6.855J & ESD.78J October 14, 2010 Maximum Flows 2.
Chapter 6 Maximum Flow Problems Flows and Cuts Augmenting Path Algorithm.
MAXIMUM FLOW Max-Flow Min-Cut Theorem (Ford Fukerson’s Algorithm)
The Maximum Network Flow Problem. CSE Network Flows.
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.
1 Efficient implementation of Dinic’s algorithm for maximum flow.
CS138A Network Flows Peter Schröder. CS138A Flow Networks Definitions a flow network G=(V,E) is a directed graph in which each edge (u,v)
Global Price Updates Help A.V Goldberg and R. Kennedy Advanced Algorithms Seminar Instructor: Prof. Haim Kaplan Presented by: Orit Nissan-Messing.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
1 Maximum flow problems. 2 - Introduction of: network, max-flow problem capacity, flow - Ford-Fulkerson method pseudo code, residual networks, augmenting.
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.
The max flow problem
1 Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
1 Efficient implementation of Dinic’s algorithm for maximum flow.
Maximum flow Algorithms and Networks. A&N: Maximum flow2 Today Maximum flow problem Variants Applications Briefly: Ford-Fulkerson; min cut max flow theorem.
3/3/ Alperovich Alexander. Motivation  Find a maximal flow over a directed graph  Source and sink vertices are given 3/3/
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Advanced Algorithms Piyush Kumar (Lecture 5: Preflow Push) Welcome to COT5405.
Single Source Shortest-Path: The General Case (with negative edges) Bellman-Ford algorithm. Iteratively relax all edges |V|-1 times Running time? O(VE).
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.
Maximum Flow Algorithms —— ACM 黄宇翔. 目录 Max-flow min-cut theorem 12 Augmenting path algorithms 3 Push-relabel maximum flow algorithm.
Maximum Flow. p2. Maximum Flow A flow network G=(V, E) is a DIRECTED graph where each has a nonnegative capacity u.
1 WEEK 11 Graphs III Network Flow Problems A Simple Maximum-Flow Algorithm Izmir University of Economics.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25.
and 6.855J March 6, 2003 Maximum Flows 2. 2 Network Reliability u Communication Network u What is the maximum number of arc disjoint paths from.
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.
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.
Maximum Flow Problem Definitions and notations The Ford-Fulkerson method.
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)
Honors Track: Competitive Programming & Problem Solving Push-Relabel Algorithm Claire Claassen.
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
Algorithms and Networks Hans Bodlaender
Richard Anderson Lecture 23 Network Flow
Lecture 22 Network Flow, Part 2
Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Algorithms and Networks
Edmonds-Karp Algorithm
Network Flows and Matching (Supplementary)
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
Efficient implementation of Dinic’s algorithm for maximum flow
Lecture 10 Network flow Max-flow and Min-cut Ford-Fulkerson method
3.4 Push-Relabel(Preflow-Push) Maximum Flow Alg.
Richard Anderson Lecture 21 Network Flow
Problem Solving 4.
Network Flows and Matching (Supplementary)
Max Flow Min Cut, Bipartite Matching Yin Tat Lee
Primal-Dual Algorithm
Algorithms (2IL15) – Lecture 7
and 6.855J March 6, 2003 Maximum Flows 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
Lecture 21 Network Flow, Part 1
and 6.855J The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem Obtain a network, and use the same network to illustrate the.
and 6.855J The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem Obtain a network, and use the same network to illustrate the.
Lecture 21 Network Flow, Part 1
Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Lecture 22 Network Flow, Part 2
Richard Anderson Lecture 22 Network Flow
Max Flows 3 Preflow-Push Algorithms
Presentation transcript:

A New Approach to the Maximum-Flow Problem Andrew V. Goldberg, Robert E. Tarjan Presented by Andrew Guillory

Outline Background Definitions Push-Relabel Algorithm Correctness / Termination Proofs Implementation

Maximum Flow Problem Classic problem in operations research Many problems reduce to max flow  Maximum cardinality bipartite matching  Maximum number of edge disjoint paths  Minimum cut (Max-Flow Min-Cut Theorem) Machine learning applications  Structured Prediction, Dual Extragradient and Bregman Projections (Taskar, Lacoste-Julien, Jordan JMLR 2006)  Local Search for Balanced Submodular Clusterings (Narasimhan, Bilmes, IJCAI 2007)

Relation to Optimization Special case of submodular function minimization Special case of linear programming Integer edge capacities permit integer maximum flows (constructive proof)

History of Algorithms Augmenting Paths based algorithms  Ford-Fulkerson (1962) O(mU)  Edmonds-Karp (1969) O(nm 3 )  … O(n 3 ) O(nmlog(n)) O(nmlog(U)) Push-Relabel based algorithms  Goldberg (1985) O(n 3 )  Goldberg and Tarjan (1986) O(nmlog(n 2 /m))  Ahuja and Orlin O(nm + n 2 log(U))

Outline Background Definitions Push-Relabel Algorithm Correctness / Termination Proofs Implementation

Definitions Graph G = (V, E)  |V| = n  |E| = m G is a flow network if it has  source s and sink t  capacity c(v,w) for each edge (v,w) in E  c(v,w) = 0 for (v,w) not in E

Definitions (continued) A flow f on G is a real value function on vertex pairs  f(v,w) <= c(v,w) for all (v,w)  f(v,w) = -f(w,v)  ∑ u f(u,v) = 0 for all v in V - {s,t} Value of a flow |f| is ∑ v f(v,t) Maximum flow is a flow of maximum value

Definitions (continued again) A preflow f on G is a real value function on vertex pairs  f(v,w) <= c(v,w) for all (v,w)  f(v,w) = -f(w,v)  ∑ u f(u,v) >= 0 for all v in V - {s} Flow excess e(v) = ∑ u f(u,v) Intuition: flow into a vertex can exceed flow out

Outline Background Definitions Push-Relabel Algorithm Correctness / Termination Proofs Implementation

Intuition Starting with a preflow, push excess flow closer towards sink If excess flow cannot reach sink, push it backwards to source Eventually, preflow becomes a flow and in fact the maximum flow

Residual Graph Residual capacity r f (v, w) of a vertex pair is c(v, w) – f(v, w) If v has positive excess and (v,w) has residual capacity, can push δ = min(e(v), r f (v, w)) flow from v to w Edge (v,w) is saturated if r f (v, w) = 0 Residual graph G f = (V, E f ) where E f is the set of residual edges (v,w) with r f (v, w) > 0

Labeling A valid labeling is a function d from vertices to nonnegative integers  d(s) = n  d(t) = 0  d(v) <= d(w) + 1 for every residual edge If d(v) < n, d(v) is a lower bound on distance to sink If d(v) >= n, d(v) - n is a lower bound on distance to source

Push Operation Push(v,w) Precondition: v is active (e(v) > 0) and r f (v, w) > 0 and d(v) = d(w) + 1 Action: Push δ = min(e(v), r f (v, w)) from v to w f(v,w) = f(v,w) + δ; f(w,v) = f(w,v) – δ; e(v) = e(v) - δ; e(w) = e(w) + δ;

Relabel Operation Relabel(v) Precondition: v is active (e(v) > 0) and r f (v, w) > 0 implies d(v) <= d(w) Action: d(v) = min{d(w) + 1 | (v,w) in E f }

Generic Push-Relabel Algorithm Starting from an initial preflow > While there is an active vertex Chose an active vertex v Apply Push(v,w) for some w or Relabel(v)

Example 0/3 0/1 0/2 Flow Network ST

Example /3 0/1 0/2 ST Initial preflow / labeling

Example /3 0/1 0/2 ST Select an active vertex

Example /3 0/1 0/2 Relabel active vertex ST

Example /3 0/1 0/2 Select an active vertex ST

Example /3 1/1 0/2 Push excess from active vertex ST

Example /3 1/1 0/2 Select an active vertex ST

Example /3 1/1 0/2 Relabel active vertex ST

Example /3 1/1 0/2 Select an active vertex ST

Example /3 1/1 1/2 Push excess from active vertex ST

Example /3 1/1 1/2 Select an active vertex ST

Example /3 1/1 1/2 Relabel active vertex ST

Example /3 1/1 1/2 Select an active vertex ST

Example /3 1/1 1/2 Push excess from vertex ST

Example /3 1/1 1/2 Maximum flow ST

Outline Background Definitions Push-Relabel Algorithm Correctness / Termination Proofs Implementation

Correctness Lemma 2.1 If f is a preflow, d is a valid labeling, and v is active, either push or relabel is applicable to v Lemma 3.1 The algorithm maintains a valid labeling d Theorem 3.2 A flow is maximum iff there is no path from s to t in G f (Ford and Fulkerson [7])

Correctness (continued) Lemma 3.3 If f is a preflow and d is a valid labeling for f, there is no path from s to t in G f  Proof by contradiction  Path s, v 0, v 1, …, v l, t implies that d(s) <= d(v 0 ) + 1 <= d(v 1 ) + 2 <= … <= d(t) + l < n  Which contradicts d(s) = n

Correctness (continued) Theorem 3.4 If the algorithm terminates with a valid labeling, the preflow is a maximum flow  If the algorithm terminates, all vertices have zero excess (preflow is a flow)  By Lemma 3.3 the sink is not reachable from the source  By Theorem 3.2 the flow is maximum

Termination Lemma 3.5 If f is a preflow and v is an active vertex then the source is reachable from v in G f Lemma 3.6 A vertex’s label never decreases

Termination (continued) Lemma 3.7 At any time the label of any vertex is at most 2n – 1  Only active vertex labels are changed  Active vertices can reach s  Path v, v 0, v 1, …, v l, s implies that d(v) <= d(v 0 ) + 1 <= d(v 1 ) + 2 <= … <= d(s) + l <= n + n - 1

Termination (continued) Lemma 3.8 There are at most 2n 2 labeling operations  Only the labels corresponding to V-{s,t} may be relabeled  Each of these n – 2 labels can only increase  At most (2n – 1) (n – 2) relabelings

Termination (continued) Lemma 3.9 The number of saturating pushes is at most 2nm  For any pair (v,w) d(w) must increase by 2 between saturating pushes from v to w  Similarly d(v) must increase by 2 between pushes from w to v  d(v) + d(w) >= 1 on the first saturating push  d(v) + d(w) <= 4n - 3 on the last  At most 2n - 1 saturating pushes per edge

Termination (continued) Lemma 3.10 The number of nonsaturating pushes is at most 4n 2 m  Φ = ∑ v d(v) where v is active  Each nonsaturating push causes Φ to decrease by at least 1  The total increase in Φ from saturating pushes is (2n – 1) 2nm  The total increase in Φ from relabeling is (2n – 1)(n – 2)  Φ is 0 initially and Φ at termination

Termination Theorem 3.11 The algorithm terminates in O(n 2 m) Total time = # nonsaturating pushes + #saturating pushes + #relabeling operations 4n 2 m + 2nm + 2n 2 = O(n 2 m)

Outline Background Definitions Push-Relabel Algorithm Correctness / Termination Proofs Implementation

At each step select an active vertex and apply either Push or Relabel Problem: Determining which operation to perform and in the case of Push finding a residual edge Solution: For each vertex maintain a list of edges which touch that vertex and a current edge

Push/Relabel Operation Push/Relabel(v) Precondition: v is active Action: If Push(v,w) is applicable to current edge (v,w) then Push(v,w) Else if (v,w) is not the last edge advance current edge Else reset the current edge and Relabel(v)

Push/Relabel Operation Lemma 4.1 The push/relabel operation does a relabeling only when relabeling is applicable Theorem 4.2 The push/relabel implementation runs in O(nm) time plus O(1) time per nonsaturating push operation

O(n 3 ) bound We can select vertices in arbitrary order Certain vertex selection strategies give O(n 3 ) bounds  First-in, first-out method (proved in paper)  Maximum distance method (proved here)  Wave method

Maximum distance method At each step, select the active vertex with maximum distance d(v) Theorem The maximum distance method performs at most 4n 3 nonsaturating pushes Corollary The maximum distance method runs in time O(n 3 ) using the push/relabel implementation

Proof Consider D = max x d(x) where x is active D only increases because of relabeling D increases at most 2n 2 times D starts at 0 and ends nonnegative D changes at most 4n 2 times There is at most one nonsaturating push per node per value of D