Maximum flow problem CE 377K. February 26, 2015

Similar documents
Graphs and Network Flows IE411. Lecture 12. Dr. Ted Ralphs

Maximum flow problem (part I)

Max Flow: Algorithms and Applications

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

- Well-characterized problems, min-max relations, approximate certificates. - LP problems in the standard form, primal and dual linear programs

Shortest paths: label setting

Energy minimization via graph-cuts

Minimum cost transportation problem

Network Flows. 4. Maximum Flows Problems. Fall 2010 Instructor: Dr. Masoud Yaghini

The maximum flow problem

Discrete Optimization 2010 Lecture 3 Maximum Flows

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

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

Graphs and Network Flows IE411. Lecture 15. Dr. Ted Ralphs

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

Lecture 2: Network Flows 1

1 Review for Lecture 2 MaxFlow

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

Algorithm Design and Analysis

Optimization - Examples Sheet 1

7.5 Bipartite Matching

CS 6820 Fall 2014 Lectures, October 3-20, 2014

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

Algorithm Design and Analysis

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

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

Two Applications of Maximum Flow

CMPSCI 611: Advanced Algorithms

2.13 Maximum flow with a strictly positive initial feasible flow

Algorithms and Theory of Computation. Lecture 11: Network Flow

Mathematics for Decision Making: An Introduction. Lecture 13

(1,3) (3,4) (2,2) (1,2) (2,4) t

Math 5490 Network Flows

CSE 421 Introduction to Algorithms Final Exam Winter 2005

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

ACO Comprehensive Exam March 20 and 21, Computability, Complexity and Algorithms

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

Relation of Pure Minimum Cost Flow Model to Linear Programming

The Max Flow Problem

The Budget-Constrained Maximum Flow Problem

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

The min cost flow problem Course notes for Optimization Spring 2007

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

Duality of LPs and Applications

Flows. Chapter Circulations

Algorithms: Lecture 12. Chalmers University of Technology

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

Topic: Primal-Dual Algorithms Date: We finished our discussion of randomized rounding and began talking about LP Duality.

Week 4. (1) 0 f ij u ij.

Network Flows. CTU FEE Department of control engineering. March 28, 2017

WEAKLY AND STRONGLY POLYNOMIAL ALGORITHMS FOR COMPUTING THE MAXIMUM DECREASE IN UNIFORM ARC CAPACITIES

CS261: Problem Set #3

6.046 Recitation 11 Handout

CSC Design and Analysis of Algorithms. LP Shader Electronics Example

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

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

3.3 Easy ILP problems and totally unimodular matrices

Review Questions, Final Exam

Maximum flow problem

Advanced Linear Programming: The Exercises

Contents. Introduction

Chapter 7 Network Flow Problems, I

CSC 373: Algorithm Design and Analysis Lecture 12

FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)

Linear Programming Duality

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

Introduction 1.1 PROBLEM FORMULATION

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

C&O 355 Mathematical Programming Fall 2010 Lecture 18. N. Harvey

Network Flows. CS124 Lecture 17

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

An example of LP problem: Political Elections

x y = 2 x + 2y = 14 x = 2, y = 0 x = 3, y = 1 x = 4, y = 2 x = 5, y = 3 x = 6, y = 4 x = 7, y = 5 x = 0, y = 7 x = 2, y = 6 x = 4, y = 5

ORIE 633 Network Flows October 4, Lecture 10

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

Lecture #21. c T x Ax b. maximize subject to

3.7 Cutting plane methods

Friday, September 21, Flows

CS 1501 Recitation. Xiang Xiao

Lecture 8 Network Optimization Algorithms

Maximum Flow Problem (Ford and Fulkerson, 1956)

Standard Diraphs the (unique) digraph with no vertices or edges. (modulo n) for every 1 i n A digraph whose underlying graph is a complete graph.

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

Soviet Rail Network, 1955

DEPARTMENT OF STATISTICS AND OPERATIONS RESEARCH OPERATIONS RESEARCH DETERMINISTIC QUALIFYING EXAMINATION. Part I: Short Questions

Parallel Graph Algorithms (con4nued)

On Végh s Strongly Polynomial Algorithm for Generalized Flows

6.854 Advanced Algorithms

15.082J and 6.855J and ESD.78J October 21, Max Flows 4

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

2001 Dennis L. Bricker Dept. of Industrial Engineering The University of Iowa. Reducing dimensionality of DP page 1

Robust Network Codes for Unicast Connections: A Case Study

Technische Universität München, Zentrum Mathematik Lehrstuhl für Angewandte Geometrie und Diskrete Mathematik. Combinatorial Optimization (MA 4502)

Algorithms: COMP3121/3821/9101/9801

EXERCISES SHORTEST PATHS: APPLICATIONS, OPTIMIZATION, VARIATIONS, AND SOLVING THE CONSTRAINED SHORTEST PATH PROBLEM. 1 Applications and Modelling

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

Chapter 7. Network Flow. CS 350: Winter 2018

Linear programming. Saad Mneimneh. maximize x 1 + x 2 subject to 4x 1 x 2 8 2x 1 + x x 1 2x 2 2

Mathematical Programs Linear Program (LP)

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

Transcription:

Maximum flow problem CE 377K February 6, 05

REVIEW

HW due in week Review

Label setting vs. label correcting Bellman-Ford algorithm Review

MAXIMUM FLOW PROBLEM

Maximum Flow Problem What is the greatest amount of flow that can be shipped between a given source and sink without exceeding link capacities? Maximum flow problem

Applications Determining the capacity of a network Identifying critical links in a network Rounding a matrix Maximum flow problem

In the maximum flow problem, we are given... A network G = (N, A) with a specified source node r and sink node s. Each link (i, j) has a capacity u ij. (Costs are irrelevant in the maximum flow problem.) The objective is to ship as much flow as possible from r to s while respecting the link capacities. Maximum flow problem

Formulation max b,x s.t. b x hi b i = r x ij = +b i = s (h,i) A (i,j) A 0 otherwise 0 x ij u ij (i, j) A A feasible solution x to this problem is called a flow. The amount of flow shipped is given by b. Maximum flow problem

RESIDUAL GRAPHS

A very useful concept in solving maximum flow problems is the residual graph R(x) 3 0 3 4 3 0 0 0 0 4 Capacity Flow b = 4 Residual Graph In a residual graph, each link is replaced by two links: a forward link with capacity u ij x ij, and a reverse link with capacity x ij. Residual graphs

Residual graphs tell us how we can change the flow x (usually with the aim of trying to add more.) Forward links tell us how much more flow can be added to a link; reverse links tell us how much can be removed. 3 0 3 4 3 0 0 0 0 4 Capacity Flow b = 4 Residual Graph Note that the same network will have a different residual graph for each possible flow x. Residual graphs

AUGMENTING PATH ALGORITHM

Example 3 0 0 0 0 0 3 4 3 0 0 0 0 0 3 4 Capacity Flow Residual Graph Augmenting path algorithm

Algorithm Initialize the flow with x 0, b k 0. Construct the residual network R(x) corresponding to flows x. 3 Identify a path π in R connecting s and t which has positive capacity on each of its arcs. (Terminate if no such path exists.) 4 Find the minimum capacity u of all of the arcs in π (whether forward or reverse). 5 For each forward arc (i, j) in π k, x ij x ij + u. For each reverse arc (j, i) in π k, x ij x ij u. 6 Increase b by u, and return to step. If you were writing code to do this, how would you implement step 3? Augmenting path algorithm

MAX-FLOW/MIN-CUT DUALITY

To prove correctness of the augmenting path algorithm, we ll take a short detour. Max-flow/min-cut duality

To prove correctness of the augmenting path algorithm, we ll take a short detour. 3 7 4 8 3 3 6 3 5 Capacity u(r,s) = 7 In a network, a cut is a partitioning of the nodes into two sets R and S, where the source is in R and the sink is in S. A cut link is a link whose tail node is in R and whose head node is in S. Max-flow/min-cut duality

The capacity of a cut u(r, S) is the sum of the capacities in the cut links. 3 7 4 8 3 3 6 3 5 Capacity u(r,s) = 7 Max-flow/min-cut duality

3 7 4 8 3 3 6 3 5 Capacity u(r,s) = 5 Max-flow/min-cut duality

3 7 4 8 3 3 6 3 5 Capacity u(r,s) = 0 Max-flow/min-cut duality

Weak max-flow/min-cut theorem. If (b, x) is a feasible solution to the max flow problem, and if (R, S) is a cut, then b u(r, S) Proof sketch: Any unit of flow shipped from r to s must cross one of the cut links. So, the total amount of flow moving from r to s cannot exceed the sum of the capacities in the cut links. Max-flow/min-cut duality

Strong max-flow/min-cut theorem. If (b, x ) is an optimal solution to the max flow problem, and if u = min{u(r, S)} among all possible cuts, then b = u This is a duality type of result: finding the maximum flow in a network is equivalent to finding the cut with minimum capacity. We will prove this theorem in conjunction with the correctness of the augmenting path algorithm. Max-flow/min-cut duality

Assume for now that the augmenting path algorithm terminates with some flow x. When it does so, there are no paths in R(x) from r to s with positive capacity. Let R be the set of nodes for which paths with positive capacity do exist in the residual network (including r itself), and let S be all other nodes. Max-flow/min-cut duality

Since r R and s S, (R, S) is a valid cut. Furthermore, by definition every cut link has zero capacity. Therefore, the capacity of the cut is exactly equal to the sum of the flow on the cut arcs, so b = u(r, S). By the weak max-flow/min-cut theorem, this means b must be maximal and u(r, S) must be minimal. (Strong theorem has been proved.) Therefore, the augmenting path algorithm terminates with the correct answer. Max-flow/min-cut duality

COMPLEXITY

The other issue is proving that the augmenting path algorithm must terminate. This is easy to do if we assume that the capacities are integers. (If they are fractional, multiply by a sufficiently large number.) Each iteration adds at least to b, so b will reach its maximum value b in a finite number of iterations. Complexity

If U is the largest capacity on any link, then the capacity of the min cut is bounded by nu. (Look at a cut where R is just the source.) So, the augmenting path algorithm requires O(nU) iterations. Each iteration must construct a residual network (O(m) steps), and identify a path with positive capacity. The basic search algorithm for finding a path also has O(m) steps. So, the augmenting path algorithm in all requires O(nmU) steps. Complexity

INFORMAL EVALUATIONS

Pace of class? Fast/slow/OK Most unclear concept at this point What is working well? What can I improve on? Any other comments or suggestions Informal Evaluations