A Distributed Algorithm for the Maximum Flow Problem

A Distributed Algorithm for the Maximum Flow Problem Thuy Lien PHAM∗ , Ivan LAVALLEE+ , Marc BUI+ and Si Hoang DO∗ Laboratoire de Recherche en Informa...
Author: Leon Hicks
16 downloads 2 Views 275KB Size
A Distributed Algorithm for the Maximum Flow Problem Thuy Lien PHAM∗ , Ivan LAVALLEE+ , Marc BUI+ and Si Hoang DO∗ Laboratoire de Recherche en Informatique Avanc´ee Universit´e Paris 8 41 rue Gay Lussac, 75005 Paris, France ∗ {ptlien, sihoang}@free.fr + {marc.bui, lavallee}@univ-paris8.fr Abstract This paper presents an asynchronous distributed algorithm for solving the maximum flow problem which is based on the preflow-push approach of Golberg-Tarjan. Each node in graph initially knows the capacities of outgoing and incoming adjacent arcs, the source nodes knows additionally the number of nodes in graph. Nodes execute the same algorithm, and exchange messages with neighbors until the maximum flow is established. The algorithm is applicable in cases of multiple sources and/or targets. We give also here some ideas to adjust our algorithm to dynamic changes of arc capacities. For a graph of n nodes and m arcs, our algorithm takes O(n2 m) message complexity and O(n2 ) time complexity.

1

Introduction

We consider a network which is a connected directed graph with a positive capacity function on arcs and two distinguished nodes called source and sink. We can see each arc in the network as a canal which conduits a fluid and the capacity of each arc is capacity-carrying of that canal. Then the fluid flows in the network such that the amount of fluid in each canal does not exceed the capacity of that arc. The maximum flow problem then responses to the question: how to maximize the quantity of fluid that could flow from the source to the sink. The maximum flow problem is a classical optimization problem with many applications such as transportation problem, scheduling problem, etc. Recently, it has been applied in some new domains, such as coding network [1] and wireless ad hoc networks [5]. The fundamental algorithmic techniques for solving the problem are presented in [11], [9], [17], [12], [14] and [15]. On other hand, there have been a number of survey papers and books on theoretical

and experimental analysis of algorithms. See e.g. [10], [2], [6], [7], [18], [8], [3]. In general there are two principal categories for solving the maximum problem: the labelling Fork-Fulkerson’s method [11] and the preflow-push method that was introduced by Golberg-Tarjan [15] who takes the original idea of pref low from Karzanov [17]. The labelling method increases flow along augmenting paths from the source node to the sink node. The idea of preflow-push algorithm is to seek-out the shortest paths as in the labelling method, but do not send flow along paths from the source to the sink. Instead, it processes excesses at nodes: nodes send flows on individuals arcs based on the knowledge it has about itself and its neighbors. This algorithm of Goldberg-Tarjan makes decisions locally and hence, is suitable for a distributed version in the asynchronous network. See [13] for a detail comparison about the complexity of existed algorithms. There are two synchronous distributed algorithms presented in [4] that based on the first approach to find the maximum flow with O(n3 ) message complexity and O(n2 ) time complexity, where n is the number of nodes in network. In applying synchronizer technique to that algorithm, an asynchronous algorithm has proposed with message complexity and time complexity is respectively O(kn3 ) and O(n2 logn/logk) where k is an integer, 2 < k < |N |. Takkula [20] has proposed an asynchronous algorithm using second approach but which is not efficient on both number of exchanged messages and execution times. In this paper, we describe an asynchronous distributed algorithm which determines the maximum flow of network based on the second approach. We consider the graph as a network with bidirectional communication links. We assume each node initially knows the capacities of outgoing arcs and incoming arc incident to it, moreover source node knows the number of nodes in graph. In this network, each node executes the same local algorithm, which consists of sending messages over adjacent links or waiting for incoming messages to process them.

Proceedings of the 4th International Symposium on Parallel and Distributed Computing (ISPDC’05) 0-7695-2434-6/05 $20.00 © 2005

IEEE

• If 0 < f (e) < cap(e): e is also an arc in Ef with capacity r(e) = c(e) − f (e). Add another arc erev in reverse direction of e with capacity r(erev ) = f (e) into Ef .

Our algorithm is derived to cases of multiple sources and/or sinks without any changes. During the execution of algorithm, the total number of messages being exchanged is bounded by 2n2 m + 7nm + 7n2 /2 − 5n/2. This estimate can be still ameliorated. For a measure of timing cost, our algorithm takes O(n2 ) time complexity. This paper is organized as follows. In Section 2, we briefly introduce the maximum flow problem and GoldbergTarjan technique. In Section 3, we describe our distributed algorithm and give its correctness proof. A complexity analysis of algorithm is presented in Section 4 and a suggestion for an adaptative algorithm is given in Section 5. Concluding remarks are given in Section 6.

• If f (e) = cap(e): e is not in Ef but an arc erev in reverse direction of e with the capacity r(erev ) = cap(e) is added into Ef . Any residual arc (u, v) ∈ Ef has capacity r(u, v) > 0; i.e., any arc in Gf can admit more flow. An example of a residual network is shown in the figure 1. a

2

Review of maximum flow problem

2.1

s 5.4

(u,v)∈E

1

8.6 4

2

b

6

Gf

Figure 1. Example of residual network

The mean of residual network is: once it exists a path from s to t in Gf then we can add to the flow a positive value of flow equal the minimum capacity of arcs along the path. When it does not exist such path, the flow is maximal. If Dinic [8], Karzanov [9] and other researchers give algorithms based on techniques of finding such paths and sending flows along, then Goldberg-Tarjan solution explores residual network and relies on processing excesses at nodes. We will describe the later trend in the following subsection as it is fundamental for our distributed algorithm.

f (v, w)

(v,w)∈E

2.2

f = excess(t)

Golberg-Tarjan’s preflow-push algorithm

By a relaxion on flow conservation constraints that no node in V \{s, t} has negative excess, Karzanov has induced notion of preflow. A preflow f is a function f : E → R≥0 with:

The maximum flow problem is then to find a flow of maximal value. Residual graph The residual network is actually network of remaining capacities on arcs. A residual network of G induced by a flow f , called Gf = (V, Ef ), has the same nodes as G, but for an arc e ∈ E it may have two arcs e and erev in Ef :

• 0 ≤ f (e) ≤ cap(e), ∀e ∈ E • excess(v) ≥ 0, ∀v ∈ V \ {s, t} A node is active if its excess is positive. Let v is a node active, e(v, u) is a residual arc out of v. A push of δ = min{excess(v), r(e)} across e then sends δ unit flow from v to u. It increases excess(u) by δ and

• If f (e) = 0: e is also an arc in Ef with capacity r(e) = c(e). 2

Proceedings of the 4th International Symposium on Parallel and Distributed Computing (ISPDC’05)

IEEE

t

2

A flow f

the excess of v. It is the difference between the total flow into v and the total flow out of v. Flow conservation constraint states that all nodes except for s and t have zero excess. The value of a flow f is excess of the sink, i.e.,

0-7695-2434-6/05 $20.00 © 2005

3

s

b

1. 0 < f (e) ≤ cap(e), ∀e ∈ E - capacity constraints ! ! 2. (u,v)∈E f (u, v) = (v,w)∈E f (v, w), ∀v ∈ V \ {s, t} - flow conservation constraints "

1

4

t

2.2

The maximum flow problem Consider a network G with V the set of nodes, E the set of arcs, the source node s and the sink node t. Let’s n = |V |, m = |E|. For each directed arc e of G, there is an associated capacity, denoted cap(e), with cap(e) > 0. A flow is a function f : E → R≥0 satisfying following constraints:

For a node v, we call " f (u, v) − excess(v) =

4.1

7.3

Terms and notations

a

3

execution of algorithm. Communications are in message passing mode. In the sections below, we will describe how the algorithm operates in a global manner. Then, we will describe the local algorithm that each node must execute in order to obtain the ending result.

decreases excess(v) by δ. If e is an arc of G, a push across e increases the flow across e by δ and a push across eren decreases the flow across e by δ. A push is called saturating if δ = r(e) and is called nonsaturating otherwise. In fact, a saturating push across e ∈ Gf will remove e from the residual network, and a nonsaturating push always adds erev to the residual network. Now the question is how to push excess at a node? Goldberg and Tarjan suggest to put nodes of Gf at different heights such that the source node initially is at top height, the sink node is at buttom, the others initially have heights to be the lower bound on distance (on the number of arcs in path) from that node to the sink. A push is performed only from the node with higher node to a lower node. An arc e = (v, u) is admissible for v if heightu < heightv . The algorithm of Goldberg-Tarjan proceeds a loop as follows: select an active node v ∈ Gf , and then select an arbitrary admissible arc e ∈ Gf of v to push δ unit flow across (source node is initially active). If there is no more admissible arc but the node is still active then lift that node to create new admissible arc and continue to push. This loop is repeated until there is no active node remains.

3.1

The execution of our algorithm proceeds in two phases: (1) Initialization of node heights Suppose that the source node knows the number of nodes in the graph, n. This phase will set the sink’s height to 0 and the source’s height to n. The height of other nodes is calculated in breadth first search way. To start, a wave of init messages is sent from sink node: the sink node scans its adjacency arcs and messages carried the height tag set to zero are transmitted across. When a init message arrives at a node, first the node’s height is checked. If node’s height is zero (for the first time it is set) or is greater than or equal to the height tag of message then it is updated to message’s height tag plus one. Once node’s height is updated, the node will propagate init messages to neighbor nodes over its incoming arcs, it sends also messages to inform its new height to neighbor nodes over its outgoing arcs. When the last init message reaches the source node, the source node will set his excess enough to saturate its outgoing arcs, and algorithm goes through the following second phase. (2) The excess is pushed from the source downhill towards the sink In this phase, we maintain the rule that a push is performed only from the heigher node to a lower node. The receipt of the last init message at source node invokes a procedure which allows to push its excess to neighbors. For source node, this procedure realizes saturating its outgoing arcs. When flow arrive to a node, it makes node’s excess positive, then this node will execute the same procedure above to transmit its excess to downhill neighbors. This procedure scans admissible arcs and try to push as much flow as possible across. When the node has no downhill neighbors, i.e. there is no more admissible arc, flow becomes trapped locally at node. At this moment, we must lift the node, and one more time the flow is transmitted. There is a difference between our choice with sequential push-preflow algorithm of Golberg-Tarjan which responses to the following question: how much we should move node upward ? Because a node, after lifting to create a new admissible arc and push its own excess across the correspondent link, will continue to lift if its excess remains positive. So we will increase height of node to a threshold that is just enough for the node can push all of his remaining excess. This accelerates algorithm’s execution. To seek this thresh-

Algorithm preflow-push begin /*Initialisation*/ heights := |V |, heightt := 0 compute the exact distances heightv , ∀v ∈ G − {s, t} forall arcs e incident to s do saturate e /*main loop*/ while the network contains an active node do select an active node v push − lif t(v) end Procedure Push-lift(v) begin if the network contains an admissible arc (v,w) then push min{excess(v), rcap(v,w))} units of flow from v to w else set heightv = min{heightw +1: r(v,w)) > 0 } end

3

Global description

Our distributed algorithm

For a distributed version of this algorithm, our computing model is as follows. We allow each node of network to have a process. This process can communicate directly with other processes at all neighboring nodes via bidirectional communication links. In our asynchrounous model, each process runs the same local algorithm over local data and may start executing the algorithm either at any arbitrary moment or upon receiving a message which triggers their 3

Proceedings of the 4th International Symposium on Parallel and Distributed Computing (ISPDC’05) 0-7695-2434-6/05 $20.00 © 2005

IEEE

its state (except if it is SINK node) and capacity of correspondent link. If it is not SINK type node, it will call routine push to push the new value of excess, and if this routine terminates but it still has excess then the procedure lif t() will be invoked. The processing of PUSH-REQUEST messages is detailed in algorithm block 8.

old fast, for each node we can maintain a list of neighbor heights in increasing order. As we are in an asynchronous distributed network, there are some times when a node wants to transmit flow to another node which is lifting with his new height is greater than itself. This happens only when a node receives a push from a lower sender, i.e. the sender has not updated his new height yet. Then it must reply a non-successful message (which denotes that push is not permitted) to the sender in order to tell the sender to retire sent flow. Eventually, no more flow can reach the sink. As we continue to move nodes upward, the remaining excess flow eventually flows back towards the source. The algorithm will terminate when all flows either are pushed into the sink or returned to the source.

3.2

About the sender of PUSH-REQUEST message, upon receipt of an answer (PUSH-REQUEST-ANS, value−to− send, NOK) (see algorithm block 9) it recovers his transmitted flow by adding its excess to value − to − send, resets state and updates capacity of correspondent link, calls routine push and also lif t if it remains excess but has no admissible link. Another type of messages is (NEW-HEIGHT, l). We use these messages for updating a new height of sender during the first step or every time when this sender change his height. Upon receipt of this message, the receiver updates sender’s height in the list of neighbor’s heights. Note that we can maintain the list of neighbor nodes in increasing order of node heights. This helps to determine quickly the local variable height in algorithm block 10.

Detail description

Nodes. Node v maintains the variables as indicated in Algorithm 1, including the value of excess flow at that node excessv ; its current height heightv ; a list of neighbor nodes neighborlistv with their current distance labels heightv [u], ∀u ∈ neighborlistv and respective residual capacities of residual arcs incident to these neighbor nodes rv [u], ∀u ∈ neighborlist - if there is no residual arc of extreme v incident to a neighbor u, the correspond residual capacity rv [w] is zero. Node v has also a variable typev that denotes what kind it is. We define three possible kinds of nodes in the network: the SOU RCE, the SIN K, and the N ORM AL nodes. In addition each node has two variables as counters: variable nbInitheightM sgs which counts the number of received init messages at SOU CE nodes. Finally, a node has a state variable statev . Node states. There are two possible node states: the state inactive while the excess of node is zero and has no messages waiting, and the state active at other times. Initially, all nodes are in the inactive state. The sink node is always in inactive state. In the beginning of second phase, the source node is in the active state with excess set to sum of all outgoing arc weights. Messages. Messages (INIT-HEIGHT, l) is used in the first step, where l is sender’s height. On receiving this message, the receiver will enter to algorithm 5 in which you can see the propagation of this messages. If receiver is SOU RCE, the last INIT-HEIGHT message makes it becomes active and procedure push is invoked. This type of messages will not be used any longer. Messages (PUSH-REQUEST, value−to−send) is used in the routine push. By receiving this message, the node checks the sender’s height. If this value is less than or equal itself, it will send an answer message (PUSH-REQUESTANS, value − to − send, NOK) back to sender. Otherwise, it accepts this pushed value of flow; updates its own excess,

init-height(). This procedure propagates the (INITHEIGHT, heightv ) messages to incoming arcs of v, and update its height in local data of nodes over its outgoing arcs by sending (NEW-HEIGHT, heightv ) messages to them. push(). This routine is deal with algorithm block 7. When a node receives any message that makes its excess positive, except SINK nodes, it becomes active and executes the routine push. This routine implement sending as much flow as possible to nodes that it can push to (residual capacity of correspondent link is positive) and are lower than it. Fist, the node will scan and select arbitrarily such a admissible neighbor node if it exists, and sends a PUSHREQUEST message with a value of flow set to minimum of his excess and residual capacity of link to it. The node also updates immediately his local variables such as value of excess, residual capacity of correspondent link. Once it exists an admissible neighbor node and value of excess is positive, the node continue to push as above, and if one of these conditions does not hold, the routine at node is stopped. lift. This procedure is called when the routine push() has terminated but the node remains a positive excess. The node first calculate a new height such that just with this height it can send all of his remaining excess. After lifting, the node sends NEW-HEIGHT messages to all his neighbors for updating its new height (see algorithm block 10). When all nodes (except SOURCE nodes) are in state inactive, this means there are no more messages have been changed, the algorithm terminates. 4

Proceedings of the 4th International Symposium on Parallel and Distributed Computing (ISPDC’05) 0-7695-2434-6/05 $20.00 © 2005

IEEE

5 : Upon receipt of (INIT-HEIGHT, h) from w heightv [w] = h; if typev '= SOU RCE then if (heightv = 0)||(heightv >(h + 1)) then heightv = h + 1; init − height(); end if else nbInitHeightM sgsv = nbInitHeightM sgsv + 1; if nbInitHeightM sgsv = number of outgoing arcs of v then heightv = |V !| excessv = u∈neighborlistv rv [u]; statev = active; push(); end if end if

1 : Node’s variables typev : (SOURCE, SINK, NORMAL) statev : (inactive, active) excessv : real; heightv : integer; neighborlistv : list of neighbors; heightv [u], ∀u ∈ neighborlistv : interger; rv [u], ∀u ∈ neighborlistv : real; nbInitHeightM sgs: integer;

2 : The Algorithm (as executed at each node) /*As the first action of each process at node, the algorithm must be initialized */ initializaton(); /* main loop */ while (true) do wait for incoming messages msg; process msg; end while

6 : Upon receipt of (NEW-HEIGHT, h) msg from w heightv [w] = h;

7 : push() if typev '= SIN K then while (excessv > 0) && (∃u ∈ neighborlistv such that (rv [u] > 0) && (heightv [u] < heightv )) do δ = min{excessv , rv [u]} ; excessv = excessv - δ; rv [u] = rv [u] − δ; Send (PUSH-REQUEST, δ) to u; end while end if

3 : initialization() excessv = 0; statev = inactive; heightv = 0; for all u ∈ neighborlistv do if (u, v) is an incoming arc into v in G then rv [u] = 0; else rv [u] = weight of (v, u); end if heightv [u] = 0; end for nbInitHeightM sgs = 0; if typev = SIN K then init − height(); end if

8 : Upon receipt of (PUSH-REQUEST, δ) msg from w if heightv [w] > heightv then rv [w] = rv [w] + δ; if (statev = inactive)&&(typev '= SIN K) then statev = active; end if excessv = excessv + δ; if typev '= SIN K then push(); if excessv > 0 then lif t(); end if end if else Send (PUSH-REQUEST-ANS, δ, NOK) to w; end if

4 : init-height() for all u ∈ neighborlistv do if rv [u] = 0 then Send (INIT-HEIGHT, heightv ) to u; else Send (NEW-HEIGHT, heightv ) to u; end if end for

5 Proceedings of the 4th International Symposium on Parallel and Distributed Computing (ISPDC’05) 0-7695-2434-6/05 $20.00 © 2005

IEEE

9 : Upon receipt of (PUSH-REQUEST-ANS , δ, N OK) msg from w excessv = excessv + δ; statev = active; rv [w] = rv [w] + δ; push(); if excessv > 0 then lif t(); end if

cost analysis in section below) each node updates its height only one time, this number of messages is exactly 2m. To estimate the upper bound on the number of messages exchanged during second phase of algorithm, we use results in following lemmas. Lemma 1. The height of any node is bounded by 2n-1, where n = |V |. Proof. During the execution of algorithm, when a node v lifts, it is moved upward to a threshold h just enough for v can push all its remaining excess. Then there are two cases: case 1. For admissible nodes u that heightu < h − 1: 10 : lift() pushes from v to u will saturate links (v, u) in network, i.e. if (typev '= SOU RCE)&&(type = ' SIN K) then v ! height = min{h| u∈neighborlistv :heightv [u]≤l rv [u] ≥ flow sent across (v, u) is δ = rv [u]. Such a push is called saturating (and non-saturating otherwise). Then after these excessv } pushes, there are no more such positive capacity link (v, u). heightv = height + 1; case 2. For admissible nodes u that heightu = h − for all u ∈ neighborlistv do 1: pushes from v to u can saturate (v, u) or not, i.e. we Send (NEW-HEIGHT, heightv ) to u; can have two positive capacity links (v, u) and (u, v) after end for these pushes, but we have a constraint that is heightv = push(); height + 1. u end if In brief, after lifting and discharging v’s remaining excess, there exists no more positive capacity link (v, u) from v such that h = heightv > heightu + 1, i.e. it doesn’t 3.3 Termination and correctness proof of exists any outgoing arcs (v, u) from v in residual network the algorithm such that heightv > heightu + 1. As source nodes do not change its height n, height of any node v is bounded by the The algorithm will terminate because the number of longest length (on number of arcs) of any path from v to s messages exchanged is bounded. We will analyze and dein the residual network, i.e. heightv < 2n. termine this upper bound in the following section. This type Lemme 1 implies that total number of lifts of a node does of termination is said ”message termination”. not exceed 2n. When this node lifts, across a link from When the algorithm terminates, there are no active nodes it there is a NEW-HEIGHT message transmitted. So total except the sources. Since source level is always equal to n, of NEW-HEIGHT messages across this link during second the residual network at this time contains no path from the phase of execution of algorithm does not exceed 4n. This source to the sink, so the flow is maximum. implicates total of NEW-HEIGHT messages across all links during second phase does not exceed 4mn. 4 Complexity analysis Lemma 2.There are at most 3n2 /2 − 5n/2 lifts and at most nm saturating pushes during the execution of algo4.1 Communication cost rithm. Proof. Using result of Lemma 1, and as there are no arcs (v, u) such that heightv > heightu + 1 in residual We first determine the total number of messages using in network, so the sum of node heights in network is bounded the first phase of initializing nodes’ heights. A node once by (n + 1) + (n + 2) + ... + (2n − 1) = 3n(n − 1)/2. In found another path to sink which is shorter than its current the beginning of second phase, this sum is at least n, so it path (the distance is represented by its height), it will upincreases by at most 3n(n−1)/2−n = 3n2 /2−5n/2. Each date its height and call init-height(). Then across time when a node lifts, its height increases by at least one each link from this node, there is one message is transmitunit. So the total number of lifts called during the execution ted: either INIT-HEIGHT message over incoming arcs into of algorithm do not exceed 3n2 /2 − 5n/2. node, or NEW-HEIGHT message over outgoing arcs from node. So total number of messages transmitted across this Now we consider an arc (v, u) ∈ G . For a satulink is equal to number of height updatings of both its two rating push across link (v, u), it must have heightv ≥ extremities. As a node updates its height whenever one of heightu + 1, and for a saturating push across link (u, v) neighbors over its ougoing arcs changes height. This imit must have heightu ≥ heightv + 1. As heightv and plies that total number of messages in the first phase is less heightu are inferior to 2n, so number of saturating pushes than 2mn. In a perfect system (see assumptions of timing across a link (vu) do not exceed n. This implies that the 6

Proceedings of the 4th International Symposium on Parallel and Distributed Computing (ISPDC’05) 0-7695-2434-6/05 $20.00 © 2005

IEEE

pulses of the algorithm. A pulse may actually be considered as the equivalent of a (global) clock pulse, or simultaneous clocks’ ticks in a synchronous distributed system. During each pulse of the algorithm, nodes receive messages, perform local computation, and send messages destined to be received at the beginning of the next pulse. Lemma 4.The maximum number of pulses of algorithm is at most n + 2n2 . Proof Number of pulses for the last init message propagated from sinks to sources is at most equal to the longest path from sources to sinks. So the number of pulse in this phase of algorithm execution is less than n. Now we consider number of pulses in the phase of pushing flow from sources downhill towards the sinks. A value of flow is pushed from source to sink, if it is not trapped at any node, it is transmitted straight toward sink. And the number of pulses for this is the length of path (on number of arcs) on which it is flowed across. This number is less than n. Consider if that value of flow is trapped at a node then this make a increase of node’s level. So the number of pulses that assures a value of flow either pushed to sink or returned to source, is at most equal to the total number of changing-level of all nodes on the longest path from source to sink, hence is less than 2n2 , proving the lemma. The time complexity of algorithm is measured with at most the maximum number of pulses of algorithm execution, that is O(n2 ).

total of saturating pushes is at most nm. Lemma 3.The algorithm performs at most 2n2 (1 + m) non-saturating pushes. Proof The principle to prove lemma given here is due to [KMO93]. Let A denote ! the set of active nodes. Consider a potential function φ = v∈A heightv . Initially, φ = 0. During the execution of algorithm there are two possible cases: case 1. A node v wants to push his excess but there are no admissible link. In this case its height increase by # ≥ 1 units. So φ is increased at most # unit. Since heightv < 2n, the total increase in φ due to changing height is bounded by 2n2 . case 2. There is an admissible link for node to push flow across. This push is either saturating push or non-saturating push. A saturating push on link (v, u) may create a new excess at node u, node u becomes active, and therefor increasing φ by heightu which is bounded by 2n. According to the result of lemma 2, the number of saturating push do not excess nm, so φ can increase 2n2 m over all saturating pushes. A non-saturating push across link (v, u) will deactivate v and may or may not activate u. Thus φ decreases by heightv but may increases by heightu = (heightv − 1). In either case, φ decreases by at least one unit per nonsaturating push. Finally, the total increase of φ is at most 2n2 + 2n2 m. Each non-saturating push decreases φ by at least one unit and at the end φ is zero. Consequently, the algorithm can perform 2n2 + 2n2 m = 2n2 (m + 1) non-saturating pushes, proving the lemma. Lemma 2 and 3 implies that the total pushes either saturating or non-saturating is bounded by nm + 2n2 + 2n2 m. Supposing that all these pushes is successful, we now estimate the total number of non-successful pushes. A push can be refused only when the receiver lifts (but the sender is out of date). As there are at most 3n2 /2 − 5n/2 lifts, so at most 3n2 /2 − 5n/2 non-successful pushes. A nonsuccessful push needs a non-successful message. This implies that total number of messages being exchanged over all pushes, either saturating or non-saturating, and nonsuccessful, is at most (3n2 /2−5n/2+nm+2n2 +2n2 m) = 2n2 m + 7n2 /2 + nm − 5n/2. These messages are PUSHREQUESTs and PUSH-REQUEST-ANS(NOK)s. To summarize, the total number of messages used in algorithm is bounded by 2mn+4mn+2n2 m+7n2 /2+nm− 5n/2 = 2n2 m+7nm+7n2 /2−5n/2 that is correspondent to O(n2 m).

4.2

5 Adaptative algorithm We give here some ideas to adapt our algorithm to changes of arc capacities. (but not insertions of nodes - that means the network is not dynamic in sense of number of nodes). We consider two cases: (1) Increasing of an arc If this arc is non-saturated, i.e. there was no more flow would be transmitted across, then this change of capacity can not increase the current flow. Otherwise, the current flow can be increased. We must inform this change to remaining active nodes in the network. To do this, first the source of this arc will take its initial height and after, INCREASING messages will be sent to neighbors over its incoming arcs. When a node receives this message, it will do: • Check itself if it is a saturated node. We define here a saturated node if either it can not admid no more of flow (all incoming arcs are saturated) or it can not send any flow (all outgoing arcs are saturated). In this case, the node do nothing.

Timing cost

• Otherwise, the node takes its initial height, propagates INCREASING messages to neighbors over its incoming arcs.

As for the notion of time, we assume that all message delay times are bounded and equal. The distributed asynchronous algorithm is analyzed using the virtual notion of 7

Proceedings of the 4th International Symposium on Parallel and Distributed Computing (ISPDC’05) 0-7695-2434-6/05 $20.00 © 2005

IEEE

By descending nodes when propagating these messages, we assure that if a INCREASING message arrives to an active node (including source node), its remaining excess can be pushed normally towards the sink as in algorithm above. (2) Decreasing of an arc After decreasing an arc, there are two possible cases:

[2] R. K. Ahuja, T. L. Magnanti, and J. B. Orlin. Network Flows - Theory, Algorithms and Applications. Prentice-Hall, Inc. USA, 1993. [3] R. J. Anderson and J. C. Setubal. On the parallel implementation of goldberg’s maximum flow algorithm. Proc. of the 4th Annual ACM Symp. on Parallel Algorithms and Architectures, pages 168–177, 1992. [4] V. C. Barbosa. An introduction to distributed algorithmes. The MIT Press, 1996. [5] A. Bogdanov, E. Maneva, and S. Riesenfeld. Power-aware base station positioning. Proceedings of IEEE INFOCOM, 2004. [6] J. Cheriyan and T. Hagerup. A randomized maximum flow algorithm. SIAM Journal on Computing, 24:203–226, 1995. [7] J. Cheriyan and K.Mehlhorn. An analysis of the highestlevel selection rule in the preflow-push max-flow algorithm. Information Processing Letters, 69:239–242, 1999. [8] B. V. Cherkassky and A. V. Goldberg. On implementing push-relabel method for the maximum flow problem. Algorithmica, 19:390–410, 1997. [9] Dinitz. Algorithm for solution of a problem in networks with power estimation. Soviet Mathematics Doklady, 11:1277– 1280, 1970. [10] J. Edmonds and R. M. Karp. Theoretical improvements in algorithmic efficiency for network flow problems. Journal of ACM, 19(2):248–264, 1972. [11] L. Ford and D. Fulkerson. Flow in networks. Princeton University Press, Princeton, 1962. [12] H. N. Gabow. Scaling algorithms for network problems. Journal of Computer and System Sciences, 31(2):148–168, 1985. [13] A. V. Goldberg. Recent developments in maximum flow algorithms. Technical report, NEC Research Institute, Inc., April 1998. [14] A. V. Goldberg and S. Rao. Bayond the flow decomposition barrier. Journal of ACM, 45(5):783–797, 1998. [15] A. V. Goldberg and R. E. Tarjan. A new approach to the maximum flow problem. Journal of ACM, 35(4):921–940, 1988. [16] L. Ivan. Systematic building of a distributed recurive algorithm, example the shortest path algorithm. Acta Mathematica Viˆetnamica, 1(20):3–30, 1995. [17] Karzanov. Determining the maximum flow in a network by the method of preflows. Soviet Mathematics Doklady, 15:434–437, 1974. [18] V. King, S. Rao, and R. Tarjan. A faster deterministic maximum flow algorithm. Journal of Algorithms, 17(3):447–474, 1994. [19] N. Nagy and S. G. Akl. The maximum flow problem : A real-time approach. Technical report, Dept. of Computing and Information Sciences Queen’s Univ., Canada, 2001. [20] T. Takkula. A preflow-push algorithm that handles online max flow problems in a static asynchronous network (revision 1.18). Technical report, Chalmers University of Technology, Gothenbourg, Sweden, 2001.

• The arc remains non-saturated. This means the current flow is not affected by this change. We do nothing in this case. • Otherwise, the flow on this arc must be retired. Suppose that we must retire x units of flow. Then we will do: - add x units of flow to excess of the source of this arc . This node becomes active if it was not, and push or lift as in the algorithm above. - retire x units of flow on outgoing arcs of the target of this arc. To do this, we suggest to chose some arbitrary outgoing arcs such that the sum of flow on these arcs is superior or equal to x. We decrease flows on these arcs recursively untill reaching the sink. For each node on trace, we descend its height to its orriginal value as in the case of increasing an arc, to assure that x units of flow will be pushed towards the sink by other paths if it would be done. For re-establishing a new maximal flow after changing arc capacities, the complexity in the worst case is the same as the case of recalculate it. But intuitively it is much faster because we don’t need touch all nodes in network if it is not neccessary.

6

Conclusion and further work

The estimate of message complexity can be still reduced. An amortized analysis on the numbers of pushes and on the number of level changes should give a better bound. On the other side, we can use heuristics in lifting nodes to improve algorithm’s complexity, both communication cost and timing cost. We have not yet given a complete adaptative algorithm in this paper, but we hope that we can give it in the early future. This algorithm can be developped for the minimum cost flow with the same principle. In the future we will improve this algorithm in order to adapt to the real-time flow problem [19].

References [1] R. Ahlswede, N. Cai, S.-Y. R. Li, and R. W. Yeung. Network information flow. IEEE Trans. on Information Theory, 46:1204–1216, 2000.

8 Proceedings of the 4th International Symposium on Parallel and Distributed Computing (ISPDC’05) 0-7695-2434-6/05 $20.00 © 2005

IEEE

Suggest Documents