Lecture 20 Max-Flow Problem and Augmenting Path Algorithm. October 28, 2009

Similar documents
Max Flow, Min Cut, and Matchings (Solution)

Linear Programming Notes V Problem Transformations

The Binary Blocking Flow Algorithm. Andrew V. Goldberg Microsoft Research Silicon Valley goldberg/

5.1 Bipartite Matching

Minimum cost maximum flow, Minimum cost circulation, Cost/Capacity scaling

The Goldberg Rao Algorithm for the Maximum Flow Problem

The Binary Blocking Flow Algorithm. Andrew V. Goldberg Microsoft Research Silicon Valley goldberg/

Approximation Algorithms

Incremental Maximum Flows for Fast Envelope Computation

Lecture 3. Linear Programming. 3B1B Optimization Michaelmas 2015 A. Zisserman. Extreme solutions. Simplex method. Interior point method

Chapter 10: Network Flow Programming

Network Flow I. Lecture Overview The Network Flow Problem

Algorithm Design and Analysis

A Labeling Algorithm for the Maximum-Flow Network Problem

A Network Flow Approach in Cloud Computing

Linear Programming for Optimization. Mark A. Schulze, Ph.D. Perceptive Scientific Instruments, Inc.

Linear Programming. March 14, 2014

Incremental Maximum Flows for Fast Envelope Computation

THE PROBLEM WORMS (1) WORMS (2) THE PROBLEM OF WORM PROPAGATION/PREVENTION THE MINIMUM VERTEX COVER PROBLEM

A linear combination is a sum of scalars times quantities. Such expressions arise quite frequently and have the form

Fairness in Routing and Load Balancing

Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued.

1 Solving LPs: The Simplex Algorithm of George Dantzig

8.1 Min Degree Spanning Tree

On the effect of forwarding table size on SDN network utilization

Equilibrium computation: Part 1

Chapter Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling

Linear Programming. April 12, 2005

Scheduling Shop Scheduling. Tim Nieberg

Reinforcement Learning

Max Flow. Lecture 4. Optimization on graphs. C25 Optimization Hilary 2013 A. Zisserman. Max-flow & min-cut. The augmented path algorithm

Lecture 2: August 29. Linear Programming (part I)

Transportation Polytopes: a Twenty year Update

Proximal mapping via network optimization

56:171 Operations Research Midterm Exam Solutions Fall 2001

Basic Components of an LP:

Minimizing costs for transport buyers using integer programming and column generation. Eser Esirgen

Linear Programming I

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

Why? A central concept in Computer Science. Algorithms are ubiquitous.

Single-Link Failure Detection in All-Optical Networks Using Monitoring Cycles and Paths

Data Structures and Algorithms Written Examination

Unit 1. Today I am going to discuss about Transportation problem. First question that comes in our mind is what is a transportation problem?

Optimization Modeling for Mining Engineers

Special Situations in the Simplex Algorithm

Multi-layer MPLS Network Design: the Impact of Statistical Multiplexing

6.231 Dynamic Programming and Stochastic Control Fall 2008

Dynamic programming. Doctoral course Optimization on graphs - Lecture 4.1. Giovanni Righini. January 17 th, 2013

Search Heuristics for Load Balancing in IP-networks

Applied Algorithm Design Lecture 5

Linear Programming. Solving LP Models Using MS Excel, 18

On Integer Additive Set-Indexers of Graphs

NP-Hardness Results Related to PPAD

Network Flow Algorithms

2.3 Convex Constrained Optimization Problems

Reinforcement Learning

Mining Social Network Graphs

Solutions to Homework 6

Lecture 2 Introduction to Data Flow Analysis

Cost Models for Vehicle Routing Problems Stanford Boulevard, Suite 260 R. H. Smith School of Business

Dynamic Programming 11.1 AN ELEMENTARY EXAMPLE

Chapter 11: PERT for Project Planning and Scheduling

1 Introduction. Dr. T. Srinivas Department of Mathematics Kakatiya University Warangal , AP, INDIA

Multiple Spanning Tree Protocol (MSTP), Multi Spreading And Network Optimization Model

4.6 Linear Programming duality

Discrete Optimization

5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

Largest Fixed-Aspect, Axis-Aligned Rectangle

Creating a More Efficient Course Schedule at WPI Using Linear Optimization

Network Models 8.1 THE GENERAL NETWORK-FLOW PROBLEM

EXCEL SOLVER TUTORIAL

The Trip Scheduling Problem

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

Practical Guide to the Simplex Method of Linear Programming

LECTURE: INTRO TO LINEAR PROGRAMMING AND THE SIMPLEX METHOD, KEVIN ROSS MARCH 31, 2005

OPRE 6201 : 2. Simplex Method

11. APPROXIMATION ALGORITHMS

Lecture 11: 0-1 Quadratic Program and Lower Bounds

Acceptance of reservations for a rent-a-car company J.Alberto Conejero 1, Cristina Jordan 2, and Esther Sanabria-Codesal 1

Lecture 1: Course overview, circuits, and formulas

Warshall s Algorithm: Transitive Closure

Branch and Cut for TSP

Operation Research. Module 1. Module 2. Unit 1. Unit 2. Unit 3. Unit 1

SIGNAL FLOW GRAPHS. Prof. S. C.Pilli, Principal, Session: XI, 19/09/06 K.L.E.S. College of Engineering and Technology, Belgaum

Dimitris Chatzidimitriou. Corelab NTUA. June 28, 2013

2.8 An application of Dynamic Programming to machine renewal

IEOR 4404 Homework #2 Intro OR: Deterministic Models February 14, 2011 Prof. Jay Sethuraman Page 1 of 5. Homework #2

Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:

Sport Timetabling. Outline DM87 SCHEDULING, TIMETABLING AND ROUTING. Outline. Lecture Problem Definitions

Solving Linear Programs

What is Linear Programming?

Dynamic programming formulation

A Constraint Programming based Column Generation Approach to Nurse Rostering Problems

Binary Image Reconstruction

Discuss the size of the instance for the minimum spanning tree problem.

Today s Topics. Primes & Greatest Common Divisors

An Overview Of Software For Convex Optimization. Brian Borchers Department of Mathematics New Mexico Tech Socorro, NM

1. Prove that the empty set is a subset of every set.

Modeling and Solving the Capacitated Vehicle Routing Problem on Trees

Transcription:

Max-Flow Problem and Augmenting Path Algorithm October 28, 2009

Outline Lecture 20 Max-Flow problem Description Some examples Algorithm for solving max-flow problem Augmenting path algorithm Operations Research Methods 1

Max-Flow Problem: Single-Source Single-Sink We are given a directed capacitated network (V, E, C) connecting a source (origin) node with a sink (destination) node. The set V is the set of nodes in the network. The set E is the set of directed links (i, j) The set C is the set of capacities c ij 0 of the links (i, j) E. The problem is to determine the maximum amount of flow that can be sent from the source node to the sink node. This is Max-Flow Problem for single-source and single-sink Operations Research Methods 2

Max-Flow Problem: Multiple-Sources Multiple-Sinks We are given a directed capacitated network (V, E, C) connecting multiple source nodes with multiple sink nodes. The set V is the set of nodes and the set E is the set of directed links (i, j) The set C is the set of capacities c ij 0 of the links (i, j) E The problem is to determine the maximum amount of flow that can be sent from the source nodes to the sink nodes. cij This is Max-Flow Problem for multiple-sources and multiple-sinks Operations Research Methods 3

Multiple-sources multiple-links problem can be converted to a single-source and single-sink problem by Introducing a dummy source node that is connected to the original source nodes with infinite capacity links Introducing a dummy sink node that is connected with the original sink nodes with infinite capacity links Operations Research Methods 4

For small scale problems: Another alternative is to introduce a single dummy source node connected with all the original source nodes BUT Each outgoing link from the dummy source node to an original source node s gets assigned a capacity that is equal to the total capacity of the outgoing links from s Similarly, if there are multiple sink nodes, we introduce a single dummy sink node BUT Each incoming link from an original sink node t to the dummy sink node gets assigned a capacity that is equal to the total capacity of the incoming links to sink t Operations Research Methods 5

Operations Research Methods 6

Maximum Flow Problem: Mathematical Formulation We are given a directed capacitated network G = (V, E, C)) with a single source and a single sink node. We want to formulate the max-flow problem. For each link (i, j) E, let x ij denote the flow sent on link (i, j), For each link (i, j) E, the flow is bounded from above by the capacity c ij of the link: c ij x ij 0 We have to specify the balance equations All the nodes in the network except for the source and the sink node are just transit nodes (inflow=outflow) x li {l (l,i) E} {j (i,j) E} x ij = 0 for all i s, t Operations Research Methods 7

The objective is to maximize the outflow from the source node s {j (s,j) E} x sj Lecture 20 Alternatively: to maximize the inflow to the sink node t MAX-FLOW FORMULATION {l (l,t) E} x lt maximize subject to {j:(s,j) E} x sj x li {l (l,i) E} {j (i,j) E} x ij = 0 0 x ij c ij for all (i, j) E. for all i s, t Operations Research Methods 8

maximize x 12 + x 13 subject to x 12 x 25 x 24 = 0 balance for node 2 x 13 x 35 x 34 = 0 balance for node 3 x 24 + x 34 x 46 = 0 balance for node 4 x 25 + x 35 x 56 = 0 balance for node 5 0 x 12 5 0 x 13 10 0 x 24 4 0 x 25 5 0 x 34 5 0 x 35 5 0 x 46 8 0 x 56 10 Max-Flow is an LP problem: we could use a simplex method Operations Research Methods 9

Max-Flow Algorithms For a given graph: n denotes the number of nodes m denotes the number of edges max f is the maximum amount of flow Method Complexity Description Simplex Constrained by legal flow Ford-Fulkerson algorithm O(m max f ) Weights have to be integers Edmonds-Karp algorithm O(nm 2 ) Based on Ford-Fulkerson Dinitz blocking flow algorithm O(n 2 m) Builds layered graphs General push-relabel algorithm O(n 2 m) Uses a preflow Ford-Fulkerson Algorithm is also known as Augmenting Path algorithm We will also refer to it as Max-Flow Algorithm Operations Research Methods 10

Max-Flow Algorithm This is an iterative method (operates in stages) At each iteration, the algorithm is searching for a path from the source node to the sink node along which it can send a positive flow Such a path is referred to as augmenting path After a flow is sent along an augmenting path the capacities of the links on that path are adjusted These adjusted capacities are referred to as residual capacities Correspondingly, the resulting network is referred to as residual network The algorithm terminates when an augmenting path cannot be found Operations Research Methods 11

Example: Augmenting path Suppose we choose to send the flow along path 1 3 5 6 Suppose we choose to send 4 units of flow along this path Then the residual capacities of links (1,2), (3,5) and (5,6) are 6, 1, and 6 respectively A better choice is to send 5 units along this path. In this case, the capacity of the link (3,5) is reached (its residual capacity becomes 0) We say that link (3,5) is saturated (no more flow can be sent) Operations Research Methods 12

The flow on a path that saturates at least one of its links is the capacity of the path In other words, the capacity of a path is the maximum possible amount that we can send along the path The capacity C(p) of the path p is given by C(p) = min (i,j) p u ij where u ij is the capacity of the link (i, j) If the path p under consideration is in the residual network then the links (i, j) p are the links in the residual network and the capacities are residual capacities Operations Research Methods 13

Residual Capacity The links that have been used to send a flow get updated to reflect the flow push Every such link (i, j) gets a capacity label of the form a/b where a is the remaining capacity of the link and b is the total flow sent along that link a is viewed as forward capacity of the link b is viewed as backward capacity of the link (capacity if we choose to traverse the link in the opposite direction) NOTE: a + b = c ij The sum of these numbers is equal to the original capacity of the link Operations Research Methods 14

Link with residual capacity a/b with b > 0 can be traversed backward Traveling backward means that we are removing the flow from the link For example the link (i, j) with the capacity 10/3 can be used backward to send the flow of at most 3 units If we send 2 units backward [along (j, i)], the resulting residual capacity of the link is (12,1) Operations Research Methods 15

Example: Algorithm Application We will use f i to indicate the amount of flow sent in iteration i We will apply the algorithm that sends the maximum possible amount of flow at each iteration, i.e., the flow equal to the capacity of the path under consideration Operations Research Methods 16

Iteration 1 We find a path s 4 3 t that can carry a positive flow The maximum flow we can send along this path is f 1 = min{2, 1, 1}. We send f 1 = 1 unit of flow along this path Operations Research Methods 17

We obtain a residual network with updated link capacities resulting from pushing the flow along the path Operations Research Methods 18

Iteration 2 We find a path s 1 2 t that can carry a positive flow The maximum flow we can send along this path is f 2 = min{4, 4, 3}. We send f 2 = 3 units of flow along this path Operations Research Methods 19

We obtain a residual network with updated link capacities resulting from pushing the flow along this path Operations Research Methods 20

Iteration 3 We find a path s 4 t that can carry a positive flow The maximum flow we can send along this path is f 3 = min{1, 3}. We send f 3 = 1 unit of flow along this path Operations Research Methods 21

We obtain a residual network with updated link capacities resulting from pushing the flow along this path Operations Research Methods 22

Iteration 4 We find a path s 1 3 4 t that can carry a positive flow The maximum flow we can send along this path is f 4 = min{1, 2, 1, 2}. We send f 4 = 1 unit of flow along this path Operations Research Methods 23

We obtain a residual network with updated link capacities resulting from pushing the flow along this path At this point we are done. The node 2 is disconnected from the rest of the nodes (forward capacity 0 on all outgoing links) There are no more augmenting paths. Operations Research Methods 24

MAX-FLOW VALUE The maximum flow is the total flow sent: f 1 + f 2 + f 3 + f 4 = 1 + 3 + 1 + 1 = 6. Operations Research Methods 25