0% found this document useful (0 votes)
9 views15 pages

A Self-Stabilizing Algorithm For The Maximum Flow Problem.: Distributed Computing July 1997

The document presents a self-stabilizing algorithm for the maximum flow problem in distributed networks. The algorithm can automatically adjust to changes in network topology or other problem parameters. It computes the maximum flow in acyclic networks starting from an arbitrary initial state using only local information. Experimental results show the algorithm performs well and requires fewer than n^2 moves for most test cases.

Uploaded by

rmshewale24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views15 pages

A Self-Stabilizing Algorithm For The Maximum Flow Problem.: Distributed Computing July 1997

The document presents a self-stabilizing algorithm for the maximum flow problem in distributed networks. The algorithm can automatically adjust to changes in network topology or other problem parameters. It computes the maximum flow in acyclic networks starting from an arbitrary initial state using only local information. Experimental results show the algorithm performs well and requires fewer than n^2 moves for most test cases.

Uploaded by

rmshewale24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/220567082

A Self-Stabilizing Algorithm for the Maximum Flow Problem.

Article in Distributed Computing · July 1997


DOI: 10.1007/s004460050034 · Source: DBLP

CITATIONS READS
25 855

3 authors, including:

Sukumar Ghosh
University of Iowa
97 PUBLICATIONS 1,577 CITATIONS

SEE PROFILE

All content following this page was uploaded by Sukumar Ghosh on 17 May 2014.

The user has requested enhancement of the downloaded file.


Distrib. Comput. (1997) 10: 167—180

A self-stabilizing algorithm for the maximum flow problem*


Sukumar Ghosh**, Arobinda Gupta, Sriram V. Pemmaraju
Department of Computer Science, The University of Iowa, Iowa City, IA 52242, USA (e-mail: [ghosh, agupta, sriram]@cs.uiowa.edu)

Received: October 1995 / Accepted: February 1997

Summary. The maximum flow problem is a fundamental applications. For example, linear programming problems
problem in graph theory and combinatorial optimization with a special structure such as transportation and assign-
with a variety of important applications. Known distrib- ment problems can be solved via the maximum flow prob-
uted algorithms for this problem do not tolerate faults or lem (see Bazaraa, Jarvis, and Sherali [6]). Combinatorial
adjust to dynamic changes in network topology. This problems, such as the maximum matching problem, can be
paper presents a distributed self-stabilizing algorithm for reduced to the maximum flow problem [9]. Some of the
the maximum flow problem. Starting from an arbitrary well-known sequential and parallel algorithms for the
state, the algorithm computes the maximum flow in an maximum flow problem are due to Ford and Fulkerson
acyclic network in finitely many steps. Since the algorithm [14], Edmonds and Karp [13], Goldberg and Tarjan [22],
is self-stabilizing, it is inherently tolerant to transient Cheriyan et al. [7], and Shiloach and Vishkin [31]. Ahuja,
faults. It can automatically adjust to topology changes and Magnanti, and Orlin [1] present a survey of some of these
to changes in other parameters of the problem. The paper algorithms. Though many parallel versions of maximum
presents results obtained by extensively experimenting flow algorithms exist, there is no implementation that runs
with the algorithm. Two main observations based on these in polylogarithmic time on a polynomial number of pro-
results are (1) the algorithm requires fewer than n2 moves cessors. Thus the maximum flow problem is not known to
for almost all test cases and (2) the algorithm consistently be in the class NC.
performs at least as well as a distributed implementation of The Goldberg-Tarjan algorithm [22] is based on
the well-known Goldberg-Tarjan algorithm for almost all a method called the preflow-push method. Preflow-push
test cases. The paper ends with the conjecture that the algorithms work in a localized manner as compared to the
algorithm correctly computes a maximum flow even in Ford-Fulkerson or the Edmonds-Karp algorithms. Thus,
networks that contain cycles. distributed algorithms for the maximum flow problem
are based mainly on the Goldberg-Tarjan algorithm.
Key words: Distributed algorithms — Fault-tolerance — Goldberg [21] presents a discussion of some distributed
Self-stabilization — Maximum flow implementations of maximum flow algorithms. However,
all known distributed algorithms for the maximum flow
problem suffer from the fact that they are not fault-tolerant
1 Introduction and cannot adjust to dynamic changes in the network
topology. For example, Awerbuch and Leighton make the
The maximum flow problem is a fundamental problem in following comment [4]:
graph theory and combinatorial optimization. The prob-
lem has been extensively studied for over 35 years and In fact, of the many 1-commodity flow algorithms known,
many data structures and algorithms have been developed only the Goldberg-Tarjan algorithm is implementable in
for it (see Tarjan [32] for an excellent description of data a distributed network, and even there, the algorithm needs
structures and algorithms for the maximum flow problem). to maintain shortest path information and it does not
The motivation for studying the maximum flow problem is tolerate undetectable faults or dynamic changes in the
derived from a variety of interesting and important network structure.

In this paper, we investigate the design of distributed


self-stabilizing algorithms for the maximum flow problem.
* A preliminary version of this paper has appeared in the Inter- Self-stabilizing algorithms converge to a desired state
national Phoenix Conference on Computers and Communications, starting from an arbitrary initial state. Thus, they are
March 1995.
** This author’s research was supported in part by the National inherently tolerant to transient faults that corrupt the
Science Foundation under grant CCR-9402050 system state arbitrarily, as the state of the system after
a fault can be viewed as an arbitrary initial state. In
Correspondence to: S. Ghosh addition, some self-stabilizing algorithms may be capable
168

of adjusting to a dynamically changing topology or to Another drawback is the fact that the technique uses
changes in other parameters of the problem. Distributed global correction, despite the fact that often faults are local
self-stabilizing algorithms were first studied by Dijkstra in nature and can be corrected locally by a few cooperating
[10]. Subsequently, distributed self-stabilizing algorithms processes. A third drawback is that the Awerbuch-
have been designed for a variety of problems, including Varghese algorithm is active. In other words, the algorithm
graph-theoretic problems [8, 11, 15, 23, 24, 26, 25, 27, 28, is not silent [12] and even after the system has reached
29, 33]. Schneider [30] presents a survey of distributed a stable state, processes make state changes. This is a waste
self-stabilizing algorithms. of system resources.
Awerbuch and Varghese [5] present a technique by The above observations motivate our search for
which any synchronous, distributed, non-interactive pro- a simple, passive, distributed self-stabilizing algorithm
tocol can be transformed into an equivalent asynchronous, for the maximum flow problem that uses local checking
self-stabilizing protocol. Since synchronous, distributed and local correction. We take a first step in that direc-
protocols for the maximum-flow problem are known, the tion in this paper by presenting such an algorithm that
technique of Awerbuch and Varghese can be used to computes the maximum flow in an acyclic digraph starting
construct self-stabilizing protocols for the maximum flow in an arbitrary initial state. The algorithm is simple, and
problem. However, the resulting protocols suffer from is easy to understand and implement. In addition to being
several drawbacks. In order to describe these drawbacks, tolerant to transient faults, the algorithm can also
we first present a brief overview of the Awerbuch-Varghese automatically adjust to dynamic changes in network
technique. topology or in edge capacities. In particular, our self-
This technique is based on the notion of a synchronizer stabilizing algorithm can adapt dynamically to (a)
introduced by Awerbuch [3]. Informally, a synchronizer arbitrary addition or deletion of edges in the graph, (b)
can be thought of as a mechanism that generates ‘‘clock addition and deletion of nodes provided that the number
pulses’’ at each process of the network, satisfying the of nodes in the network is within a constant bound known
following property: The pulse number at a process is a priori to all processes, and (c) arbitrary changes in the
incremented only after the process detects that all neigh- capacities of the edges.
bors have reached the previous pulse number. This prop- Our algorithm uses an approach similar to that of
erty ensures that the network behaves in a synchronous Goldberg and Tarjan [22]. We assume that each node in
fashion from the point of view of each process. Accord- G contains a process that asynchronously makes moves
ingly, a process is said to be synchronized if its pulse based on local information only. The moves by a process
number differs from the pulse numbers of its neighbors by update the local state of that process alone. We present
at most 1. extensive experimental results obtained by running our
Awerbuch and Varghese’s technique takes a synchro- algorithm on various classes of digraphs. The results show
nous protocol n and transforms it into a protocol that that our algorithm requires fewer than n2 moves to com-
executes in three phases. In the first phase, called the pute the correct maximum flow starting from an arbitrary
resynchronization phase, the clock pulses at the processes state for almost all test cases. The algorithm requires
are synchronized; there is no execution of the protocol n in fewer than 2n2 moves for all test cases. The results also
this phase. For some appropriately chosen ¹ , if the clock suggest that in practice, our algorithm performs at least as
e
pulse of a process is in the range [0, ¹ !1] then the well as a distributed implementation of Goldberg-Tarjan’s
e
process concludes that it is in the resynchronization phase. algorithm using a random scheduler. The digraphs we
At the end of this phase, all clock pulses are synchronized used were created by generators of test problems for max-
and the next phase, called the execute phase, begins. In this imum flow algorithms obtained from DIMACS.1 Finally,
phase, processes execute the protocol n and also increment we conjecture that our algorithm can compute the max-
their pulse numbers according to the rule stated in the imum flow not just in acyclic digraphs, but in arbitrary
previous paragraph. Suppose that ¹ is the running time of digraphs.
n
n. Each process concludes that it is in the execute phase if The rest of the paper is organized as follows. Section 2
its pulse value is in the range [¹ , ¹ #¹ ]. After the presents a formal definition of the maximum flow problem,
e e n
protocol n has been executed, the third phase, called the and reviews some notions that are key to maximum flow
termination detection phase starts. In this phase, each pro- algorithms. Section 3 describes our model of computation.
cess checks to see if the result it computed by executing n is In Section 4, we present a self-stabilizing algorithm that
equal to the output it currently has. The process corrects solves the maximum flow problem in acyclic digraphs. The
its output if it detects any discrepancy. Nodes are said to proof of correctness of the algorithm is presented in
be in the termination detection phase if their pulse num- Section 5. Section 6 presents experimental results obtained
bers are within the range [¹ #¹ , ¹ #¹ #D], where by running our algorithm and a distributed implementa-
e n e n
D is the diameter of the network. This range gives every tion of the Goldberg-Tarjan algorithm on various classes
process a chance to verify its output before the system of digraphs. Finally, Section contains concluding remarks
returns to the resynchronization phase, and the cycle of and conjectures concerning related open problems.
three phases is restarted.
One of the main drawbacks of the technique described
above is that the details are extremely complicated, and
consequently it is very difficult to implement. Further- 1 Center for Discrete Mathematics and Theoretical Computer
more, Awerbuch and Varghese only partially describe Science, Rutgers University, New Jersey, USA. The generators are
their technique and leave many details to the reader. available via anonymous ftp from dimacs.rutgers.edu
169

2 The maximum flow problem

Let G"(», E) be a simple, directed graph (digraph) with


D » D"n and D E D"e. For convenience, we assume that
G contains no directed cycles of length 2. That is, if (i, j)3E,
then ( j, i) N E. Let s and t be two distinguished nodes in G,
such that s has no incoming edges, and t has no outgoing
edges. The node s is called the source and t the sink in G.
Each edge (i, j)3E has a positive real-valued capacity
C(i, j) associated with it. For convenience, we define Fig. 1. A feasible flow in a graph and the corresponding residual
C(i, j)"0 if (i, j) N E. A flow in G is a real-valued function graph. All edge capacities are 3
f on vertex pairs (i, j)3»]» satisfying:
1. Skew symmetry. For all vertex pairs (i, j), f (i, j)"
!f ( j, i). If f (i, j)'0, we say there is a flow from i to j.
2. Capacity constraint. For all vertex pairs (i, j),
f (i, j)6C(i, j). If (i, j) is an edge such that f (i, j)"C(i, j)
then we say the flow saturates edge (i, j).
The quantity + ( j, i)3E f ( j, i) is called the inflow of node i,
denoted by I (i). Similarly, the quantity + (i, k)3E f (i, k) is
f Fig. 2. A maximum flow in a graph and the corresponding residual
called the outflow of node i, denoted by O (i). A feasible
f graph
flow in G is a flow f that satisfies the additional flow
conservation constraint:
for all i3»!Ms, tN : I (i)"O (i). residual graph contains the directed edge (s, a) with weight
f f
1 (since r(s, a)"1'0), and the directed edge (a, s) with
For any feasible flow f we have that O (s)"I (t). For any
f f weight 2 (since r(a, s)"2'0). The rest of the edges in the
feasible flow f define the value, value( f ), of the flow to residual graph are obtained similarly.
be equal to O (s). The maximum flow problem is to find
f A directed path P in G from s to t is called an
f
a feasible flow f in G, that maximizes value( f ). augmenting path. Let r(P) be the minimum residual capa-
Two notions that are key to all maximum flow algo- city r(i, j) of any edge (i, j) in P. Then the flow f along P can
rithms are residual capacity and residual graph. be ‘‘augmented’’ by r(P). More precisely, define a new flow
Definition 1 For any flow f and for each pair of nodes f @ in G as:
(i, j)3»]», the residual capacity r(i, j) is equal to

G
C(i, j)!f (i, j). f (i, j)#r(P) if (i, j)3P
f @(i, j)" f (i, j)!r(P) if ( j, i)3P
Note that if (i, j)3E then r(i, j) denotes the amount by
which the flow from node i to node j can be increased. If f (i, j) otherwise
( j, i)3E then r(i, j) denotes the amount by which the flow
from node j to node i can be decreased. And if neither (i, j) If is easy to see that f @ is a feasible flow in G with
nor ( j, i) are edges in G, then r(i, j) is equal to 0. value( f @)"value( f )#r(P). Since r(P)'0, value( f @) is
strictly greater than value( f ). Thus, we can construct an
Definition 2 For any flow f in G, the residual graph of algorithm that starting from a known feasible flow (for
G with respect to f is defined as the weighted digraph example, f (i, j)"0 for all (i, j)3»]»), iteratively in-
G "(» , E ), where » "» and (i, j)3E if and only if creases the value of the flow by constructing augmenting
f f f f f
r(i, j)'0. With each edge (i, j) we associate the positive paths. This idea is the essence of both the Ford-Fulkerson
weight r(i, j). and the Edmonds-Karp algorithms. The Ford-Fulkerson
algorithm picks augmenting paths arbitrarily, while the
Note that D E D6D E D62D E D, because for each edge
f Edmonds-Karp algorithm uses breadth-first search to
(i, j)3E, we have either r(i, j)'0 or r( j, i)'0 or both and construct augmenting paths, thereby constructing shortest
r(i, j)"0 if both (i, j) and ( j, i) are not in E. augmenting paths. That these algorithms indeed terminate
An example of a feasible flow in a graph and the and produce a maximum flow is guaranteed by the follow-
corresponding residual graph is shown in Fig. 1. Figure 1a
ing well-known result (see the max-flow min-cut theorem in
shows a directed graph with all edge capacities equal to 3. Tarjan [32] for a proof):
Thus, C(s, a)"C(a, t)"C(s, b)"C(b, t)"3. The number
on an edge indicates the flow along that edge. Figure 1b Proposition 3 A feasible flow f is a maximum flow iff G
shows the residual graph corresponding to the given flow. f
contains no augmenting path.
Consider the nodes s and a. From Definition 1,
r(s, a)"C(s, a)!f (s, a)"3!2"1. Similarly, r(a, s)" Figure 2a shows the maximum flow for a given graph
C(a, s)!f (a, s). Note that C(a, s)"0 as there is no edge G. All edge capacities are 1, and the number on an edge
from a to s in the digraph. Also, from the skew symmetry indicates the flow along the edge. Figure 2b shows the
constraint of a flow, f (a, s)"!2 since f (s, a)"2. Hence, corresponding residual graph. The edges in the residual
r(a, s)"0!(!2)"2, and Definition 2 implies that the graph are obtained in the same way as in Fig. 1 earlier.
170

Note that in the residual graph, there is no directed path neighbors. Each action A , 16l6k, by the process up-
l
from the source s to the sink t, and hence the residual dates some of the local variables of the process. We assume
graph does not contain an augmenting path. that the execution of a guarded statement is atomic. If
more than one guard is enabled at any one time in the
system, then one of the enabled guards in one process is
3 The model of computation nondeterministically selected, and the execution of the
corresponding statement is completed. All guards in the
We assume that each node i in G corresponds to a process, system are then reevaluated. No assumptions on fairness is
called process i, that executes a program asynchronously. made while selecting an enabled guard.
Each edge (i, j) in the graph corresponds to a bidirectional
physical link between process i and process j. Thus our
distributed network is the underlying undirected graph of 4 The maximum flow algorithm for acyclic graphs
the digraph G. Each process i contains a finite set of local
variables. These variables can be read by process i and any For the rest of the paper, we assume that G is an acyclic
of its neighbors (in the underlying undirected graph), but digraph. For simplicity of exposition, we assume that asso-
can be written into by process i only. Process s and process ciated with each edge (i, j) in G there is variable f (i, j) that
t are distinguished processes, in the sense that their behav- stores the current flow from node i to node j. Both process
ior is different from that of the other processes. All other i and process j can read from and write into the variable
processes execute identical programs. f (i, j). This is not in violation of our model of computation
Each process (except process s, which is idle) executes because f (i, j) can be easily represented as the difference
a program, that can be expressed using guarded state- between a pair of non-negative variables — one stored at
ments of the form node i and one stored at node j. Each node can then
do change f (i, j) by changing the value of its local variable.
G PA Each node i contains a single variable d(i) that denotes
1 1 what i ‘‘believes’’ to be the length of the shortest directed
/ G PA
2 2 path from s to i in the residual graph G . We restrict d(i) to
2 2 f
/ G PA be an integer in the range [0 . . n]. For the rest of the paper
k k we will refer to f (i, j) as the f-value of edge (i, j) and to d(i)
od
as the d-value of node i. Each node can make moves that
Each guard G , 16l6k, is a boolean function of the local update its d-value or the f-value(s) of incident edges.
l
variables of the process and the local variables in its A move that updates a node’s d-value is called a d-move

Fig. 3. Maximum flow algorithm


171

and a move that updates an edge’s f-value is called an demand for flow back towards the sink t. For notational
f-move. Our algorithm allows one type of d-move and three convenience, we define the condition described above by
types of f-moves. Figure 3 shows the algorithm that each the predicate push(i) as follows:
node i, i9s, executes along with relevant notation. The
algorithm contains four guarded actions, labeled S1 push(i)"(demand(i)'0)?(d(i)"n)?(i9t).
through S4 for convenience. For each i, 16i64, the
guard and action in Si are referred to as G and A This action by node i described above is expressed in
i i guarded action S4.
respectively.
The main idea behind our algorithm is as follows. For A remark about the distinguished nodes s and t is in
any node i N Ms, tN, let demand(i)"O (i)!I (i). In addition,
f f order. Node s remains idle with its d-value fixed at 0. Node
let demand(t)"R. Each node i, i9s, tries to restore the t executes the same algorithm as the rest of the nodes
flow conservation constraint demand(i)"0 either by re- (except s). However, the value of O (t) is assumed to be
ducing its inflow if demand(i)(0, or by increasing its f
fixed at R implying that demand(t)'0 always. Thus,
inflow or reducing its outflow if demand(i)'0. In particu- node t ‘‘drives’’ the algorithm by pulling flow along in-
lar, each node with positive demand attempts to ‘‘pull’’ coming edges until d(t)"n.
flow via a shortest path from s to itself in the residual For the sake of simplicity, we assume in our algorithm
graph. If the node believes that a path from s to itself does that f (i, j) never exceeds C(i, j). We can easily do away
not exist in the residual graph, then it rejects the demand with this assumption by modifying the algorithm in Fig. 3
by ‘‘pushing’’ it back along an outgoing edge. We use slightly. In particular, we need to ensure that actions A1
breadth-first search to keep track of the shortest paths through A4 are not executed by a process i if any incident
from s to all nodes in G . We now explain how the four
f edge has flow in excess of capacity. In such a situation,
guarded statements, S1—S4 implement the above idea. process i can only execute a new action (A5) that appro-
f Guarded statement S1. Each node i, i9s, computes its priately reduces the flow on an incident edge that has flow
d-value by examining the values d( j) for all ( j, i)3E (Note in excess of capacity.
f Figure 4 contains an illustration of how our algorithm
that we are referring to edges in the residual graph G , not
f works. The digraph G on which we run our algorithm is
in the original graph G). Let k be a node such that (k, i)3E
f simply a directed path of length 3 whose nodes are labeled
and d(k)"minMd( j) D ( j, i)3E N. If d(k)(n, then node
f s, a, b, and t. The left column of figures in Fig. 4 shows how
i views node k as its predecessor on the shortest path from
node s to node i in G . Therefore, in this case, node i sets its the d-values and the f-values change in G as nodes make
f moves. The d-value of each node is shown under the
d-value to d(k)#1. If d(k)"n, then i believes that there is
no path from s to itself in G and therefore d(i) is also set to corresponding node and the f-value of each edge is shown
f
n. These actions by node i are described in the guarded
action S1 (see Fig. 3). For notational convenience, we
use IN(i) to denote the set M j D ( j, i)3E N and D(i) to
f
denote the set Md (p)#1D p3IN(i)N. We assume that d(s) is
fixed at 0.
f Guarded statement S2. For any node i, i9s, if
demand(i)(0 then the total flow along incoming edges in
G is reduced irrespective of the d-value of i and the d-
values of the neighbors of i. This action by node i is
expressed in guarded action S2.
f Guarded statement S3. For any node i, i9s, if
demand(i)'0 and d (i)(n then, i tries to meet this
demand by ‘‘pulling’’ flow along an incoming edge
( j, i)3E that i believes to be on a shortest path from s to
f
itself in the residual graph G . For this, node i simply picks
f
a node j such that ( j, i)3E and d( j)"d(i)!1. Flow is
f
then increased along the edge ( j, i) by the minimum of
demand(i) and r( j, i). For notational convenience, we de-
fine the condition described above by the predicate
pull( j, i) as follows:
pull( j, i)"(demand(i)'0)?(d(i)(n)?(d( j)"d(i)!1).
This action by node i described above is expressed in
guarded action S3.
f Guarded statement S4. For any node i, i9s, if
demand(i)'0 and d (i)"n, then i believes that there is no
path in G from s to itself, and hence the excess demand
f
cannot be met. In this case node i ‘‘pushes’’ the excess Fig. 4. An example of our maximum flow algorithm
172

Lemma 6 If our algorithm is in final state, then the


f-values of the edges satisfy demand(i)"0 for all nodes
i3»!Ms, tN.
Proof. Consider any node i3»!Ms, tN. Since G2 is false,
demand(i)70 for all i. If d(i)"n, then since G4 is false, we
have demand(i)60. Hence, for all nodes i with d(i)"n, we
have demand(i)"0. If d(i)(n, then since G3 is false, either
demand(i)60, or there does not exist j3IN(i) such that
d( j)"d(i)!1. But, in the latter case G1 must be true for
node i. Since this cannot be, we have demand(i)60 even if
Fig. 5. Shows nodes and corresponding guarded actions that were
executed in order to take G from one state to the next
d(i)(n. Hence, for all nodes i with d(i)(n, demand(i)"
0. K
Lemma 7 If our algorithm is in final state, then for any node
above the corresponding edge. The right column shows the i, d(i) satisfies:
corresponding residual graphs along with weights (resid-

G
ual capacities) of the edges. Figure 5 presents details about length of the shortest path from s to i
which process makes which move to take G from one d(i)" if i is reachable from s in G
f
‘‘state’’ to the next. n, otherwise
Proof. Let f be the flow in the network when all guards
are false. Consider the residual graph G . The following
5. Proof of correctness f
two cases are possible.
The proof of correctness is presented in two parts — first Case 1: i is not reachable from s in the residual graph. To
a proof of partial correctness (Section 5.1) and then a proof obtain a contradiction assume that d(i)9n. Find a maxi-
of termination (Section 5.2). mal sequence of nodes r , r ,2 , r , r such that r "
0 1 k~1 k k
i, r 3IN(r ), and d(r )"d (rj#1)!1 for all 06j(k.
j j`1 j
5.1 Partial correctness proof Since i is not reachable from s, none of the nodes
r , 06j6k are reachable from s in G . Then, two cases
We define the state of our algorithm as the set of d-values j f
are possible:
of all nodes and f-values of all edges. A final state is a state
in which all guards in all nodes are false. In order to show 1. IN(r )"0: Since d(i)(n, and d(r )(d(i), we have
0 0
that d(r )(n. Therefore guard G1 for node r is enabled.
the partial correctness of our algorithm, we need to show 0 0
that if our algorithm is in a final state, then the f-values of This is a contradiction.
the edges constitute a maximum flow in G. In order to 2. IN(r )90: Let q be a node with minimum d-value
0
show this, we need the following definition. among all nodes in IN(r ). Since the sequence r , r , 2 , r
0 0 1 k
is maximal, d(q)9d(r )!1. Since d(r )(n, guard G1 for
0 0
Definition 4 The algorithm is said to be in desired state if node r is enabled. This, again, is a contradiction.
0
the following three conditions are satisfied:
Thus, any node that is not reachable from s must have its
1. demand(i)"0 for all i3»!Ms, tN, d-value set to n.
2. For all i3» Case 2: i is reachable from s. Let k be the length of the

G
length of a shortest path from s to i shortest path from s to i. We will use induction on k to
show that d(i)"k.
d(i)" if there exists such a path in G
f
n, otherwise Base Case: k"0. This is clearly true, since by definition,
d(s)"0.
3. d(t)"n.
Induction step: Assume that all nodes at distance no more
Lemma 5 If our algorithm is in a desired state, then the than l from s have their d-values set correctly. Consider
f-values of the edges constitute a maximum flow in G. a node i at distance l#1 from s. Assume that d(i)9l#1.
Two cases are possible:
Proof. Note that the condition (1) in the above definition
implies that in a desired state, the f-values constitute a feas- 1. d(i)'l#1: Since there is at least one node j3IN(i)
ible flow. Conditions (2) and (3) together imply that there is with d( j)"l, by the induction hypothesis, guard G1 for
no augmenting path in the residual graph. By Proposition i must be true. This is a contradiction.
3, the d-values of the edges constitute a maximum flow 2. d(i)(l#1: Find a maximal sequence of nodes
in G. K S"r , r , 2 , r , r such that r "i, r 3IN(r ), and
0 1 k~1 k k j j`1
d(r )"d(r )!1 for all 06j(k. Again, two cases are
j j`1
possible:
Thus, our goal is to show that if our algorithm is in
a final state, then it is in a desired state also. The following (a) r "s: In this case, there exists a path of length d(i)
0
three lemmas show precisely this. from s to i. Since d(i)(l#1, this is a contradiction.
173

(b) r 9s: Since d(t)(l#1 and d(r )(d(i), we have length of X is finite and thus our algorithm terminates in
0 0
that d(r )9n. r must be reachable from s, as otherwise a finite number of moves.
0 0
d(r )"n. Since the sequence S is maximal and r is reach- To simplify some of the proofs, we assume that the
0 0
able from s, guard G1 must be true for r . This, again, is source s is the only node in G with no incoming edges and
0
a contradiction. the sink t is the only node in G with no outgoing edges. The
algorithm however, works correctly for digraphs with
Therefore, d(i)"l#1. This completes the induction step more than one node with no incoming edges or no out-
and shows that for all nodes i reachable from s, if shortest going edges, and our proofs can be easily generalized to
path length from s to i is k, then d(i)"k. K hold for this case.
Lemma 8 If our algorithm is in final state, then d(t)"n.
Proof. Assume that d(t)(n. Since guard G1 is false for t, 5.2.1 Execution of S2
there exists a w3IN(i) such that d(w)"d(t)!1. Since In this section we show that the total number of times S2 is
O (t)"R, this implies that G3 has to be true for t. This is executed finite.
f
a contradiction. Hence, d(t)"n. K
Lemma 10 ¹he total number of times S2 is executed by our
Lemma 6, 7, and 8 show that if our algorithm is in algorithm is finite.
a final state, then it is also in a desired state. Furthermore,
Lemma 5 shows that if our algorithm is in a desired state, Proof. Let f be the flow assignment to edges in G after 0 or
then the f-values of the edges constitute a maximum flow more moves in X. Let A denote the set of all nodes with
in G. Thus we have the following result. guard G2 true. Thus,

Theorem 9 Partial Correctness. If our algorithm is in a final A"Mi3»!MsN D demand(i)(0N.


state, then the f-values of the edges constitute a maximum For any j3», let P be the set of all distinct simple paths
flow. j
from s to j in G. Define ¸ "+ p3P (D p D#1), where D p D is the
j j
length of a path p. We define ¸ to be equal to 1.
s
5.2 Proof of termination For any i3», let B(i)"M j D ( j, i)3E?f ( j, i)'0N.
Define
The execution of the f-moves depends partly on the d-
values, and therefore on the d-moves. In turn, the C" + ¸ .
i j3B(i) j
execution of the d-moves depends on the structure of the
residual graph. Since a change in flow can change The following conditions hold for any node i, i9s:
the residual graph, the d-moves are thus dependent on
the f-moves. This two-way dependence makes it difficult to 1. ¸ '0.
i
bound the number of moves of either type, thus making 2. ¸ 'C . This condition holds because G is assumed
i i
the proof of termination rather complicated. to be acyclic.
Our proof is organized as follows. Since we assume the 3. If i3A, then C '0.
i
existence of a central daemon, the execution of our algo- 4. If ( j, i)3E and f ( j, i)'0, then C 'C . This condi-
i j
rithm can be viewed as a sequence X of arbitrarily inter- tion follows from Condition (2).
leaved f-moves and d-moves. We first show (in Section Define P"+ i3A C . We first examine the effect on P of
5.2.1) that in any execution sequence X, the number of i
an execution of S2 by any node i. Recall that i can execute
executions of the guarded action S2 is finite. We use the S2 only if i3A. Suppose that an execution of S2 by node
technique of defining an objective function that does not i decreases flow along the edge (k, i)3E. Since i3A before
increase due to the execution of the other guarded state- the move, we have that C '0 before the move. The
ments, but decreases monotonically due to execution of S2. i
following two cases are possible:
We then identify the last execution of S2 in X by any node,
and denote the suffix of X after this move by X@. Next, we 1. i N A after the move. In this case, the following two
show (in Section 5.2.2) that the number of d-moves (execu- subcases are possible:
tion of the guarded action S1) in X@ is finite. To show this (a) k3A before the move. In this case, k 3 A after the
we use the technique of identifying for each d-move move also, as only k’s outflow is reduced. Since i N A after
a ‘‘source’’ and showing that the number of distinct d- the move, P decreases by C .
moves with the same ‘‘source’’ is finite. We then find the i
(b) k N A before the move. In this case, if k N A after the
suffix of X@ after the last d-move. Denote this suffix by X@@. move, then P decreases by C . If k 3 A after the move, then
Note that X@@ does not contain any executions of either S1 i
P decreases by C and increases by C . Since the edge
or S2 and the d-values remain unaffected by moves in X@@. i k
(k, i)3E and f (k, i)'0 before the move, C 'C . Therefore
In Section 5.2.3 we use the objective function technique to i k
P decreases by a strictly positive quantity C !C .
show that the number of executions of S4 in X@@ is finite. i k
We then focus on X@@@, the suffix of X@@ after the last 2. i 3 A after the move. In this case, before the move
execution of S4. Note that X@@@ contains executions of demand(i)(!f (k, i) and f (k, i)"0 after the move. There-
guarded action S3 only. Finally, in Section 5.2.4, we use the fore C decreases by ¸ . If k N A after the move, then
i k
objective function technique again to show that the num- P decreases by ¸ . If k 3 A after the move, then P increases
k
ber of executions of S3 in X@@@ is finite. This shows that the by C and decreases by ¸ . Therefore P decreases by ¸ !C .
k k k k
length of X@@@ is finite, from which we conclude that the Since ¸ 'C for any node k, therefore P decreases.
k k
174

Thus execution of S2 by any node strictly decreases P. Lemma 13 ¹he number of executions of S4 in X@@ is finite.
We will now show that execution of guarded statements S3
or S4 by any process i cannot increase P. Proof. For S4 to be executed by a process i, the
First we show that execution of S3 or S4 by process condition d(i)"n needs to be satisfied. Let B"Mi3»!
Ms, tN Dd(i)"nN. For every i3B, define ¸ to be the length of
i cannot add a node to the set A. To see this, note that the i
the longest directed path in G from i to some node j3»
condition demand(i)'0 must be true for S3 or S4 to be
such that either d( j)9n or j"t. Note that ¸ '0 for all
executed by process i. Furthermore, demand(i)70 after S3 i
or S4 is executed by process i. Therefore, i N A before such i3B and for any edge (i, k)3E, i, k3B implies that ¸ '¸ .
i k
a f-move and i N A after such a f-move. Consider an execu- Let C"Mi3B D demand(i)'0N. A node i can execute S4
only if i3C. Define Q"+ i3C ¸ . Consider an execution of
tion of S3 by i that increases flow along the edge ( j, i)3E .
f i
If ( j, i)3E, this increases O ( j). Hence, if j N A before the S4 by a node i3C. Let the flow be decreased along the edge
f (i, k)3E. Then the following two cases are possible.
move, then clearly j N A after the move. If (i, j)3E, then an
execution of S3 by i along ( j, i)3E decreases I ( j). Again,
f f 1. i N C after the move. In this case, if k3C before the
if j N A before the move, then j N A after the move. Sim- move, then k3C after the move also. Therefore Q de-
ilarly, if an execution of S4 by i reduces f (i, j), then I ( j) is
f creases by ¸ . If k N C before the move, but k3C after the
reduced and therefore, if j N A before the move, then j N A i
move, then Q decreases by ¸ and increases by ¸ . There-
after the move. i k
fore the net decrease in Q is ¸ !¸ . Since ¸ '¸ , Q
Next, we show that for any node i3A, C cannot i k i k
i decreases by a strictly positive quantity.
increase due to an execution of S3 or S4. To increase C , 2. i3C after the move. It is possible that k3C before
i
a new node j must be added to B(i) due to an execution of and after the move or k N C before or after the move.
S3 or S4. Note that since i3A, demand(i)(0, and hence In either case, Q remains constant. It is also possible
i cannot execute S3 or S4. An execution of S3 or S4 by that k N C before the move, but k3C after the move. In
a node j3»!MsN, ( j, i)3E, can only decrease flow along this case, Q increases by ¸ . However, i3C after the move
the edge ( j, i)3E, and hence cannot add j to B(i). It is easy k
implies that f (i, k)"0 after the move. Since d-values do
to see that execution of S3 or S4 by any other node cannot not change, and d(i)"n, flow along (i, k) cannot be in-
affect B(i). K creased anymore. Hence i cannot decrease flow along (i, k)
by an execution of S4 again. Since this is true for any
5.2.2 Execution of S1 outgoing edge of i in the digraph, such a case can occur at
most outdeg(i) times, where outdeg(i) is the out-degree of
We identify the last execution of S2 by any node in the i in G.
execution sequence X, and denote the suffix of X after this
move as X@. Thus, X@ contains only executions of S1, S3, Since the maximum value of ¸ is n, the maxi-
i
and S4. In the following lemma, we claim that the number mum initial value of Q is n2. Q can increase
of d-moves in X@ is finite. O(+ i3» outdeg(i)"O(e) times by n. Therefore, the max-
imum value of Q is O(n2#ne)"O(ne). Since Q
Lemma 11 ¹he number of d-moves in X@ is finite. must decrease by at least one at all other times S4 is
executed, the total number of executions of S4 in X@@ is
The proof of the above lemma is rather technical, and
O(ne). K
hence, we just sketch an outline of the proof here. The
complete proof is given in the appendix at the end of the
paper. The set of all d-moves can be partitioned into sets of 5.2.4 Execution of S3
decreasing moves and increasing moves. A decreasing move
Let X@@@ denote the suffix of the execution sequence X@@
by a node is a d-move that decreases the d-value of that
after the last execution of S4 by any node. Note that X@@@
node. An increasing move is defined in a corresponding
contains only executions of S3.
manner. For each decreasing move, we define a unique
‘‘source’’ of the move. It is then shown that any node can Lemma 14 ¹he total number of executions of S3 in X@@@ is
be the source of only a finite number of decreasing moves finite.
in the system. Hence, the number of decreasing moves is
finite. Since a decreasing move can decrease the d-value of Proof. Let H"Mi3»!MsN D (demand(i)'0)? (d(i)(n)N.
a node by at most n, the number of increasing d-moves is A node i can execute S3 only if i3H. Define R"+ i3H d(i).
also finite. Hence, Lemma 11 holds. Consider an execution of S3 by a node i3H. Let the flow
be increased along the edge (w, i)3E . Then the following
The following lemma directly follows. f
scenarios are possible:
Lemma 12 ¹he total number of d-moves in the system is
1. i N H after the move. In this case, two subcases are
finite.
possible:

5.2.3 Execution of S4 (a) w3H before the move. In this case, w3H after the
move also. But as i N H after the move, R decreases by d(i).
We identify the last d-move by any node in X@, and denote (b) w N H before the move. Since all executions of S2
the suffix of X@ after this move by X@@. X@@ contains execu- have been completed, no node can have inflow greater
tions of S3 and S4 only. Note that none of the moves in X@@ than outflow at this stage. Therefore I (w)"O (w) before
f f
change any d-values. We next bound the number of execu- the move. Hence, w3H after the move. This means that
tions of S4 in X@@. R decreases by d(i) and increases by d(w). The net change
175

in R is d(i)!d(w). Since i increased flow along edge (w, i) version of the Goldberg-Tarjan maximum flow algorithm
in S3, d(i)"d(w)#1. Therefore R decreases by 1. [9, 22]. We ran both our algorithm and this distributed
implementation of the Goldberg-Tarjan algorithm on the
2. i3H after the move. Let the move be m . If w3H
1 same set of graphs with a random scheduler. The choice of
before m , R remains unchanged. If w N H before m , w3H
1 1 the Goldberg-Tarjan algorithm is motivated by the fact
after m1, and hence R increases by d(w). However, after the that it is particularly well-suited for distributed
move the edge (w, i) must be saturated, i.e., r(w, i)"0 after implementation. For all seven classes, the maximum num-
the move. Also d(i)"d(w)#1. To increase flow again ber of moves executed by our algorithm was less than the
along the edge (w, i), r(w, i)'0 has to be true. Therefore, maximum number of moves executed by the Goldberg-
w must increase flow along (i, w) by executing S3. However, Tarjan algorithm2 for all values of n, except for only one
this is not possible as d(w)(d(i). Therefore r(w, i) remains value of n in one class. The mean number of moves ex-
0 and flow along (w, i) cannot be changed again. Since this ecuted by our algorithm was also less than the mean
is true for any edge in the residual digraph, R can thus number of moves executed by the Goldberg-Tarjan algo-
remain unchanged or increase O(e) times. rithm in most cases. Note that all highly efficient sequen-
Since d(i)6n for any i, the initial value of R is at most tial and parallel implementations of Goldberg-Tarjan’s
n2. R can increase O(e) times by O(n). Thus the maximum algorithm require scheduling the enabled guards in some
value of R is O(n2#ne)"O(ne). Since R must decrease by particular order [2, 9, 21, 22]. However, in a distributed
at least 1 all other times, the number of executions of S3 in setting, there is no way to force any particular schedule
the systems is O(ne), and is thus finite. K without a significant amount of additional information
exchange. Hence, we chose to run the distributed imple-
Theorem 15 Termination. Starting from an arbitrary state, mentation of the Goldberg-Tarjan algorithm using a ran-
the algorithm reaches a final state in finite number of steps. dom scheduler.
The following subsections present the details of our
Proof. Follows from Lemma 10, Lemma 12, Lemma 13, implementation and results obtained. Our source code is
and Lemma 14. K available on the world wide web at ftp://ftp.cs.uiowa.edu/
pub/sriram/maxflow.
6 An experimental evaluation
6.1 Implementation details
In the previous section, we show that our algorithm ter-
minates in a finite number of moves. The proof of termina- We tested our maximum flow algorithm on seven classes
tion however, does not establish a polynomial upper of acyclic digraphs. The generators for these classes are
bound on the number of moves. In fact, we have been able available from DIMACS. (Center for Discrete Mathemat-
to construct an example of a digraph and a ‘‘malicious’’ ics and Theoretical Computer Science, Rutgers University,
schedule that together force our algorithm to make an New Jersey, USA.) These classes of digraphs are specifi-
exponential (in the number of nodes) number of moves cally designed for testing algorithms related to network
[17]. However, to force our algorithm to make an ex- flow problems and have been commonly used for testing
ponential number of moves, we had to choose a digraph the performance of maximum flow algorithms [2]. The
with a very specific structure, assign specific initial d- digraphs in the seven classes differ in various character-
values, and choose a very specific schedule of moves. Such istics such as number of edges, length of the longest path
worst case behavior is extremely unlikely to occur in from source to sink, number of distinct paths from source
practice, and in fact, the behavior of the algorithm may be to sink, and the position of the minimum cut3 with respect
significantly better in practice. In this section, we present to the source and the sink. The edge capacities are ran-
extensive experimental results to confirm this. In particu- domly chosen to be non-negative integers less than or
lar, we ran our algorithm with a random scheduler and equal to a predefined maximum. We list the classes of
random initial d-values and f-values on seven classes of digraphs below. The approximate number of edges e for
digraphs specifically designed to test maximum flow algo- the digraphs in each class is shown next to the name of the
rithms. For each class, the algorithm is run on graphs with class. Some of the acronyms used for classes of digraphs
different values of n. For all seven classes and for all values are from an earlier experimental study of maximum flow
of n, the maximum number of moves executed by our algorithms by Anderson and Setubal [2]. For more details
algorithm is less than 2n2. For six of the seven classes, it is the reader is referred to the DIMACS documents ‘‘The
less than n2 for all values of n. Core Experiments’’ and ‘‘The Benchmark Experiments’’
We are not aware of any maximum flow algorithm for network flow problems.4
designed specifically for acyclic graphs. We are also un-
aware of any results showing that existing maximum flow 1. Washington-Random-Level-Graph-Long (wrlgl):
algorithms such as Goldberg-Tarjan perform better on e+3n.
acyclic graphs than on graphs with cycles. Hence, to pro-
vide a basis for comparison, we implemented a distributed
3 A cut is a set of edges whose removal disconnects node s from node
t. The weight of a cut is the sum of the capacities of the edges in it.
2 A Relabel or a Push operation [22] is counted as one move in case A minimum cut is a cut with smallest weight.
of Goldberg-Tarjan’s algorithm. 4 Available by anonymous ftp from dimacs.rutgers.edu
176

2. Washington-Random-Level-Graph-Wide (wrlgw): f In each run, both our algorithm and the distributed
e+3n. version of the Goldberg-Tarjan algorithm are run on the
3. Washington-Line-Sparse (wls): e+4n. same graph. Before running our algorithm, random d-
4. Washington-Line-Moderate (wlm): e+n3@2/4. values are initially assigned to each node and random
5. Washington-Square-Sparse (wss): e+4n. f-values are assigned to each edge in the digraph, thus
6. Washington-Square-Moderate (wsm): e+n3@2/4. starting the network in an arbitrary initial state. The seed
7. Acyclic-Dense (ad): e+n(n!1)/2. of the random number generator is reinitialized each time
with a different value (using the system clock) to ensure
The important aspects of our implementation are sum- different initial states. For running the Goldberg-Tarjan
marized below: algorithm, the graph is initialized as described in [22]. In
our distributed implementation of the Goldberg-Tarjan
f For each class of digraphs, our algorithm is run on algorithm, each node in the graph corresponds to a pro-
digraphs with different values of n, the number of nodes in cess that performs the Relabel and Push operations for that
the graph. For the classes wrlgl, wrlgw, wls, wlm, wss, and node.
wsm, the values of n used are approximately 28, 29, 210, 211, f Our implementation used a random scheduler that se-
and 212 (the exact values of n vary slightly from one class lects with equal probability one enabled guard from the set
to another). For the class ad, only the values 27 and 28 are of all enabled guards in the system. The action corresponding
used due to the relatively large number of edges in a com- to the selected guard is then executed, and the guards in
plete acyclic digraph. the system are reevaluated. This process continues till
f For each class of digraphs and for each value of n, 20 there is no enabled guard in the system.
runs are performed. Each run uses a new graph. For each f For our algorithm, for each run, we count the total
class of digraphs and for each n, the maximum and the number of d-moves and f-moves made before the algo-
mean of the number of moves over all 20 runs is reported rithm reaches a final state. For Goldberg-Tarjan’s algo-
(Figs. 6 and 7 respectively). rithm, we count the total number of Relabel and Push
operations before the algorithm terminates. Note that the
atomicity of d-moves and f-moves in our algorithm are
similar to that of Relabel and Push operations respectively
of the Goldberg-Tarjan algorithm.

6.2 Results and observations


The tables in Figs. 6 and 7 summarize our results. An
empty slot in a table indicates that the corresponding
value of n has not been used for that class of graphs. The
number of moves are rounded off to the next higher
thousand for ease of presentation. The results show that
for all seven classes, our algorithm performs at least as well
as the distributed implementation of the Goldberg-Tarjan
Fig. 6. Maximum number of moves for various graph classes for algorithm.
different sizes of digraphs. G¹ indicates Goldberg-Tarjan
f Figure 6 shows the maximum number of moves made
by our algorithm and by the Goldberg-Tarjan algorithm
for the different classes of digraphs and for different values
of n. For our algorithm, it can be easily verified that the
maximum number of moves is less than n2 for all cases
except in the case of the class ad. Even for the class ad, the
maximum number of moves is less than 2n2. For easy
comparison, we present the exact values of n2 for different
n in a separate table in Fig. 6. The large number of moves
for the class ad can be attributed to the exceptionally large
number of edges in digraphs in this class, relative to
digraphs with the same number of nodes in other classes.
For the Goldberg-Tarjan algorithm, the maximum num-
ber of moves is greater than n2 in all cases except for
n"4096 for the class wsm, and close to or greater than 2n2
in many cases. The low value of the maximum number of
moves for n"4096 for the class wsm is obtained because
all 20 graphs generated have minimum cuts very close to
the source (in fact, the cut consisted of all outgoing
edges from the source). It is known that the Goldberg-
Fig. 7. Mean number of moves for various graph classes with differ- Tarjan algorithm performs very well when the mini-
ent input sizes. G¹ indicates Goldberg-Tarjan mum cut is close to the source [2]. In contrast, our
177

algorithm performs well when the minimum cut is close to having local correction actions is not sufficient to ensure
the sink. local repair of limited transient faults. As it stands, our
f Figure 7 presents the mean number of moves made by algorithm may allow even limited transient faults to con-
our algorithm and by the Goldberg-Tarjan algorithm for taminate large portions of the network. However, tech-
various input classes and different values of n. It is known niques presented in [16, 18, 19, 20] may be applied to
that the number of moves of Goldberg-Tarjan’s algorithm transform our algorithm into one that contains the effects
is dependent on the position of the minimum cut with of limited transient faults in some cases.
respect to the source and the sink [2]. For our algorithm The proof that our algorithm terminates in finitely
also, the number of moves, in particular the number of many steps is complicated due to the mutual interdepen-
d-moves, depends on the position of the minimum cut with dence between different kinds of moves. In proving the finite
respect to the source and the sink [17]. The generators for termination of our algorithm, we have introduced a new
the classes wls and wlm are designed such that approxim- technique of identifying the ‘‘source’’ of a move and showing
ately half the graphs generated have minimum cuts near that only a finite number of moves can have the same
the source, and the other half have minimum cuts near the ‘‘source’’. We believe that this technique can be used to prove
sink. Hence the number of moves made for these graph the termination of other self-stabilizing algorithms also.
classes exhibit a bimodal distribution. To reflect this, while To compute the d-values of the nodes (in statement S1)
presenting the mean number of moves made by our algo- our algorithm requires that each node be aware of n — the
rithm for these two classes, we present two means instead total number of nodes in the graph. This requirement can
of one — a low mean taken over all runs with small number be relaxed in the sense that it is sufficient for all nodes to be
of moves, and a high mean taken over all runs with large aware of an upper bound N on the number of nodes in the
number of moves. An entry (x, y) in the table indicates this, digraph. This allows our algorithm to dynamically adapt
with x as the low mean and y as the high mean. The mean to network changes due to the addition and deletion of
number of moves made by our algorithm is less than that nodes, provided the number of nodes in the digraph is
for the Goldberg-Tarjan implementation in most cases. bounded above by N. Of course, our algorithm can adjust
f A breakup of the total number of moves for our algo- to arbitrary addition and deletion of edges as well as
rithm into d-moves and f-moves shows that whenever the changes in the capacities of edges.
total number of moves is high, the proportion of d-moves If a cycle is present in the digraph, then the proof of
is also very high, specially for large values of n. In fact, this Lemma 10 no longer holds. Hence it is not known if the
proportion is higher than 90% for all the graph classes for algorithm terminates in finitely many steps in the presence
n"4096. More importantly, most of these d-moves occur of cycles. However, in spite of our best efforts, we have also
after a maximum flow has been achieved — these moves not been able to construct examples of digraphs with
correctly set the d-values for a legitimate state. The reason cycles for which the algorithm does not terminate. Hence,
for this is explained in detail in [17]. Informally, a d-move we believe that our proof can be strengthened to show that
in our algorithm is similar to a Relabel operation of the the algorithm does terminate in finitely many steps even
Goldberg-Tarjan algorithm. However, unlike the Goldberg- when run on graphs with cycles. However, we have not
Tarjan algorithm, where no Relabel operation is applied to been able to complete such a proof yet. Hence, we leave
a node if its inflow is equal to its outflow, our algorithm our claim of correctness of the algorithm when run on
requires d-value of a node to be set correctly even if its inflow arbitrary graphs as a conjecture.
is equal to its outflow. This is necessary to avoid possible An interesting open problem is to establish an upper
deadlock from certain initial states. Since a self-stabilizing bound on the number of moves that our algorithm re-
algorithm has to consider all initial states, these extra d- quires in the worst case to converge to a final state starting
moves can be viewed as a cost for achieving stabilization. from a single-fault state. By a single-fault state, we mean
f We also ran our algorithm on the same graphs starting a state obtained from a final state by perturbing the state
from a good state instead of a random state. A good state of a single process in the system. We are currently inves-
of our algorithm is a state with all d-values and f-values tigating this issue.
equal to 0. Our results indicate that except for the class ad,
there is insignificant difference in the maximum number of
moves made starting from a good state as compared to the References
case of starting from a random state. The reason for this is
again the large number of d-moves after a maximum flow 1. Ahuja RK, Magnanti TL, Orlin JB: Some recent advances in
has been achieved. network flows. SIAM Rev 33: 175—219 (1991)
2. Anderson R, Setubal JC: Goldberg’s algorithm for maximum
flow in perspective: a computational study. DIMACS Series
Discrete Math Theoret Comput Sci 12: 1—18 (1988)
7 Conclusions and conjectures 3. Awerbuch B: Complexity of network synchronization. J ACM
32: 804—823 (1985)
In this paper we have presented the first distributed, pass- 4. Awerbuch B, Leighton T: A simple local-control approximation
ive, self-stabilizing algorithm for the maximum flow prob- algorithm for multicommodity flow. In: Proceedings of the 34th
lem that uses local checking and local correction. Local Annual IEEE Symposium on Foundations of Computer Science,
pp 459—468 (1993)
correction actions are necessary if an algorithm is to have 5. Awerbuch B, Varghese G: Distributed program checking: a para-
the ability to repair transient faults locally. Algorithms digm for building self-stabilizing distributed protocols. In: Pro-
that do not have local correction actions [5] are inherently ceedings of the 32nd Annual IEEE Symposium on Foundations
unable to repair limited transient faults locally. However, of Computer Science, pp 258—267 (1991)
178

6. Bazaraa MS, Jarvis JJ, Sherali HD: Linear Programming and 31. Shiloach Y, Vishkin U: An O(n2 log n) parallel max-flow algo-
Network Flows. 2nd edn. Wiley, New York 1990 rithm. J Algorithms 3: 128—146 (1982)
7. Cheriyan J, Hagerup T, Melhorn K: Can a maximum flow 32. Tarjan RE: Data Structures and Network Algorithms. Society
be computed in O(nm) time? In: Proceedings of the Inter- for Industrial and Applied Mathematics, Philadelphia, PA (1983)
national Colloquim on Automata, Languages, and Program- 33. Yu HP, Chen NS, Huang ST: A self-stabilizing algorithm for
ming (1990) constructing spanning trees. Inform Process Lett 39: 147—151
8. Collin Z, Dolev S: Self-stabilizing depth-first search. Inf Proc (1991)
Letters 49: 297—301 (1994)
9. Cormen TH, Leiserson CE, Rivest RL: An Introduction to Algo-
rithms. The MIT Press, Cambridge, MA 1991 Appendix
10. Dijkstra EW: Self-stabilizing systems in spite of distributed con-
trol. Comm ACM 17(11): 643—644 (1974)
11. Dolev S, Israeli A, Moran S: Self-stabilization of dynamic sys- Proof of Lemma 11
tems assuming only read/write atomicity. In: Proceedings of the The execution sequence X@ contains d-moves as well as f-moves.
9th Annual ACM Symposium on Principles of Distributed Com- Label each move in this sequence by a move number, which is simply
puting, pp 103—118 (1990) the position of that move in the execution sequence. Denote by
12. Dolev S, Gouda MG, Schneider M: Memory requirements m[i, x] the d-move by node i with move number x. Often, when the
for silent stabilization. Proceedings of the 15th Annual ACM identity of the node that made a d-move is not relevant, we will use
Symposium on Principles of Distributed Computing, pp 27—34 m[!, x] to denote the d-move with move number x. Let re-
(1996) sult(m[i, x]) be the d-value of node i just after move m[i, x]. Let
13. Edmonds J, Karp RM: Theoretical improvements in algori- IN(i, x) denote the value of IN(i) just before move m[i, x]. For any
thmic efficiency for network flow problems. J ACM 19: 248—264 d-move m[i, x] with result(m[i, x])(n, we know that IN(i, x)O0. So
(1972) we can find a node j3IN(i, x) which can be thought of having made
14. Ford LR, Fulkerson DW: Maximal flow through a network. a d-move before m[i, x] that is the cause of m[i, x]. This notion is
Canad J Math 8: 399—404 (1956) made precise in the following definition. For notational convenience,
15. Ghosh S, Karaata MH: A self-stabilizing algorithm for coloring we assume that before making any d-moves, each node i makes
planar graphs. Distrib Comput 7(1): 55—59 (1993) a hypothetical d-move, denoted m[i, o], with result(m[i, o]) being
16. Ghosh S, Gupta A: An exercise in fault-containment: self- the initial d-value of node i.
stabilizing leader election. Inform Process Lett 59(5) : 281—288
(1996) Definition 16 Let m[i, x] be a d-move with result(m[i, x])(n. Let
17. Ghosh S, Gupta A, Pemmaraju SV: A self-stabilizing algorithm M(i, x)-IN(i, x) be the set of all nodes j3IN(i, x) satisfying
for the maximum flow problem. Technical Report TR-94-10, d( j)"minMd(p) D p3IN(i, x)N. If M(i, x) contains a node j that has
Department of Computer Science, The University of Iowa, Iowa made at least one d-move before m[i, x], then we define
City (1995)
18. Ghosh S, Gupta A, Pemmaraju SV: A fault-containing self- cause(m[i, x])"m[ j, y]
stabilizing algorithm for spanning trees. J Comput Inform 2(1):
322—338 (1996) where m[ j, y] is the last d-move by node j satisfying y(x. If none of
19. Ghosh S, Gupta A, Pemmaraju SV: Fault-containing network the nodes in M(i, x) have made a move before m[i, x], then we define
protocols. Proceedings of the ACM Symposium on Applied cause(m[i, x])"m[ j, o]
Computing (1997)
20. Ghosh S, Gupta A, Herman T, Pemmaraju SV: Fault-containing for some arbitrary j3IN(i, x).
self-stabilizing algorithms. Proceedings of the 15th Annual ACM
Symposium on Principles of Distributed Computing, pp 45—54 An observation that immediately follows from the above definition
(1996) is the following.
21. Goldberg AV: Efficient graph algorithms for sequential and
parallel computers. Technical Report MIT/LCS/TR-374, Labor-
atory for Computer Science, Massachussetts Institute of Techno- Observation 17 For any d-move m[i, x] with result(m[i, x])(n, we
logy (1987) have
22. Goldberg AV, Tarjan RE: A new approach to the maximum flow
result(m[i, x])"result(cause(m[i, x]))#1.
problem. J ACM 35: 921—940 (1988)
23. Gouda MG, Herman T: Stabilizing unison. Inform Process Lett The motivation for defining the cause of a move is that it allows us to
35: 171—175 (1990) trace back through a sequence of causes to the origin of a move. For
24. Gouda MG, Schneider M: Maximum flow routing. In: Proceed- example, let us start with a move m[i, x] with result(m[i, x])(n and
ings of the 2nd Workshop on Self-stabilizing Systems (1995) trace its cause back to a move m[ j, y]. Let us then try to trace the
25. Huang A, Chen N: A self-stabilizing algorithm for constructing cause of m[ j, y] back to another move and so on until we can do this
breadth-first tree. Inform Process Lett 41: 107—117 (1992) no more — that is, we have reached a hypothetical move m[k, o] by
26. Huang ST: Leader election in uniform rings. ACM Trans Prog some node k. The sequence of nodes visited in traveling from node
Lang Sys 15: 563—573 (1993) i to node k can be viewed as the trace of the d-move m[i, x]. A precise
27. Israeli A, Jalfon M: Token management schemes and random definition of this notion is given in Definition 18, but first some use-
walks yield self-stabilizing mutual exclusion. In: Proceedings of ful notation. Define cause0(m[i, x])"m[i, x] and causet(m[i, x])"
the 9th Annual ACM Symposium on Principles of Distributed cause(causet~1(m[i, x])) for all t'0.
Computing, pp 119—132 (1990)
28. Karaata MH, Pemmaraju SV, Bruell SC, Ghosh S: Self-stabiliz- Definition 18 Let
ing algorithms for finding centers and medians of trees. Technical
m[i , x], cause(m[i , x]), cause2(m[i , x]), 2 , causek(m[i , x])
Report TR-94-03, Department of Computer Science, The Uni- 0 0 0 0
versity of Iowa, 1994. Abstract appeared in ACM Annual Sym- be a maximal sequence of moves in the sense that causek(m[i , x])"
0
posium on Principles of Distributed Computing (1994) m[i , o] for some node i . Suppose that node i , for each, t, 06t6k,
29. Lin X, Ghosh S: Self-stabilizing maxima finding. In: Proceedings k k t
makes move causet(m[i , x]). Then
of the 28th Annual Allerton Conference, pp 662—671 (1991) 0
30. Schneider M: Self-stabilization. ACM Comput Surveys 25(1): trace(m[i , x])"(i , i , 2 , i ).
0 0 1 k
45—67 (1993) We say that trace(m[i , x]) has length k.
. 0
179

Note that the nodes i , i , 2 , i in trace(m[i, x]) need not be 2. A decreasing move, m[i , y ], x (y (z , such that
0 1the nodes
k i ,i , t t t t t
distinct. In fact, in traversing , i in that order, we result(m[i , y ])(d .
0 1 2 k17 along with the t t 0
may visit the same edge several times. Observation
fact that the d-value of any node has to be an integer in the range Proof. We organize the proof into three claims and their proofs.
[0··n] leads to an upper bound on the length of trace(m[i, x]).
Claim 1. There exists a node i , 06t(k, that makes an increasing
t
Observation 19 ¸et m[i, x] be a d-move with result(m[i, x])(n. ¹hen, move m[i , x@ ], x (x@(z , such that just before m[i , x@ ], we have
t t t t 0 t t
the length of trace(m[i, x]) is at most (n!1). d (i )6d , d (i )6d , and i NIN(i , x@ ) and just after the move
t t t`1 t`1 t`1 t t
m[i , x@ ], we have d (i )'d .
Now let G@ be the digraph obtained from G by replacing each t t t t
edge in G by two edges — one in each direction. Let T be the set of all Proof of Claim 1. Since trace(m[i , x ])"trace(m[i , z ]), we have
0 0 0 0
directed walks5 in G@ of length (n!1) or less. Clearly, T is a finite set that result(m[i , x ])"result(m[i , z ]). This implies that there
0 0 0 0
and a loose upper bound on the size of T is nn. It is also easy to see exists an increasing move m[i , x@ ], x (x@ (z , such that just
0 0 0 0 0
that for each move m[i, x] with result(m[i, x])(n, we have that before move m[i , x@ ], d(i )6d , and just after move m[i , x@ ],
0 0 0 0 0 0
trace(m[i, x])3T. d(i )'d .
0 0
The set of all d-moves can be partitioned into sets of decreasing For any t, 06t(k, suppose that m[i , x@ ], x (x@(z , is a d-
t t t t 0
moves and increasing moves. A decreasing move by a node is a d-move move by node i such that just before move m[i , x@ ], d(i )6d , and
t t t t t
that decreases the d-value of that node. An increasing move is defined just after the move, d(i )'d . Two cases are possible, based on the
t t
in a corresponding manner. Note that if m[i, x] is a decreasing move, d-value of node i , just before move m[i , x@ ]:
t`1 t t
then result(m[i, x])(n and hence the definitions of cause and trace
can be applied to all decreasing moves. If trace( ) were a one-to-one Case 1. The d-value of node i , just before move m[i , x@ ], is strictly
t`1 t t
function when its domain is restricted to the set of decreasing d- greater than d . In this case, node i must have made a move,
t`1 t`1
moves (that is, distinct decreasing moves have distinct traces), then denoted m[i , x@ ], after move m[i , x ] (therefore,
t`1 t`1 t`1 t`1
the number of decreasing moves would be bounded above by the size x (x@ ) and before move m[i , x@ ] (therefore, x@ (x@(z )
t`1 t`1 t t t`1 t 0
of T. Unfortunately, it can be shown that distinct decreasing moves such that just before move m[i , x@ ], d(i )6d and just after
t`1 t`1 t`1 t`1
may have the same trace. the move, d(i )'d .
t`1 t`1
However, this does not deal a fatal blow to our plans. We manage
Case 2. The d-value of node i , just before move m[i , x@ ], is less
to show that each walk in T can be the trace of only a finite number t`1 t t
than or equal to d . Recall (from Observation 17) that
of decreasing moves. This, of course, immediately shows that the t`1
d "d !1. This means that just before move m[i , x@ ],
total number of decreasing moves that the system can make is finite. t`1 t t t
d(i )6d (d . By assumption, result(m[i , x@ ])'d . This can
In order to prove the above claim precisely, we need two definitions t`1 t`1 t t t t
happen only if i NIN(i , x@ ).
and two lemmas. t`1 t t
Definition 20 Let N(x) be the set of all nodes that have made at least In the manner described above, starting from the d-move m[i , x@ ]
0 0
one d-move with move number less than or equal to x. We say that we can use Case 1 to follow a sequence of moves
a walk (i , i , 2 , i )3T has disappeared from the system after move
m[!, x]0 if1the following
k conditions hold: m[i , x@ ], m[i , x@ ], 2 , m[i , x@ ]
0 0 1 1 t t
(1) i 3N(x), until either (a) t"k, or (b) Case 2 applies to the d-value of node
k all i 3N(x), 06t6k, if m[i , x ] is the last d-move by i just before move m[i , x@ ]. If Case (b) applies, then we have that
(2) For
k x 6x, then t t t`1 t t
node i for some t, 06t6k, makes a move m[i , x@ ], x (x@(z ,
node i such that
t t t t t t t 0
such that just before move m[i , x@ ], we have d(i )6d ,
t t t t
trace(m[i , x ])9(i , i , 2 , i ). d(i )6d , and i NIN(i , x@ ) and just after move m[i , x@ ], we
t t t t`1 k t`1 t`1 t`1 t t t t
have that d(i )'d . This is as claimed.
t t
The following argument shows that Case (a) it not possible. In
The intuition behind the above definition is simple. A node i can particular, we show that if Case (a) applies, then the walk
make a move m[i , x ] with trace (i , i , 2 , i ) only if there is a0node (i , i , 2 , i ) is unavailable after move m[i , x@ ]. We know that,
0 1 k 0 0
0 0most recent move
i 3IN(i , x ) whose 0 1 has trace
k (i , i , 2 , i ). The result(m[i , x@ ])9result(m[i , x ]), it follows that
1 conditions
0 0 in the above definition rule out any1such 2 possibility
k k~1 k~1 k~1 k~1
two
trace(m[i , x@ ])9trace(m[i , x ]).
and hence we say that the walk has disappeared from the system. k~1 k~1 k~1 k~1
Furthermore, since i has made a d-move, namely m[i , x@ ], prior to
Definition 21 We say that a walk (i , i , 2 , i ) is unavailable after k k k
0 1m[i , y]
k with y'x and move m[i , x@ ], the walk (i , i ) has disappeared from the
move m[!, x] if for all moves k~1 k~1 k~1 k
result[m(i , y)](n, we have that trace(m[i 0, y])9(i , i , 2 , i ). system after move m[i , x@ ] (see Definition 3). This observation
k~1 k~1
0 0 0 1 k can be inductively extended to show that walk (i , i , 2 , i ) has
0 1 k
The following result is easily shown. disappeared from the system after move m[i , x@ ]. By Lemma 22,
0 0
this means that the walk (i , i , 2 , i ) is unavailable after m[i , x@ ].
Lemma 22 If a walk has disappeared from the system after move 0 1 k 0 0
But, this is a contradiction since m[i , z ] is a move after m[i , x@ ]
m[!, x], then the walk is unavailable after move m[!, x]. 0 0 0 0
that has trace equal to (i , i , 2 , i ). Thus Case (a) is impossible.
0 1 k
Lemma 23 ¸et m[i , x ] be a decreasing move with Claim 2. Node i makes a move m[i , z ] such that x@(z 6z and
trace(m[i , x ])"(i , i ,020, i ). For each t, 06t6k, denote the t t t t t 0
causet(m[i , z ])"m[i , z ].
0 0 , x ])0 by
move caset(m[i 1 m[i ,kx ] and let d "result(m[i , x ]). Now 0 0 t t
0 i0 makes a decreasing
suppose that node t t movet m[i , z ], z t'x
t , with Proof of Claim 2. The claim is trivially true if t"0. So we show
0 ,i ,
trace(m[i , z ])"(i , i ). ¹hen there 0 0 a0 node
exists 0 i, by contradiction that the claim is true even when 0(t(k. Let
0 0 0 1 2 k t
06t6k, that makes causet(m[i , z ])"m[i , z ] and suppose that z 6x@ . Clearly,
0 0 t t t t
z 9x@ , because result(m[i , x@ ])'d , but result(m[i , z ])"d . So we
t t t t t t t t
1. A move m[i , z ] such that x (z 6z such that are left with the possibility that z (x@ . Now consider node i .
t t t~1
causet(m[i , z ])"m[it , tz ]. t t 0
Recall from the proof of Claim 1 that node i makes a move
0 0 t t t~1
m[i , x@ ] such that x@(x@ (x@ and just before move
t~1 t~1 t t~1 0
m[i , x@ ], d (i )6d and just after move m[i , x@ ],
t~1 t~1 t~1 t~1 t~1 t~1
5 A walk in a digraph is any sequence of nodes (i , i , 2 , i ) such that d (i )'d . This implies that causet~1(m[i , z ])"m[i , z ]
t~1 t~1 0 0 t~1 t~1
for all t, 06t6k!1, (i , i ) is an edge in the0 digraph.
1 kThe length where z (x@ . This can be inductively extended to show that
t t`1 t~1 t~1
of the walk is k. z (x@ . This is a contradiction since x (x@ (z .
0 0 0 0 0
180

Claim 3. Node i makes a decreasing move m[i , y ], x@(y (z , result strictly less than d . Again, since T is finite, node i makes an
t t t t t t 0 1
such that result(m[i , y ])(d (d . infinitely many moves with the same trace and with result equal to
t t t`1 0 some d , where 06d (d . We can apply the above argument
Proof of Claim 3. In Claims 1 and 2, we have isolated two moves 1 1 0
inductively to claim the existence of an infinite sequence of node
by node i , namely m[i , x@ ] and m[i , z ], x (x@(z (z , such i , i , 2 such that node i for each k, k70, makes infinitely many
t t t t t t t t 0 0 1 k
that i NIN(i , x@ ), but i 3IN(i , z ). Since i NIN(i , x@ ), we have decreasing moves with the same trace and with result equal to d ,
t`1 t t t`1 t t t`1 t t k
that just after move m[i , x@ ], the edge (i , i )NE . Two cases are where d 'd . But such an infinite sequence is impossible since
t t t`1 t f k k`1
possible: d is finite and the d-values of the nodes in G are non-negative
0
integers. K
1. (i , i )3E: In this case, just after move m[i , x@ ],
t t`1 t t
f (i , i )"0. Since i 3IN(i , z ), we have that just before move
t t`1 t`1 t t
m[i , z ], the edge (i , i )3E and f (i , i )'0. An increase in the
t t t`1 t f t t`1 Corollary 25 ¹he total number of d-moves in X@ is finite.
flow f (i , i ) between moves m[i , x@ ] and m[i , z ] can only be
t t`1 t t t t
caused by either i or i making a flow move (executing S2, S3, or
t t`1 Proof. By Theorem 24, each node in G makes a finite number of
S4). Since we are considering a suffix of the execution sequence in decreasing d-moves. Since each d-move can decrease the d-value by
which no executions of S2 exist, we need consider executions of S3 at most n, the number of increasing d-moves by each node is also
and S4 only. It is easy to see that execution of S3 or S4 by node finite. Hence, the total number of d-moves by any node, and hence,
i cannot cause f (i , i ) to increase. Furthermore, since the total number of d-moves in the system, is finite. K
t t t`1
d(i )6d (n, between moves m[i , x@ ] and m[i , z ], node
t`1 t`1 t t t t Corollary 25 is the same as Lemma 11.
i cannot execute S4. Thus it has to be the case that node
t`1
i executes S3 between moves m[i , x@ ] and m[i , z ] and increases
t`1 t t t t
f (i , i ). But just before node i executes S3 and increases
t t`1 t`1
f (i , i ) it has to be the case that d(i )"d(i )#1. Since, between
t t`1 t`1 t
Sukumar Ghosh obtained his Ph.D. from Calcutta University in
moves m[i , x@ ] and m[i , z ], the d-value of node i is less than or 1971. From 1969 to 1984, he was a faculty member at Jadavpur
t t t t t`1
equal to d , the d-value of node i has to decrease to strictly less University, Calcutta. Since 1987 he is with the Computer Science
t`1 t
than d . Department of the University of Iowa, where he is currently a Profes-
t`1
2. (i , i )3E: In this case, just after move m[i , x@ ], sor. During 1976—77, he was with the University of Dortmund,
t`1 t t t
f (i , i )"c(i , i ). Since i 3IN(i , z ), we have that just before Germany as a Fellow of the Alexander von Humboldt Foundation.
t`1 t t`1 t t`1 t t
move m[i , z ], the edge (i , i )3E and f (i , i )(c(i , i ). Using His areas of interest include distributed systems, fault tolerance, and
t t t`1 t f t`1 t t`1 t
an argument similar to the one above, it can be easily shown that in self-stabilization. He is a member of ACM and IEEE.
this case, i has to decrease flow along the edge (i , i ) by execut-
t`1 t`1 t
ing S3, and hence, the d-value of node i has to decrease to strictly less
t
than d .
t`1 Arobinda Gupta received the B.E. and M.E. degrees in Electronics
Note that we have assumed that the d-value of i remains less than and Telecommunications Engineering from Jadavpur University,
t`1 Calcutta, India, in 1987 and 1990 respectively, and a M.S. degree in
or equal to d between moves m[i , x@ ] and m[i , z ]. If this is not
t`1 t t t t Computer Science from The University of Alabama in 1992. He is
true, then using the arguments in claim 1, we can always find a new
node i such that this condition holds and proceed similarly. K currently a doctoral candidate in the Department of Computer
t Science at The University of Iowa, Iowa City. His research interests
Theorem 24 Each node in G makes a finite number of decreasing moves are in distributed computation, fault-tolerance, and computer net-
in the worst case. works.
Proof. (by contradiction) Suppose that there is a node i in G that
0
makes infinitely many decreasing moves. Since the total number of
walks in T is finite, i makes an infinitely many decreasing moves
0
Sriram V. Pemmaraju obtained his Ph.D. in Computer Science in
with the same trace. Moves with the same trace have the same result. 1992 from Virginia Tech and has been a faculty member at the
So let d denote the result of some infinitely many decreasing moves University of Iowa, since then. He is interested in sequential and
0
by i with the same trace. From Lemma 23 we conclude that there is distributed algorithms for problems in graph theory and computa-
0
a node i in G that makes infinitely many decreasing moves with tional geometry.
1

View publication stats

You might also like