Академический Документы
Профессиональный Документы
Культура Документы
3A GI
Chapter 3
3.1 Introduction
Network flow problems concern the circulation of material on/through the arcs of a given network. Historically, these problems have been studied to represent electrical current circulating on a network of dipoles. Nowadays, there exist a large number of real situations that can be modeled using the concept of network flow: Transportation of merchandise from different distribution sites to different customers through urbain, railway, marine, airway networks, or in some cases a mix of ransportation modes, flow of liquids inside pipelines, flow of information through communication networks, Inventory management, scheduling,
3.2 Definitions
Given a network G = (N,A), we associate with each arc u of A a positive integer number cu called capacity of arc u. The set N contains two special nodes: One node having a zero indegree, called the source S of G, One node having a zero outdegree, called the sink T of G. All other nodes are called transit nodes. One property of such networks is their ability to transport flow on the arcs. A flow vector is defined as = [1, 2, , m]T m with m components such that 0 u cu , u = 1, , m
The flow (vector) is feasible, if it satisfies the following flow conservation equations: u(i) u - u-1(i) u = 0 iX
OPTIMIZATION
3A GI
-1(i): the set of arcs incident into, The arc capacity may be interpreted as the maximal flow that can circulate through the arc.
21
OPTIMIZATION
3A GI
Let E =
j =1
{rj, dj}. Ranking the elements of E results in at most 2n-1 time intervals
[eh, eh+1]. Construct a network by defining: A node associated with each task, A node associated with each time interval [eh, eh+1], Two additional nodes S and T linked, respectively, to all tasks and all time intervals, An arc associated with each possibility of execution of one task during a given time interval. Thus, an arc links task j to time interval [eh, eh+1] if and only if it is possible to execute the task j during that interval. The following condition has to be satisfied: rj eh and eh+1 dj.
The capacity of an arc (S, j) is pj, linking one task to a time interval is (eh+1 - eh), and the capacity of an arc linking a node associated with a time interval to T is m(eh+1 eh). A feasible schedule exists iff the maximum value flow between S and T has a value of P = j=1,n pj. c. Maximum number of disjoint paths in a network Given a network G = [N, A] and two nodes S and T. Two paths joining S and T are said to be disjoint if they do not have any arc in common. The network is said to be pconnex if there exist at least p paths joining every pair of nodes. Finding the maximum number of disjoint paths between two nodes S and T is equivalent to solving a maximum value flow problem. This is achieved by assigning a capacitiy of 1 unit to each arc and finding the maximum value flow between S and T.
3.3.3 Algorithm of Ford-Fulkerson (1959) This is one of the simplest algorithms for solving the the maximum value flow problem. It uses the concept of labeling. It is an iterative algorithm that consists of determining, at each iteration, a chain between S and T that allows for augmenting the flow value while respecting the capacity constraints. Such a chain is called a Flow Augmenting Chain (FC).
22
OPTIMIZATION
3A GI
To identify a chain between S and T, a labeling algorithm is applied. This algorithm consists in constructing a tree rooted at S and which nodes are all labeled (a tree is a partial subnetwork that contains no cycles). At the beginning, only S is labeled, and at each iteration, one labeled node is selected in order to label all its sucessors. Every time a node j is selected, it is included in the tree while noting its predecssor (i), which is the node that was responsible for its labeling. The algorithm stops when: the node T is labeled or all successors of labeled nodes are examined without being able to label the node T. In the latter case, we conclude that there is no chain from S to T in the network. Here we notice that nodes may be in three possible states: (1) unlabeled, (2) labeled and unscanned, and (3) labeled and scanned. At each iteration, a labeled and unscanned node is selected, in order to examine its neighboring nodes. Once this is done, node i becomes scanned but remains labeled until T is labeled or the algorithm stops without labeling T. Given a network G = (N, A, C), de Ford-Fulkerson algorithm, for determining the maximum value flow between S and T, is described as follows: Algorithm of Ford-Fulkerson (1959) : Step 0 : Find a feasible flow vecteur between S and T. One can always start with the zero flow vector. Step 1 : Plant a tree with root at S Let be the current flow vector. Label the node S with (*). S is now labeled and unscanned. Go to step 2. Step 2 : Tree growth Find a labeled and unscanned node i and do the following: If there exists an unlabeled node j such that (i,j) A and (i,j) < c(i,j), label the node j with (+i) : unsaturated forward arc, thus the flow can increase
23
OPTIMIZATION
3A GI
If there exists an unlabeled node j such that (j,i) A and (j,i) > 0, label he node j with (-i) : backward arc and the flow can decrease If such a pair does not exist, there is a nonbreakthrough. The current flow vector is a maximum value flow vector; Terminate. Otherwise, node i is the immediate predecessor of j in a chain starting from S. If j = T, there is a breakthrough, go to step 3. Otherwise repreat this step 2. Step 3 : Flow augmentation Since T is labeled, an FC has just been found (it can be deduced by tracing back the predecessors starting from T). The current flow can be augmented by the amount , which is the minimum value of the residual capacity (capacity-current flow) on forward arcs and the flow values on backward arcs.
= min
uFC,forward
min
(cu u );
uFC,backward
min
Change the current flow vector, , as follows: Increase by the flow on each forward arc of FC, decrease by the flow on each backward arc of FC.
Erase the labels of all nodes and go back to step 1 with the new flow vector. Example: Isopipe Company wants to send the maximum quantity of natural gas (per hour) through its pipelines, from node O to node T of the following network (Figure 4.1).
4 1 3 2 1 2 1 3 1 2 4 2 1 2 3
T
2
S
24
OPTIMIZATION
3A GI
It is required that the natural gas passes through certain stations: 1, 2, 3, 4 or 5. The different arcs of the network represent pipelines of different diameters. The maximum quantity of gas that can be pumped (per hour) through each arc is show on Figure 4.1. Determine the maximum quantity of gas that can be sent from O to T through this network. Application of Ford-Fulkerson algorithm: Step 1 : Consider the following initial solution : S1 = 13 = 2, S3 = 3, 34 = 1, 4T = 1, 35 = 5T = 4 Label node S with (*) and go to step 2. Step 2 : beginning from node S, consider all arcs : (S, 1) and (S, 3) are are forward and saturated; (S, 4) is not saturated and is not labeled; label node 4 with (+S).
+S 4 1 3 2 (2) 1 (3) 2 (1) -4 3 (2) 1 1 2 4 (1) 2 1 2 3 +3 (1) +4 5 (4) 5 +2
T
2 *
S
-3
Figure 4.2 : Application of Ford-Fulkerson algorithm Node 4 : arc (4, 5) unsaturated and 5 unlabeled; label node 5 with (+4). arc (4, T) saturated. arc (3, 4) is backward and has a positive flow, label node 3 with (4). Node 3 : arc (3, 2) unsaturated and 2 unlabeled; label node 2 with (+3). arc (1, 3) has a positive flow , label node 1 with (3). Node 1 : arc (1, 2) with 2 labeled; Node 2 : arc (2, T) unsaturated and T unlabeled; label node T with (+2). 25
OPTIMIZATION
3A GI
T is labeled; therefore, there is a breakthrough: it is possible to increase the flow. Go to step 3. Step 3 : The FC can be identified by starting from T and going backward: (O, 4), (3, 4), (3, 2), (2, T). = min {2,1,2,3} = 1 . Subtract 1 unit from the flow on (3, 4) and add it to the flow of the remaining forward arcs to obtain the new solution: S1 = 2, 13 = 2, S3 = 3, S4 = 1, 4T = 1, 35 = 5T = 4, 32 = 2T = 1 Erase all labels and go to step 1. Step 1: Label node S with (*) and go to step 2. Step 2 : (S, 1) and (S, 3) are saturated; (S, 4) is an saturated and unlabeled; label node 4 with (+S). Node 4 : arc (4, 5) unsaturated and 5 unlabeled; indicate (+4) on node 5. arc (4, T) saturated. arc (3, 4) has a zero flow. Node 5 : arc (5, T) unsaturated and T unlabeled; indicate (+5) on node T. It is possible to increase the flow since node T is labeled. Go to step 3. Step 3 : The FC is : (S, 4), (4, 5), (5, T) and =1; add 1 unit to flow on forward arcs to obtain the following solution: S1 = 2, 13 = 2, S3 = 3, S4 = 2, 45 = 1, 4T = 1, 35 = 4, 5T = 5, 32 = 2T = 1 Erase the labels and go to step 1. Step 1 : Label node S with (*) and go to step 2. Step 2 : Starting from node S, no node can be labeled since all arcs are saturated. Hence, node T cannot be labeled. The current solution is then optimal, with a flow value equal to 7.
26
OPTIMIZATION
3A GI
uA!
Since all nodes satisfy the flow conservation equation, then + (X) +
uA!
=-(X) +
uA!
+ (X) = -(X)
27
OPTIMIZATION
3A GI
Lemma 3.1: The value of any flow is less than or equal to the capacity of any cut: and (X, Xc) separating S and T, we have v() C(X, Xc) Proof: Taking into account the reverse arc: +(X) = -(X) = Then, 0 = v() = 1(X) c
u + 0
u 1(X) C(X, X )
As a consequence, the capacity of a cut represents a lower bound on the maximum The maximum flow minimum cut theorem: The maximum value among feasible flow vectors is equal to the minimum capacity of cuts separating S and T : maxfeasible v() = mincuts (X, Xc) C(X, Xc) One consequence of this theorem is that the Ford-Fulkerson algorithm simultaneously finds the maximum value flow and the mimum capacity cut.
The network is then denoted by G = (N, A, L, C). Here, the problem of finding a feasible flow is not as obvious as before. To find the maximum value flow, we apply two phases : Phase I : Find a compatible flow (if it exists) Phase II : Solve for the maximum value flow (for example, by applying an adaptation of Ford-Fulkerson) 3.5.1 Phase I Let L+(i) = j(i) lij : Sum of lower bounds of arcs incident out of i;
28
OPTIMIZATION
3A GI
L-(i) = j1 (i) l ji : Sum of lower bounds of arcs incident into i; Transform G into a network G' having zero lower bounds in order to find an initial compatible flow for G. This is achieved by applying the following : Add the reverse arc (T, S) having a capacity = Replace the capacity cij by cij = cij - lij Add a dummy source S and a dummy sink T For each i such that L+(i) >0, add the arc (i, T) of capacity L+(i) For each i such that L-(i), add the arc (S,i) of capacity L-(i)
Theorem 3.2 There exists a compatible flow vector for G iff G the maximum value flow vector ' of G has a value L+(S) = L-(T). This means that ' saturates the arcs incident out of S and those incident into T. In addition, for each arc (i, j) of G, we have: ij = 'ij + lij
3.5.2 Phase II Once a compatible flow vector is found, Ford-Fulkerson algorithm can be applied with a slight modification: backward arcs are labeled if ji > lji and is computed based on the difference (ji - lji) The rest of the algorithm remains the same. Example:
(1,5)
S
(1,6)
(0,7)
(1,1)
29
OPTIMIZATION
3A GI
+S (2) 2 4 2 (2)
S
(1)
(2) +3
+T
7 (4) 2 +S
(3)
+2
c uA u u
Hence, the minimum cost flow problem consists in: Finding, among maximum value flows, a feasible flow that minimizes total cost. Or, Find the minimum cost way of transporting a flow of a fixed value v. In this case, if v > maximum value flow, the problem is infeasible.
30