Transportation Planning: The maximum flow problem

Similar documents
Maximum flows & Maximum Matchings

CSE 417 Network Flows (pt 4) Min Cost Flows

Network Flow. The network flow problem is as follows:

Lecture 11: Maximum flow and minimum cut

NETWORK OPTIMIZATION MODELS

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

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

Network Flow. November 23, CMPE 250 Graphs- Network Flow November 23, / 31

GRAPH DECOMPOSITION BASED ON DEGREE CONSTRAINTS. March 3, 2016

Source. Sink. Chapter 10: Iterative Programming Maximum Flow Problem. CmSc250 Intro to Algorithms

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

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

Chapter 15 Introduction to Linear Programming

Network Flow I. Lecture Overview The Network Flow Problem

Material handling and Transportation in Logistics. Paolo Detti Dipartimento di Ingegneria dell Informazione e Scienze Matematiche Università di Siena

Lecture 3: Totally Unimodularity and Network Flows

LECTURES 3 and 4: Flows and Matchings

Solution for Homework set 3

Notes on Network Optimization CE 4920 Stephen Boyles Fall 2009

CMPSCI611: The Simplex Algorithm Lecture 24

Problem Set 7 Solutions

MAXIMAL FLOW THROUGH A NETWORK

6. Lecture notes on matroid intersection

Computational Methods in IS Research Fall Graph Algorithms Network Flow Problems

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

IV. Special Linear Programming Models

These notes are in two parts: this part has topics 1-3 above.

Network Optimization Problems. Chapter 6: Hillier and Hillier

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.

Network Design and Optimization course

Homework 3 Solutions

Notes for Lecture 20

Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch.

Algorithm Circle Extra Lecture: Solving the Assignment Problem with Network Flow

Network flows and Menger s theorem

Chapter 10: Network Flow Programming

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

The Encoding Complexity of Network Coding

Lecture 3: Graphs and flows

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Graph Theory Mini-course

Finding Strongly Connected Components

15-451/651: Design & Analysis of Algorithms October 11, 2018 Lecture #13: Linear Programming I last changed: October 9, 2018

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14

COMP4128 Programming Challenges

Graph Algorithms. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

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

POLYHEDRAL GEOMETRY. Convex functions and sets. Mathematical Programming Niels Lauritzen Recall that a subset C R n is convex if

x ji = s i, i N, (1.1)

5 The Theory of the Simplex Method

Solutions for the Exam 6 January 2014

A Proof of the Side-Splitter Theorem

Section 8.2 Graph Terminology. Undirected Graphs. Definition: Two vertices u, v in V are adjacent or neighbors if there is an edge e between u and v.

Lecture and notes by: Sarah Fletcher and Michael Xu November 3rd, Multicommodity Flow

CSC 8301 Design & Analysis of Algorithms: Linear Programming

5. Lecture notes on matroid intersection

Lecture 6: Shortest distance, Eulerian cycles, Maxflow

and 6.855J March 6, Maximum Flows 2

CMPSCI 311: Introduction to Algorithms Practice Final Exam

2386 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 52, NO. 6, JUNE 2006

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

Maximum Flow. Flow Networks. Flow Networks Ford-Fulkerson Method Edmonds-Karp Algorithm Push-Relabel Algorithms. Example Flow Network

Minimum Cost Edge Disjoint Paths

Matching Theory. Figure 1: Is this graph bipartite?

Minimum Spanning Tree (undirected graph)

3 No-Wait Job Shops with Variable Processing Times

Fundamental Properties of Graphs

Fundamentals of Integer Programming

4 Integer Linear Programming (ILP)

Equations of planes in

Winning Positions in Simplicial Nim

1. Lecture notes on bipartite matching February 4th,

Chapter 6. Planar Orientations. 6.1 Numberings of Digraphs

Theorem 2.9: nearest addition algorithm

J Linear Programming Algorithms

Network optimization: An overview

y i = S i ΠS y i + S i ΠN\S

V10 Metabolic networks - Graph connectivity

Reducing Directed Max Flow to Undirected Max Flow and Bipartite Matching

Lecture 2 September 3

Module 11. Directed Graphs. Contents

The Shortest Path Problem. The Shortest Path Problem. Mathematical Model. Integer Programming Formulation

Easter Term OPTIMIZATION

Notes for Lecture 24

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

Bipartite Matching & the Hungarian Method

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

MATH20902: Discrete Maths, Solutions to Problem Set 1. These solutions, as well as the corresponding problems, are available at

An Interactive Introduction to Graph Theory

APPM 4120/5120 Exam #2 Practice Solutions Spring 2015

Maximum Flow Algorithms

P Is Not Equal to NP. ScholarlyCommons. University of Pennsylvania. Jon Freeman University of Pennsylvania. October 1989

1. What do you get as the integer and noninteger parts if you factor this as we did with our cutting planes:

Adjacent: Two distinct vertices u, v are adjacent if there is an edge with ends u, v. In this case we let uv denote such an edge.

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

arxiv: v2 [cs.ds] 14 Sep 2010

Graph Algorithms Maximum Flow Applications

Finite Termination of Augmenting Path Algorithms in the Presence of Irrational Problem Data

Today. Maximum flow. Maximum flow. Problem

Transcription:

Transportation lanning: The maximum flow problem In many applications, and especially in the planning of Transportation and Logistics of materials, one important problem is that of finding how much material can be shipped between two locations, using transportation channels of limited capacity. ifferent variations of this problem are faced by the shipping industry, by companies that must maintain a certain amount of inventory in different warehouses, etc. Another application is in the design of transportation routes (e.g. the owloon otor Bus company may want to know how the maximum number of people that can be transported from Choi Hung to Clear Water Bay Beach on a day.) Let us look at some example problems if this type before we study a technique to solve such problems. Example 1. The H government plans to hold a Super Light-and-Sound Show in the Victoria Harbor on New Year eve. The organizing committee has asked the HE power company about the maximum electric power that can be supplied at the WanChai Sub-Station for use in the celebration events. The power generator for this is located on Lamma Island. It will be supplied to the WanChai station for utilization for the event. The following figure shows the maximum available capacity (after subtracting other normal use requirements) for transferring power between different sub-stations on H Island. What is the maximum power that HE can promise to the event organizer? Western 1 okfulam 5 Central WanChai 2 15 2 15 15 25 HappyValley 4 Northoint 3 5 2 2 4 Aberdeen 2 2 RepulseBay 4 ower Station Lamma Figure 1. Electric power transmission capacities for example 1 1

Example 2. A company has a factory located in etroit, USA, producing electric golf carts. The carts will be exported to Asian countries, and are therefore stored in a warehouse in San Francisco. All carts are shipped from the company to San Francisco by train. The train company operates trains daily on the national rail network. The carts are packed in traincompartments, called bogeys. There is a limit on how many compartments can be shipped across each link of the train network daily. The network below shows the carrying capacity. What is the maximum number of bogeys that can be shipped out of etroit each day? [Note that although some routes take longer to reach the destination than others, this does not matter to our problem in steady state, each day we ship out some bogeys full of carts, and each day, we receive the same number of bogeys full of carts at San Francisco]. Boise inneapolis San Francisco 1 1 etroit 1 ansas City hoenix Figure 2. Golf cart shipping example It is conventional in these problems that the location which is producing the goods to be sent out is called a source, while the location of the receiving point is called the sink. In both our examples, we have assumed that the source and sink have infinite capacity. This is convenient in solving the problem. An important consideration for all maximum flow problems is that there is no leakage, or production, of flow at any node except for the source and sink. You must have noticed that the two examples are really very similar in nature, and each tries to maximize the flow from source to sink across a network of limited capacity channels. This type of problem has a very natural way to model it, using graphs. Such problems can be modeled using a technique of algebra called Linear rogramming, and therefore it is possible to use the Simplex method to solve them (also taught in this course). However, we shall study a graph theory method, which is more efficient. 2

The Ford-Fulkerson ax Flow Algorithm for Networks We shall represent the network as a graph, where the weight of each edge will denote the maximum capacity of that link of the network. To make things easier, we first look at some basic ideas used by the algorithm. Flow Cancellation: Consider two adjacent nodes with a positive capacity in both directions, as shown in the figure below. Consider a case where 5 units are transported from node a to node b, and 3 units from node b to node a. The net result is identical to a situation where 2 units are shipped from node a to node b, and units from node b to node a. We may say that the flow in one direction cancels the flow in the reverse direction. a b a 5/ 3/ b (i) Flow capacities, a b: units b a: units (ii) Flow across edges, a b: 5 units, max capacity: b a: 3 units, max capacity: a 2/ b a 5/ b (iii) Flow cancellation from (ii), a b: 2 units, max b a: units, max (iv) Additional units from b a a b: units, max b a: 5 units, max Figure 3. Flow cancellation Using flow cancellation, we can always reduce the material flow between a pair of adjacent nodes to a positive flow on only one of the edges, with zero flow on the other edge. The reason it can always be applied is that (a) it obeys the law of conservation of mass at each node, and (b) since it only reduces the actual flows in each edge, it never leads to a flow capacity constraint violation. Flow cancellation is a simple and useful trick we shall use to solve the maximum flow problem. In particular, it helps us to clearly see some possible flows which appear to be infeasible, but are actually feasible. Consider the example in Figure 3 above. The maximum capacity of edge a b is units, while maximum capacity of edge b a is units. A flow of 5 units from a to b, and flow of 3 units from b to a is identical to an actual flow of 2 units from a b and no flow from b a. Assume that we try to send an additional units from b a. By just looking at the capacity of the edge from b a, it seems that this cannot be done, since the flow exceeds the max capacity of this edge, 3

which is units. However, after flow cancellation, we get an equivalent situation as shown in Figure 3 (iv), which is clearly feasible. Residual Network: Our approach for solving the maximum flow problem will be to find, at each step, a path that can carry some amount of flow from the source to the sink. Obviously, once we commit to some flow, the edges along this path will have less remaining capacity. To assist in our search for the next flow path, it is convenient to keep track of the remaining capacity in each edge. The residual network is a graph that indicates the remaining net capacity for each edge. In constructing residual networks, the following convention is convenient. If two adjacent nodes only have a single, directed edge between them, then we add another edge with an initial capacity =, in the other direction. The reason for this will become clear when we construct a residual network. We shall solve our problem in stages, adding some more flow from source to sink in each stage. A residual network of the graph will be maintained at each stage. This helps us in (a) keeping track of the remaining capacity to carry extra material on each edge, and (b) to search for the next path over which we can send more materials. We look at an example of how to maintain residual networks, using the Golf cart shipping example above. Figure 4a shows the initial situation, where the flow is zero; the cities represent the nodes which are named by the first letter of the city. Figure 4b shows the same graph with the -capacity nodes added. Next assume that we send units along the path <,,,, S>, as shown in Figure 4c. This gives us the residual network as shown in Figure 4d. Consider the edge in the initial graph, with capacity. Since units flow from to, so its residual capacity is units. In reality, there is no edge from ( ) in the graph; but we represent this as an edge of zero capacity. Sending units from can be seen as increasing our ability to send up to units from. This does not really mean that we can send some units on, it just means that if we actually used some of the capacity ( units) of this fake-edge,, then that flow could just be cancelled by the units we are sending along. The net result will be a situation that does not violate our initial capacity constraints. B 1 1 S 1 Figure 4 (a). The flow network for golf cart shipments 4

S 1 B 1 1 Figure 4 (b). The equivalent flow network ( capacity edges added) S S 1 / B 1 /1 / / Figure 4 (c). A flow of units along <,,,, S> 1 B 1 Figure 4 (d). The residual network of G after accounting for the flow in (c) The following property of the residual network is very useful: roperty 1. Let G be a network with zero flow. Let G f1 be its residual network after introducing a flow, f1, from the source to the sink, of f1 units. Assume that we can now introduce a flow, f2, of f2 units in the residual network G f1, without violating any capacity constraints, resulting in a new residual network G f1,f2. Then the new residual network is identical to the one we would obtain if we had introduced a flow of f1 + f2 units directly into the network G. Augmenting ath: Any simple path in a residual network, going from the source to the sink, such that each edge on this path has capacity >, is an augmenting path. By simple path, we mean that it should not cross itself, i.e. no node should occur twice in a simple path. An augmenting path is just some path that allows us to send more units across our residual network. 4 2 5

The above definitions are now sufficient for us to write the Ford-Fulkerson method: The Ford-Fulkerson ethod for finding the maximum flow in a given network: Step 1. Initialize the network with a zero flow Step 2. If we can find an augmenting path, p, in the network, then 2.1. Apply the maximum flow allowed on p to the network; 2.2. Compute the residual network; 2.3. Return back to Step 2; otherwise: the current residual network is carrying the maximum flow. In short, if we reach a situation where there is no augmenting path in the residual network, then the total flow in this state is the maximum flow that the network could allow. The beauty of the method is that at each step, we just find any way to improve the total amount of flow, and we will eventually reach the optimum. Another way to look at this is that our search for the optimum solution is along a monotonically increasing path. roof of correctness How do we know that the solution we have reached is optimal? Consider this: at some intermediate stage, if we had selected a different augmentation path, then certainly we would have obtained a different residual network. Ford-Fulkerson claim that no matter what intermediate choices we make, when there are no more augmentation paths available, the flow in the corresponding residual networks will be the same! To prove this, we need to re-use our old trick of putting a part of the network in a bag. In this case, we construct a bag that includes the source and possibly some other nodes; the sink, however, must stay outside the bag. Figure 5 shows an example, with the red nodes inside the bag, and the green nodes outside it. roperty 2. At some stage, let the flow from source to sink be f, carrying a total amount f from source to sink. Then, for every bag constructed as described above, the net amount flowing out of the bag is f. Why is this true? Assume it was false, and that the net flow was some amount, x < f. Now the source is sending out f amount each day, and only x units are flowing out every day. Thus some node (or set of nodes) inside the bag must be saving up the difference = (x - f ). If we use the same network for a long time, each day we will build up some extra amount inside the bag, eventually carrying a large store inside the bag. However, this obviously contradicts our assumption that the net flow at each node (total inflow total outflow) must be exactly zero. The same logic proves that x > f is impossible.

B / / S /1 / / /1 /1 / / / Figure 5. A source-containing bag in the network for our example net flow = -+= units; outflow capacity = +1 = 22 units To complete our proof of correctness, we need a definition: the outflow capacity of a bag. The outflow capacity of a bag is the maximum amount that can flow out of the bag. Notice that when compute the outflow capacity, we just ignore the amount that can flow into the bag, because we are interested in the maximum amount that can flow out of the bag this will happen when we are sending out the maximum, and taking in zero. The outflow capacity for the bag in Figure 5 is therefore 22 units, corresponding to the edges {(,B), (,)}. Assume that f is a flow after which our method can find no augmenting path from source to sink in graph G. At this point, we partition all nodes of G into two sets: any node to which we can still find an augmenting path is placed in the set IN-BAG; all other nodes are placed in the set OUT-OF-BAG. Clearly, the node sink is in OUT-OF-BAG. The outflow capacity of IN-BAG = the volume of flow f = f. The reason for this becomes clear if we generate the residual network for flow f through G. In the residual network, every edge going from IN-BAG OUT-OF-BAG must have zero residual capacity. If not, then of course we could push some more flow across this edge, and therefore the corresponding vertex should not have belonged to OUT- OF_BAG. Let us focus our attention on this partitioning of nodes. If there is some flow that can push a larger amount than f, say f + through our network. Then, from property 2, the flow going out of IN-BAG must also be f +. But this is clearly impossible, since the maximum outflow capacity of the edges going out of IN-BAG is limited to f < f +. This completes the proof that the Ford-Fulkerson method must have terminated at the optimum, i.e. maximum flow that can be sent through the network. Before completing this section, I would like to point out a few things of interest. 1. In classical terminology, the notion of the bag that partitions our set of nodes into two non-intersecting subsets is called a cut of the graph. The proof of correctness of the max-flow method above was completed by finding a particular cut that had the minimum outflow capacity. Therefore this method is sometimes called the max-flow min-cut method. Stated in the classical terminology, we say that the maximum flow we can send across a network equals the minimum of the outflow capacities of all possible cuts of the graph (as long as the cut separates the source from the sink, of course).

2. The problem of finding maximum flow capacity of networks has many applications in odern Logistics management. Computer programs that can solve max-flow programs are used heavily by all automatic systems that calculate how shipments are transported by shipping companies (they may use planes, ships, trains, etc.). 3. Another common use of max flow problems is in optimization of design. This includes design of piping systems for chemical and food-processing plants, water supply of a city, sewage systems, etc. One difference in the design of water supply systems is that usually there is one source (the reservoir), and many sinks (e.g. the water storage tank of each area, from where it is pumped to individual apartments). After completing the design of a particular supply network, we can then compute the maximum amount of water that can be supplied to any of the supply points. If this amount does not meet our required demand in that area, we will know that a higher capacity pipe should be designed.