Lecture 4. 1 Overview. 2 Preflows. COMPSCI 532: Design and Analysis of Algorithms September 4, 2015

Similar documents
Preflow-Push Algorithm

16.1 Maximum Flow Definitions

Tutorial for Algorithm s Theory Problem Set 5. January 17, 2013

Today. Maximum flow. Maximum flow. Problem

CS261: A Second Course in Algorithms Lecture #3: The Push-Relabel Algorithm for Maximum Flow

CS261: Problem Set #1

1 Introduction. 2 The Generic Push-Relabel Algorithm. Improvements on the Push-Relabel Method: Excess Scaling. 2.1 Definitions CMSC 29700

Maximum Flow Algorithms

Workshop In Advanced Data Structures Push-Relabel Heuristics. Maya Orshizer Sagi Hed

Linear Programming Duality and Algorithms

g(s, w) g(w, s) (in gross model).

Lecture 7. s.t. e = (u,v) E x u + x v 1 (2) v V x v 0 (3)

and 6.855J March 6, Maximum Flows 2

Advanced Combinatorial Optimization September 15, Lecture 2

LECTURES 3 and 4: Flows and Matchings

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

Mathematics for Decision Making: An Introduction. Lecture 18

instead of waiting till hit sink to augment, augment a s a d v ance augment ( v w ) amount is min of ow r e a c hing v and (v w ) \unaugment" when ret

Solution for Homework set 3

Network Design and Optimization course

Lecture 7: Asymmetric K-Center

A Lock-free Multi-threaded Algorithm for the Maximum Flow Problem

Graph Representations and Traversal

Topics in Combinatorial Optimization February 5, Lecture 2

Lecture 10,11: General Matching Polytope, Maximum Flow. 1 Perfect Matching and Matching Polytope on General Graphs

CSE 417 Network Flows (pt 4) Min Cost Flows

6.854J / J Advanced Algorithms Fall 2008

1 Matching in Non-Bipartite Graphs

4 Greedy Approximation for Set Cover

Important separators and parameterized algorithms

Math 5490 Network Flows

Chapter 5 Graph Algorithms Algorithm Theory WS 2012/13 Fabian Kuhn

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang

so when retreat on edge, can \delete" edge when vertex has no outgoing arcs, know it is blocked when augment along path, can also \delete" edges so to

Graph Algorithms Using Depth First Search

Reducing Directed Max Flow to Undirected Max Flow and Bipartite Matching

Advanced Combinatorial Optimization September 17, Lecture 3. Sketch some results regarding ear-decompositions and factor-critical graphs.

Homework 3 Solutions

Final Exam Spring 2003

Approximability Results for the p-center Problem

On vertex types of graphs

Lecture #7. 1 Introduction. 2 Dijkstra s Correctness. COMPSCI 330: Design and Analysis of Algorithms 9/16/2014

Lecture Overview. 2 Shortest s t path. 2.1 The LP. 2.2 The Algorithm. COMPSCI 530: Design and Analysis of Algorithms 11/14/2013

Lecture 14: Linear Programming II

Minimum Cost Edge Disjoint Paths

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

Recognizing Interval Bigraphs by Forbidden Patterns

K 4 C 5. Figure 4.5: Some well known family of graphs

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 10 Notes. Class URL:

Parametric Maximum Flow Problem: Techniques and Algorithms. Deepika Sareen, Dr Deepak Garg. Thapar University, Patiala

Network Flows. 1. Flows deal with network models where edges have capacity constraints. 2. Shortest paths deal with edge costs.

The Encoding Complexity of Network Coding

CS 217 Algorithms and Complexity Homework Assignment 2

Jessica Su (some parts copied from CLRS / last quarter s notes)

Lecture 3: Graphs and flows

Discrete Wiskunde II. Lecture 6: Planar Graphs

Sublinear-Time Parallel Algorithms. for Matching and Related Problems. Andrew V. Goldberg y. Stanford University. Stanford, CA 94305

ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED NETWORK

arxiv: v2 [cs.ds] 14 Sep 2010

1 Bipartite maximum matching

Lecture 3: Art Gallery Problems and Polygon Triangulation

A COMPUTATIONAL STUDY OF THE CONSTRAINED MAXIMUM FLOW PROBLEM

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I. Instructor: Shaddin Dughmi

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 36

CSE 417 Network Flows (pt 3) Modeling with Min Cuts

Syllabus. simple: no multi-edges undirected edges in-/out-/degree /0: absent 1: present (strongly) connected component subgraph, induced graph

CSE 521: Design and Analysis of Algorithms I

Lecture Notes on Karger s Min-Cut Algorithm. Eric Vigoda Georgia Institute of Technology Last updated for Advanced Algorithms, Fall 2013.

Problem Set 7 Solutions

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Vertex 3-colorability of claw-free graphs

Matchings. Saad Mneimneh

Lecture 4: Primal Dual Matching Algorithm and Non-Bipartite Matching. 1 Primal/Dual Algorithm for weighted matchings in Bipartite Graphs

and 6.855J. The Successive Shortest Path Algorithm and the Capacity Scaling Algorithm for the Minimum Cost Flow Problem

Dual-Based Approximation Algorithms for Cut-Based Network Connectivity Problems

Lecture 11: Maximum flow and minimum cut

Algorithmic Aspects of Communication Networks

Single Source Shortest Path

Finding Strongly Connected Components

by conservation of flow, hence the cancelation. Similarly, we have

Introduction. I Given a weighted, directed graph G =(V, E) with weight function

Lecture 5: Graph algorithms 1

Scribes: Romil Verma, Juliana Cook (2015), Virginia Williams, Date: May 1, 2017 and Seth Hildick-Smith (2016), G. Valiant (2017), M.

CS473-Algorithms I. Lecture 13-A. Graphs. Cevdet Aykanat - Bilkent University Computer Engineering Department

CSE 331: Introduction to Algorithm Analysis and Design Graphs

Maximum flows & Maximum Matchings

MTL 776: Graph Algorithms Lecture : Matching in Graphs

Maximum flow problem CE 377K. March 3, 2015

Notes on Minimum Cuts and Modular Functions

Online Algorithms. Lecture 11

Problem Set 2 Solutions

Solutions for the Exam 6 January 2014

Problem Set 3. MATH 776, Fall 2009, Mohr. November 30, 2009

COS 423 Lecture 22. Robert E. Tarjan 2011

Complexity Classes and Polynomial-time Reductions

Cuts, Connectivity, and Flow

EMBEDDING INTO l n. 1 Notation and Lemmas

Steiner Trees and Forests

Lecture notes on: Maximum matching in bipartite and non-bipartite graphs (Draft)

Transcription:

COMPSCI 532: Design and Analysis of Algorithms September 4, 2015 Lecture 4 Lecturer: Debmalya Panigrahi Scribe: Allen Xiao 1 Overview In this lecture we will introduce the current fastest strongly polynomial algorithm for maximum flow, the push-relabel algorithm (due to Goldberg and Tarjan [GT88]). With careful data structures, it can be shown to run in O(mnlogn) time. However, we will only show an analysis for O(mn 2 ) time. 2 Preflows Contrary to the previous algorithms based on augmentation, the push-relabel algorithm uses a new paradigm for constructing the optimal flow. The augmentation algorithms maintain a feasible flow and raise the flow value until s cannot reach t (no more augmenting paths). Preflow algorithms, on the other hand, begin with s unable to reach t in G f in an infeasible flow and gradually modify it to make it feasible. The infeasible flow maintained is a preflow. Definition 1. f : E R is a preflow if for each edge (v,w) it satisfies: 1. Capacity constraints: f (v,w) u(v,w) 2. Balance: f (x,v) 0 v s,t x V Contrast to flow, where this was met with equality. We allow more flow can enter v than exits, and call this difference the excess at v, e f (v). 3. Skew symmetry: f (v,w) = f (w,v) If the excess at every non-source/sink vertex is 0, the preflow is a valid flow. Definition 2. The residual network G f for a preflow is defined the same way as for flows: u f (v,w) = u(v,w) f (v,w) Definition 3. The value of a preflow is the outgoing flow from s: f = f (v,w) = f (s,v) v s,t w v Flow out of s either ends up at t or gets stuck at some other vertex. In the same way as augmentations in flows, we can add these preflows on G f with f for a feasible preflow. The proof is the same. 4-1

3 Push-Relabel Algorithm The push-relabel algorithm maintains a preflow and routes excess (one edge at a time) from the graph interior to s,t. Like the previous flow algorithms, it also maintains some notion of admissible edges, and moves flow only on these. This is maintained through an explicit height function over vertices. Definition 4. Push-relabel maintains a height function h(v) 0 over all vertices. We call an edge (v, w) admissible if: h(v) > h(w) Sending flow on admissible edges is like sending flow downhill. In contrast to the distances from t (d(v)) we used in blocking flow to define admissibility, h(v) is defined and updated explicitly by the algorithm (and not a naturally ocurring quantity in the graph). h(v) s relationship with the actual G f distances d(v) will become more clear as we prove more limits on h(v). The algorithm starts by initializing the preflow such that its value is a simple upper bound for any feasible flow: it saturates the outgoing edges (degree cut) of s. Then, the algorithm manipulates the preflow and heights using only two operations, to eventually move all excesses to s or t. Definition 5. The two operations: 1. PUSH(v,w): For some r we choose, this function is applicable if e f (v) r and u f (v,w) r. The push moves r excess across (v,w), in other words: e f (v) e f (v) r u f (v,w) u f (v,w) r e f (w) e f (w) + r In our case we will always try to send the greatest r we can: r = min{e f (v),u f (v,w)} Whenever r = u f (v,w), we call this a saturating push. Otherwise, the push is a non-saturating push. 2. RELABEL(v): We can relabel v when it has positive excess, but no outgoing admissible edges. This raises h(v) (the label) until v has at least one admissible outgoing edge. The algorithm itself is very simple: h(v) min {h(w)} + 1 w:(v,w) E 4-2

Algorithm 1 (Push-Relabel 1988) 1: f 0 2: h(v) 0 v V \ {s} 3: h(s) n 4: Saturate all edges leaving s. 5: while e f (v) > 0 for any v s,t do 6: if v has and admissible outgoing edge (v,w) then 7: PUSH(v, w) 8: else 9: RELABEL(v) 10: end if 11: end while 3.1 Correctness When no internal vertices have excess, the preflow is a feasible flow. If we prove that the preflow maintains t unreachable from s in G f, then it must also be a maximum flow. We will prove that the algorithm maintains a preflow where t is always unreachable from s in G f. Lemma 1. The labels (heights) satisfy the following properties throughout the algorithm: 1. h(s) = n,h(t) = 0 2. For any (v,w) G f, h(v) h(w) + 1. Proof. We can prove this by induction on the operations. Initially, both conditions are met h(s), h(t) are initialized as such and all residual edges have h(v) h(w) equal to 0 or n. Suppose that the conditons are met at any point, then apply either operation: 1. PUSH(v,w): This may add a reverse edge (w,v) G f. Push only works on edges where h(v) > h(w), so by our assumption it must be that h(v) = h(w) + 1. The reverse edge (w,v) therefore has h(w) = h(v) 1 h(v) + 1 And the assumptions are satisfied for the new edge. 2. RELABEL(v): By the conditions for relabel require that v has no admissible edges, i.e. for all edges (v,w): h(v) h(w) Then, relabeling v gives: h(v) h(w) + 1 for all neighboring w. Relabel is never applied to s,t, so the first condition is also maintained. 4-3

The second point of Lemma 1 is what ties our purposefully specified heights h(v) to graph distances d(v). Effectively: h(v) d(v) Heights are a lower bound to distances from t. As we show in the next lemma, h(v) = n directly implies that d(s) =, and so s cannot reach t in the residual graph. Lemma 2. There is no s-t path in G f during the push-relabel algorithm. Proof. Suppose for contradiction such a path exists. Then there is a path s,v 1,...,v k,t in G f. By the first condition of Lemma 1, By the second condition, we must have: And we find a contradiction: Therefore, there must be no s-t path in G f. h(s) = n h(t) = 0 h(s) h(v 1 ) + 1 h(t) + (n 1) n n 1 The statement of this lemma seems to imply that the algorithm maintains some sort of s-t cut which shrinks into the minimum cut. The algorithm even begins by creating an s-t cut: the degree cut of s. After proving Lemma 2, we conclude that f is a maximum flow. 3.2 Running Time We will bound the number of times RELABEL is invoked, the number of saturating PUSH, and the number of non-saturating PUSH. First, we we prove an upper bound on the height of any vertex. Lemma 3. If v has positive excess, then there is a v-s path in G f. Proof. Let S be the set of vertices with a path to s in G f. S = { v there is a v-s path in G f } By definition, no edges in (S,V \ S) have positive residual capacity. All residual edges go from S to V \ S, meaning the flow moves the opposite direction. f (S,V \ S) 0 Now, add a dummy vertex t, and add residual edges (v,t) from every excess vertex, routing all excess to t. This turns the preflow into a feasible s-t flow. Let T = (V \ S) {t }. Since (S,T ) is a s-t cut: f (S,T ) = f (s,v) = e f (v) v V v V Combining, we have: f (S,{t }) e f (v) v V Since the only edges to t are the ones carrying excess from the original preflow, it must be that the bound above is met with equality and all excess vertices lie in S. The lemma follows by definition of S. 4-4

Lemma 4. For every vertex v, h(v) 2n 1. Proof. For v to be relabeled, it must have e f (v) > 0. By Lemma 3, there must be a G f path v,v 1,...,v k = s. Applying Lemma 1 over this path: h(v) h(v 1 ) + 1 h(s) + k h(s) + (n 1) 2n 1 Corollary 5. The number of relabel operations is 2n 2. Next, we look at pushes. Lemma 6. There are at most n pushes over any edge which saturate it. Proof. A push is saturating if, after the push, u f (v,w) = 0. Any push has h(v) > h(w), so between two saturating pushes on (v,w) h(v) must increase by at least 2. By Lemma 4, h(v) 2n 1. The number of saturating pushes over (v,w) is therefore no more than n. Corollary 7. The number of saturating pushes is 2mn. Lemma 8. The number of non-saturating pushes is 5mn 2 Proof. Consider the following potential function: We know that: φ = v s,t:e f (v)>0 φ init = 0 φ final = 0 The final potential is also 0, as all excess ends in t. Each relabel raises potential by at least 1 (increments one h(v)). Applying Corollary 5: h(v) for relabels: φ 2n 2 A saturating push on (v,w) can raise potential by at most 2n 2, if w previously had no excess. Applying Corollary 7: for saturating pushes: φ 4mn 2 Finally, a non-saturating push on (v,w) lowers potential As h(v) > h(w), Lemma 1 tells us how much: for a single non-saturating push: φ h(w) h(v) = 1 Combining, we can get the total number of non-saturating pushes. Let T be the number of non-saturating pushes. 0 0 + 2n 2 + 4mn 2 + T ( 1) T 2n 2 + 4mn 2 5mn 2 Now that we have the operation counts, runtime is simple. Theorem 9. The running time of the push-relabel algorithm is O(mn 2 ). Proof. Each of the operations (push, relabel) can be done in constant time. Adding the operation counts gives us O(mn 2 ) time. 4-5

4 Summary We can get a strong improvement in push-relabel by improving our choice of vertices and edges for pushes and relabels. If we always push flow out of the vertex with maximum h(v), we can prove a running time of O(n 2 m). A version using certain dynamic trees and performing simultaneous pushes runs in O(mnlog n2 m ) time. This is also used by the best algorithm to find a blocking flow, which has a similar time bound. This is the fastest strongly polynomial maximum flow algorithm, and the most commonly used max-flow algorithm in practice. References [GT88] Andrew V Goldberg and Robert E Tarjan. A new approach to the maximum-flow problem. Journal of the ACM (JACM), 35(4):921 940, 1988. 4-6