CSC373 Summer 2015 Tutorial 5 TA: Eric Zhu

Similar documents
The Mean Value Theorem

Network Flow I. Lecture Overview The Network Flow Problem

Linear Programming Notes V Problem Transformations

Max Flow, Min Cut, and Matchings (Solution)

1 if 1 x 0 1 if 0 x 1

CS 598CSC: Combinatorial Optimization Lecture date: 2/4/2010

P. Jeyanthi and N. Angel Benseera

Visa Smart Debit/Credit Certificate Authority Public Keys

1. Then f has a relative maximum at x = c if f(c) f(x) for all values of x in some

Properties of Real Numbers

Section 3.7. Rolle s Theorem and the Mean Value Theorem. Difference Equations to Differential Equations

The Goldberg Rao Algorithm for the Maximum Flow Problem

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

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

36 CHAPTER 1. LIMITS AND CONTINUITY. Figure 1.17: At which points is f not continuous?

8.1 Min Degree Spanning Tree

Continuity. DEFINITION 1: A function f is continuous at a number a if. lim

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

MAC Address Management

Polynomial Invariants

TOPIC 4: DERIVATIVES

The degree of a polynomial function is equal to the highest exponent found on the independent variables.

Arithmetic Coding: Introduction

Chapter 7. Homotopy. 7.1 Basic concepts of homotopy. Example: z dz. z dz = but

Rolle s Theorem. q( x) = 1

Chapter 10: Network Flow Programming

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

5.1 Derivatives and Graphs

north seattle community college

Unit 8: Congruent and Similar Triangles Lesson 8.1 Apply Congruence and Triangles Lesson 4.2 from textbook

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

Magnetic Fields. I. Magnetic Field and Magnetic Field Lines

SERVER CERTIFICATES OF THE VETUMA SERVICE

Sum of Degrees of Vertices Theorem

WAN Wide Area Networks. Packet Switch Operation. Packet Switches. COMP476 Networked Computer Systems. WANs are made of store and forward switches.

Graph Theory Lecture 3: Sum of Degrees Formulas, Planar Graphs, and Euler s Theorem Spring 2014 Morgan Schreffler Office: POT 902

x a x 2 (1 + x 2 ) n.

Algorithms and Data Structures

1 = (a 0 + b 0 α) (a m 1 + b m 1 α) 2. for certain elements a 0,..., a m 1, b 0,..., b m 1 of F. Multiplying out, we obtain

Euler Paths and Euler Circuits

5.1 Bipartite Matching

Two Fundamental Theorems about the Definite Integral

Graph Theory Problems and Solutions

Computational Geometry Lab: FEM BASIS FUNCTIONS FOR A TETRAHEDRON

Solving Quadratic Equations

A Labeling Algorithm for the Maximum-Flow Network Problem

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

P versus NP, and More

FIRST YEAR CALCULUS. Chapter 7 CONTINUITY. It is a parabola, and we can draw this parabola without lifting our pencil from the paper.

Real Roots of Univariate Polynomials with Real Coefficients

Incremental Maximum Flows for Fast Envelope Computation

Dimitris Chatzidimitriou. Corelab NTUA. June 28, 2013

CSE140: Midterm 1 Solution and Rubric

Efficient Data Structures for Decision Diagrams

Determine If An Equation Represents a Function

Math Journal HMH Mega Math. itools Number

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

Right Triangles 4 A = 144 A = A = 64

Network Planning and Analysis

Scheduling Shop Scheduling. Tim Nieberg

Critical points of once continuously differentiable functions are important because they are the only points that can be local maxima or minima.

Full and Complete Binary Trees

Homework # 3 Solutions

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

MOP 2007 Black Group Integer Polynomials Yufei Zhao. Integer Polynomials. June 29, 2007 Yufei Zhao

Circuits 1 M H Miller

Normal distribution. ) 2 /2σ. 2π σ

APPENDIX A: ERROR CODES

PUTNAM TRAINING POLYNOMIALS. Exercises 1. Find a polynomial with integral coefficients whose zeros include

MA107 Precalculus Algebra Exam 2 Review Solutions

Lecture 7: NP-Complete Problems

SERVER CERTIFICATES OF THE VETUMA SERVICE

Solving systems by elimination

BPEL disadvantage: more time to product BPEL advantage: better reusability, analysis

9. POLYNOMIALS. Example 1: The expression a(x) = x 3 4x 2 + 7x 11 is a polynomial in x. The coefficients of a(x) are the numbers 1, 4, 7, 11.

Follow the Perturbed Leader

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,

Approximation Algorithms

Automata and Computability. Solutions to Exercises

Lecture 1: Course overview, circuits, and formulas

Partial Fractions: Undetermined Coefficients

INCIDENCE-BETWEENNESS GEOMETRY

3.6 The Real Zeros of a Polynomial Function

6.3 Conditional Probability and Independence

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

A binary heap is a complete binary tree, where each node has a higher priority than its children. This is called heap-order property

Lagrange Interpolation is a method of fitting an equation to a set of points that functions well when there are few points given.

Algebraic Properties and Proofs

(MPLS) MultiProtocol Labling Switching. Software Engineering 4C03 Computer Network & Computer Security Dr. Kartik Krishnan Winter 2004.

AI: A Modern Approach, Chpts. 3-4 Russell and Norvig

A. The answer as per this document is No, it cannot exist keeping all distances rational.

THE BANACH CONTRACTION PRINCIPLE. Contents

3.2 The Factor Theorem and The Remainder Theorem

LIMITS AND CONTINUITY

Linear Programming. Solving LP Models Using MS Excel, 18

25 Integers: Addition and Subtraction

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Lecture 16 : Relations and Functions DRAFT

Transcription:

1 Ford-Fulkerson Consider the following flow network G. Compute a maximum flow in this network, using the Ford-Fulkerson algorithm. Figure 1: A flow network G Let s start with constructing the residual flow network G f. The initial residual flow network looks just the same as the graph diagram above. However, the number on each edge now represents the unused capacity - the maximum amount of flow that can be pushed through the edge. It is important to note that the flows in the residual network G f are not real flows - not in the same sense as the actual flows in G. You can think of G f as a data storage for storing the intermediate steps. We look for an s t path in this network, and we find the path s b c t. Figure 2: Picking an s t path on the residual network G f The edges with minimum unused capacity on this path are s b and c t, both have unused capacity 8. So we push amount of flow 8 through this path. Now we update the residual network G f : Page 1 of 6

Update forward edges on this path with the new unused capacities - subtracting each original unused capacity with the amount of flow pushed through this path. If the unused capacity was reduced to 0 for an edge, we simply remove the edge from the network. Add a backward edge for every forward edge on this path. Each new backward edge will have unused capacity equals to the amount of flow pushed through this path. If a backward edge already exists for a forward edge, add the amount of flow pushed to the unused capacity of the backward edge. Basically, we use forward edge to store the left-over capacity, and backward edge to store the surplus capacity that can be reversed in the future when the backward edge becomes an forward edge in a new s t path. Figure 3: On G f, update path s b c t, then pick a new s t path s a t After updating G f, we look for a new s t path in this network. We use the path s a t. We can push amount of flow 5 through this path. Update the forward edges on this path and add backward edges with new unused capacities. Figure 4: On G f, update path s a t, then pick a new path s d t Page 2 of 6

We find another s t path: s d t to push amount of flow 5. Update the forward edges on this path and add backward edges with new unused capacities. Figure 5: On G f, update path s d t, then pick a new path s a c b d t We find yet another path: s a c b d t. The maximum amount of flow we can push through this path is 3, because the minimum unused edge capacity in this path is 3 (edges a c and b d). Note the edge b c, it was a backward edge in the path s b c t which we picked in the first step, and now it becomes a forward edge in the current path. So by pushing flow through the current path, we are reversing the surplus flow in the original edge b c. Figure 6: On G f, update path s a c b d t, no more s t path After updating the last path, we cannot find any more s t path in the residual network G f. The total amount of flow we have pushed is 8 + 5 + 5 + 3 = 21. According to the Ford-Fulkerson algorithm, this is the maximum flow in this network. Page 3 of 6

2 Cut Capacity and Flow Consider the cut X 0 = ({s, b, c, d}, {a, t}). Identify all forward and all backward edges across X 0, then compute the capacity and the flow across X 0. Let s first label the original network G with the result we obtained from the final residual network G f. On G f, each reverse edge (reverse w.r.t. G) stores the flow through the corresponding original edge on G. We label each edge on G with the amount of flow and capacity. Now let s find the cut X 0 = ({s, b, c, d}, {a, t}). Figure 7: Label edges in G with [flow]/[capacity] Figure 8: The cut X 0 = ({s, b, c, d}, {a, t}) The cut separate nodes in the network into two groups: V s = {s, b, c, d} and V t = {a, t}. The forward edges are defined as the edges going from V s to V t, and the backward edges are defined as the edges going from V t to V s. Note the terms forward edges and backward edges are different from the ones we used in the last section. Here they refer to edges on the original network G. Page 4 of 6

Forward edges: {s a, b a, c t, d t} Backward edges: {a c} The capacity of the cut X 0 is: c(x 0 ) = c(e i ) = c(s a) + c(b a) + c(c t) + c(d t) = 10 + 3 + 8 + 10 = 31 The flow across the cut X 0 is: f(x 0 ) = f(e i ) f(e i ) e i backward edges = f(s a) + f(b a) + f(c t) + f(d t) f(a c) = 8 + 0 + 8 + 8 3 = 21 (1) (2) Remember, when looking for the forward and backward edges of a cut, always work on the original network G. The edges and labels on the residual network G f are not real edges and not real flows. 3 Minimum Cut Find a cut in the network above whose capacity is equal to the value of your maximum flow (this provides a guarantee that your flow really is maximum). Use the algorithm outlined in the proof of the Ford-Fulkerson theorem. Start with X 1 = ({s}, {a, b, c, d, t}) and flow from before. Edge s a crosses cut forward with residual capacity 2, so set X 1 = ({s, a}, {b, c, d, t}). Now no more forward edge across the cut with residual capacity - all the forward edges across the cut are used at their full capacities. As before, the capacity of the cut X 1 is: c(x 1 ) = c(e i ) = c(s b) + c(s d) + c(a c) + c(a t) = 8 + 5 + 3 + 5 = 21 (3) The flow across the cut X 1 is: f(x 1 ) = f(e i ) f(e i ) e i backward edges = f(s b) + f(s d) + f(a c) + f(a t) f(b a) = 8 + 5 + 3 + 5 0 = 21 (4) Since f(x 1 ) = c(x 1 ), X 1 is a minimum cut of G. An alternative way to find the minimum cut in G is to look for blocking edges in the residual network G f : starting with V s = {s} and V t = {a, b, c, d, t}, do Depth-First Search starting from s and keep track of visited nodes: whenever a node n (other than s) is reached, V s = V S {n}, and stops when no more out-going path that leads to un-visited node can be find for the current node blocked by the in-coming edges. The resulting V s and V t form a minimum cut. Page 5 of 6

4 Multi-source and Multi-sink Network Explain carefully how to solve the maximum flow problem in a multi-source, multi-sink network one where there can be more than one source s 1,..., s k and more than one sink t 1,..., t l. Justify that your solution is correct. Solution Add super-source s with edges s s 1,..., s s k each of capacity inf; add super-sink t with edges t 1 t,..., t l t each of capacity. (Instead of using, can set capacity to sum of outgoing/incoming capacities). Max flow in resulting network = max flow in original network because: Any flow in original network can be extended to a flow in resulting network (for new edges from super-source to source, set flow equal to total flow out of source; for new edges from sink to super-sink, set flow equal to total flow into sink) hence, max flow in new network max flow in original network; Any flow in resulting network induces flow in original network (flow out of every source and into every sink limited only by edges in original network because of infinite capacities on new edges) hence, max flow in original network max flow in new network. Page 6 of 6