16
Systems and Computers i n Japan, Vol. 22, No. 8, 1991 Translated from Denshi Joho Tsushin Gakkai Ronbunshi, Vol. 72-DI, No. 5, May 1989, pp. 343-356 Efficient Distributed Algorithms Solving Problems about the Connectivity of Network Jungho Park and Nobuki Tokura, Members Faculty of Engineering Science, Osaka University, Toyonaka, Japan 560 Toshimitsu Masuzawa and Ken'ichi Hagihara, Members Toyonaka, Japan 560 Education Center for Information Processing, Osaka University, SUMMARY This paper presents efficient distribu- ted algorithms on an asynchronous network for the following problems: finding bi- connected components, finding cutpoints, finding bridges, testing for bi-connected- ness and finding strongly connected compon- ents of a directed graph defined on a net- work. All these distributed algorithms use a depth-first search tree having an arbitrary processor in the network as its root. communication complexity of these algorithms is O(nlogn+e) and their ideal-time complex- ity is O(nG(n)) , where n and e represent the numbers of processors and links, respective- ly, and G(n) is almost a constant. It is shown also that a lower bound for the commun- ication complexity of the five problems is Q(e) and a lower bound for their ideal-time complexity is Q(n). The 1. Introduction In a network, in general, processors and links sometimes are added or deleted. If a cutpoint or a bridge is removed from a network, some processors cannot communicate with each other. Also, messages tend to be concentrated near cutpoints and bridges mak- ing them a possible bottleneck for communi- cation. Thus, it is important to find the cutpoints and bridges of a network (here- after called the cutpoint problem and the bridge problem, respectively), to determine which of the adjacent links belongs to the same bi-connected component (hereafter called the bi-connected component problem) and t o test whether or not a network is bi- connected (the bi-connectedness problem). 1 In a network a processor may halt its operation or a recovery may take place (failure, or recovery from a failure or power onioff). Hence, it is more realistic to consider the network topology to be dy- namically changing rather than static. the topology of a network changes, its cut- points and bridges may also change. Hence, in the network environments in which the topology changes dynamically, it is better to let each processor manage its own topo- logical information rather than to let a central processor handle the topological information of the entire network. When When the information required to solve a problem is distributed over processors of the network and when an algorithm solves the problem by exchanging the distributed in- formation, the algorithm is called a dis- tributed algorithm. Although a number of distributed algorithms have been proposed [2, 5-81, no algorithms have been presented which obtain cutpoints, bridges or bi- connected components or which test to see whether or not a network is bi-connected. In this paper efficient distributed algor- ithms to solve these problems are presented. From the solution to the bi-connected component problem each processor can deter- mine whether or not it is a cutpoint and whether or not the adjacent link is a bridge. Hence, in this paper a distributed algorithm to obtain bi-connected components is shown first (Sect. 3). Then for the cutpoint and bridge problems, an idea to find solutions to these problems from the solution to the bi-connected component problem for each pro- cessor is explained briefly (Sect. 4). Also, for the problem of finding strongly 1SSN0882-1666/91/0008-0001$7.50/0 CD 1991 Scripta Technica, Inc.

Efficient distributed algorithms solving problems about the connectivity of network

Embed Size (px)

Citation preview

Systems and Computers i n Japan, Vol. 22, No. 8, 1991 Translated from Denshi Joho Tsushin Gakkai Ronbunshi, Vol. 72-DI, No. 5, May 1989, pp. 343-356

Efficient Distributed Algorithms Solving Problems about the Connectivity of Network

Jungho Park and Nobuki Tokura, Members

Facul ty of Engineering Science, Osaka Universi ty , Toyonaka, Japan 560

Toshimitsu Masuzawa and Ken' ichi Hagihara, Members

Toyonaka, Japan 560 Education Center f o r Information Processing, Osaka Un ive r s i ty ,

SUMMARY

This paper p r e s e n t s e f f i c i e n t d i s t r i b u - ted algori thms on an asynchronous network f o r t h e fol lowing problems: f i n d i n g bi- connected components, f i n d i n g c u t p o i n t s , f inding b r idges , t e s t i n g f o r bi-connected- ness and f ind ing s t r o n g l y connected compon- e n t s of a d i r e c t e d graph def ined on a net- work. All t hese d i s t r i b u t e d algori thms use a dep th - f i r s t search tree having an a r b i t r a r y processor i n t h e network as its r o o t . communication complexity of t hese algori thms is O(nlogn+e) and t h e i r ideal- t ime complex- i t y is O(nG(n)) , where n and e r ep resen t t h e numbers of processors and l i n k s , respect ive- l y , and G(n) i s almost a constant . It is shown a l s o t h a t a lower bound f o r t h e commun- i c a t i o n complexity of t h e f i v e problems is Q ( e ) and a lower bound f o r t h e i r ideal- t ime complexity is Q(n) .

The

1. In t roduc t ion

I n a network, i n gene ra l , p rocesso r s and l i n k s sometimes are added o r de l e t ed . I f a cu tpo in t o r a b r idge i s removed from a network, some p rocesso r s cannot communicate with each o the r . Also, messages tend t o be concentrated near c u t p o i n t s and b r i d g e s mak- ing them a p o s s i b l e bo t t l eneck f o r communi- ca t ion . Thus, i t i s important t o f i n d t h e c u t p o i n t s and b r idges of a network (here- a f t e r c a l l e d t h e c u t p o i n t problem and t h e br idge problem, r e s p e c t i v e l y ) , t o determine which of t h e ad jacen t l i n k s belongs t o t h e same bi-connected component ( h e r e a f t e r called t h e bi-connected component problem) and t o test whether o r no t a network i s bi- connected ( t h e bi-connectedness problem).

1

I n a network a processor may h a l t i t s ope ra t ion o r a recovery may t a k e p l ace ( f a i l u r e , o r recovery from a f a i l u r e o r power o n i o f f ) . Hence, i t i s more real is t ic t o cons ide r t h e network topology t o be dy- namical ly changing r a t h e r than s ta t ic . the topology of a network changes, its cut- p o i n t s and b r i d g e s may a l s o change. Hence, i n t h e network environments i n which t h e topology changes dynamically, it i s b e t t e r t o l e t each processor manage i ts own topo- l o g i c a l information r a t h e r than t o l e t a c e n t r a l processor hand le t h e topo log ica l information of t h e e n t i r e network.

When

When t h e information r equ i r ed t o s o l v e a problem i s d i s t r i b u t e d over p rocesso r s of t h e network and when an a lgo r i thm s o l v e s t h e problem by exchanging t h e d i s t r i b u t e d in- formation, t h e a lgo r i thm is c a l l e d a d i s - t r i b u t e d algori thm. Although a number of d i s t r i b u t e d a lgo r i thms have been proposed [2 , 5-81, no a lgo r i thms have been presented which o b t a i n c u t p o i n t s , b r i d g e s o r bi- connected components or which test t o see whether o r n o t a network is bi-connected. I n t h i s paper e f f i c i e n t d i s t r i b u t e d algor- i thms t o s o l v e t h e s e problems are presented.

From t h e s o l u t i o n t o t h e bi-connected component problem each p rocesso r can deter- mine whether o r n o t i t is a c u t p o i n t and whether o r n o t t h e a d j a c e n t l i n k is a br idge. Hence, i n t h i s paper a d i s t r i b u t e d algori thm t o o b t a i n bi-connected components i s shown f i r s t (Sect . 3). Then f o r t h e c u t p o i n t and b r idge problems, an i d e a t o f i n d s o l u t i o n s t o these problems from t h e s o l u t i o n t o t h e bi-connected component problem f o r each pro- ces so r is explained b r i e f l y (Sect. 4 ) . Also, f o r t h e problem of f i n d i n g s t r o n g l y

1SSN0882-1666/91/0008-0001$7.50/0 CD 1991 S c r i p t a Technica, Inc.

connected components (of t h e digraph def ined on the network), which i s similar t o t h e b i - connected component problem, an i d e a of a d i s t r i b u t e d algori thm t o so lve t h e problem is given (Sect. 5 ) .

In t h e network environment f o r t h e ex- ecu t ion of a d i s t r i b u t e d algori thm, t h e case gene ra l ly considered is the one i n which t h e amount of messages is dominant f o r t h e c o s t and the message t ransmission t i m e i s t h e major p a r t of t h e execution t i m e of t h e d i s t r i b u t e d algorithm. Hence, t h e e f f i c i e n - cy of a d i s t r i b u t e d algori thm i s evaluated by a communication complexity and an ideal- t i m e complexity.

The communication complexity i s t h e number of messages exchanged i n t h e network during t h e execut ion of t h e algorithm. I n many network models t h e r e i s no assumption on the message t ransmission t i m e except t h a t i t is f i n i t e (asynchronous networks). Thus t h e concept of so-cal led t i m e complexity cannot be appl ied. Thus, t h e ideal- t ime complexity ( t h e execution t i m e of a d i s - t r i b u t e d algori thm i n u n i t s of t h e message t ransmission t i m e ignoring t h e processing t i m e i n t h e processors) is adopted f o r t h e eva lua t ion measure of t i m e .

A l l f i v e a lgori thms proposed i n t h i s paper have communication complexity o ( izlogn -t c ) * and ideal-t ime complexity O(nC(n)).** Here n and e r ep resen t t h e num- be r s of processors and l i n k s , r e spec t ive ly . I t is shown a l s o i n t h i s paper t h a t a lower bound of t h e communication complexity of t h e f i v e forementioned problems i s Q(e) and t h a t t h a t of t h e ideal-t ime complexity is Q(n).

2. Def in i t i ons

2.1. Graph-theoretic d e f i n i t i o n s

A nondirected graph is def ined as an ordered p a i r G = ( V , E ) ; V is a nonempty set of v e r t i c e s and E i s a set of nondirected edges (unordered p a i r s of d i s t i n c t v e r t i c e s ) .

*For a r b i t r a r y i n t e g e r f u n c t i o n s f f n ) and g(n ) , i f t h e r e e x i s t s a p o s i t i v e i n t e g e r no and f o r a l l ~ i ~ ~ ~ o , / ( n ) S c d ~ ) , then w e wri te f f n ) = O ( g f n ) ) . Also, i f t h e r e are a p o s i t i v e number c ' and a p o s i t i v e i n t e g e r nl and i f f o r a l l ) 1 1 2 1 7 , , f O i ) Z c ' g ( ? i ) , then we w r i t e f ( n ) = R(gfn) ) . I f f f n ) = O(gfn) ) and f ( n ) = R(g fn ) ) , then we write f ( n ) = O(g(n)).

i n t e g e r k and such t h a t lon' (n)$ l , where **G(n) t akes as i t s value t h e smallest

By t h e d e f i n i t i o n , no m u l t i p l e edges o r s e l f - loops ex is t . Since only nondirected graphs are discussed i n t h i s paper , except i n Sect. 5, a graph i s def ined as a non- d i r e c t e d graph. then w e say t h a t u and v are ad jacen t and denote by NGfu)* t h e set of v e r t i c e s adja-

c e n t t o u { u E V I (u,v) E E } . degc(u), t h e degree of u , i s def ined as

I n G = ( V , E ) , i f (24, ?/)EE 1

~ l s o , u

I n G = ( V , E ) i f a sequence of d i s t i n c t v e r t i c e s < uil ...l U, > s a t i s f i e s (ui, ui+1) E E f o r each i(1 5 Z 5 m - I ) , t h e sequence is c a l l e d a V -V path and m - 1 i s i ts l eng th .

Moreover, t h e v e r t i c e s v and v are c a l l e d

t h e endpoints of t h e v -v path. I n p a r t i c -

u l a r , t h e sequence <v> c o n s i s t i n g of a ver- t ex t, i s considered a v-v path of l eng th 0.

1 m

1 m 1 m

I f f o r any two v e r t i c e s u s and v of G, t h e r e i s a V-v path, G i s s a i d t o be connec- ted. The d i s t a n c e dG(u, v ) between two ver-

t ices U, and v of G i s def ined t o be t h e l eng th of t h e s h o r t e s t u - v path. I f t h e r e is no u - v pa th , then dG(u, v ) = m.

I f t h e r e are a v 1 - v path < 211, ...,Urn > m m' of l e n g t h two o r l a r g e r and an edge (V

v , ) , t h e v e r t e x sequence < Ul, . . . ,V,, , ,~i > i s

c a l l e d a c losed path. A connected nondirec- t ed graph without any c losed palrhs i s c a l l e d a tree. I n p a r t i c u l a r , i f a s p e c i f i c v e r t e x (cal l i t i) is designated as t h e r o o t of a tree, i t i s c a l l e d a roo ted tree with r o o t i. For a rooted tree T wi th r o o t is t h e following terms are defined.

p a r e n t , c h i l d : L e t u and v be two ad jacen t v e r t i c e s .

1 ho lds , v is t h e pa ren t of u and u is a c h i l d of V . The pa ren t of u i s denoted by PARTfu) and t h e set of c h i l d r e n of v i s de-

noted by SONT(V).

I f d fi, v ) = d T ( i , u ) - T

ances to r , descendant: L e t u and v be a r b i t r a r y v e r t i c e s . I n a tree an i- v path i s uniquely determined. I f a v e r t e x appears on t h i s i - v path, u i s c a l l e d an

U

*When t h e graph G i s obvious from t h e con tex t , Nfu) i s used i n s t e a d of N (u).

G Simi la r ly , f o r degG(u), dG(u, v ) , PART(u),

SONTfu), ASCTfu), DECTfu) .

2

ances to r of v and v i s c a l l e d a descendent of u (u i tsel f i s its a n c e s t o r and descen- dant) . The set of t h e a n c e s t o r s of u i s de- noted by ASCT(u) and t h a t of t h e descendants

DECT (u) . For graphs G = (V, E) and G ' = ( V ' , E ' ) ,

i f v' C V , and E' subgraph of G and denoted by G' c G. subgraphs t h e fol lowing terminology and con- vent ions are used.

E hold, G ' is c a l l e d a For

. spanning tree: L e t G ' = (V ' , E ') be a subgraph of G = ( V , E l . I f V' = V and G' i s a tree, G' is c a l l e d a spanning tree of G.

induced subgraph: For a graph G = ( V , E) and a subse t s(c v), a subgraph ( S , ( ( U , V ) E E I u E s and u E s}) of G is c a l l e d t h e subgraph of G induced by S and den0 ted by G [ S ] .

sub t r ee : L e t w be an a r b i t r a r y ver- Then T[DECT(w)] is tex of a rooted tree T.

c a l l e d a s u b t r e e of T roo ted a t W.

connected component: A maximal con- nected subgraph of G is c a l l e d a connected component of G.

G - u: L e t u be an a r b i t r a r y v e r t e x of a graph G = (V, E). Then t h e graph G [ V - { u ) ] i s denoted by G - u.

G - (u, v ) : L e t {u, v ) be an a rb i - t r a r y edge of a graph G - (V, E ) . graph (V, E - {(u, v ) ) ) is denoted by G -

Then t h e

(u, v ) .

Next t h e terminology on connectedness of a graph i s defined.

cu tpo in t : L e t u be an a r b i t r a r y ver- t ex of a connected graph G; u i s c a l l e d a cu tpo in t i f and only i f t h e number of con- nected components of G - u is g r e a t e r than o r equal t o 2.

bi-connectedness: A graph G i s b i - connected i f and only i f i t is connected and i t h a s no cu tpo in t s .

bi-connected component: A m a x i m a l bi-connected subgraph of a graph G i s c a l l e d a bi-connected component of G.

br idge: L e t (u, V ) be an a r b i t r a r y edge of a connected graph G; (u, V ) is c a l l e d a b r idge i f and only i f t h e number of connected components of G - (u, V ) i s g r e a t e r than o r equal t o 2.

2.2. D e f i n i t i o n s on network and a lgo r i thm

Simple d e f i n i t i o n s are g iven on net- works and d i s t r i b u t e d algori thms. t a i l s of t h e s e d e f i n i t i o n s , see [3] .

For de-

Definition 1. A processor network (simply a network h e r e a f t e r ) N i s def ined by an ordered p a i r N = (P , L ) . Here P i s t h e set of p rocesso r s and L is t h e s e t of l i n k s (unordered p a i r s of d i s t i n c t p rocesso r s ) .

A processor U is a RAM (random access machine) [ l ] having a set of p o r t s PO(u) = 1, ..., degG(U) and i t can execu te t h e send

and r e c e i v e commands given below. ces so r h a s an i d e n t i f i e r d i f f e r e n t from t h e o the r s . Each p o r t is i n one-to-one corre- spondence t o a l i n k a d j a c e n t t o u and i f a p o r t a of u corresponds t o a l i n k (u, v ) , t h e correspondence i s expressed as ~ ( u , a ) = (U, V ) . The l i n k (u, V ) i s considered as a complete double l i n k through which u and v can send messages independently.

Each pro-

For each l i n k (u, v ) connected t o u, u h a s a message ou tpu t queue t o V , Q(u -+ v ) and a message i n p u t queue from V , Q(u + v ) . &(ti + v ) , and &(u f V ) are assumed t o be an FIFO ( f i r s t - i d f i r s t - o u t ) queue [ l ] without any r e s t r i c t i o n on i t s l eng th .

(1) RECEIVE(M): M is a v a r i a b l e t o memorize t h e message and t h e p o r t number corresponding t o t h e l i n k which received t h e message. a r b i t r a r y message is s e l e c t e d and t h a t f i r s t message and t h e p o r t number corresponding t o i t s i n p u t queue are s t o r e d i n M. This means t h a t t h e message h a s been received. I f a l l t h e i n p u t queues are empty, a dummy va lue i s s t o r e d i n M, which i n d i c a t e s t h a t u h a s no i n p u t queue con ta in ing a message.

From t h e i n p u t queue f o r u an

(2 ) S W ( a , rn)(a E PO(u) , rn i s a v a r i - a b l e ) : L e t p(u, a) = (u, V ) . Add t h e con- t e n t of m as t h e las t element of t h e output queue Q(u + V ) t o an ad jacen t processor V .

Since from t h e d e f i n i t i o n a network N can be considered as a nondirected graph, t h e terminology and symbols f o r nondirected graphs are used f o r N. I n t h e following d i scuss ions t h e numbers of p rocesso r s and l i n k s i n a network are denoted by n and e , r e spec t ive ly .

The fol lowing assumptions are made f o r networks.

Asstaption 1. There is no common mem- o ry i n a network and t h e i n t e r p r o c e s s o r communication is performed by message ex- changes through l i n k s . The message p u t i n

3

v l n

Fig. 1. A s o l u t i o n of t he BCC problem.

t h e queue Q(u -+ v) by processor u is placed i n t h e i n p u t queue Q(v f U) of i n a f i n i t e amount of t i m e without any l o s s i n t h e o rde r they were put i n t o t h e queue by u.

Assumption 2. I f processor v executes t h e command RECEIVE repeatedly, a message i n the inpu t queue of v even tua l ly i s received. That is, t h e RECEIVE command i s executed f a i r l y f o r a l l t h e inpu t queues of V .

Definition 2 (The problem of f ind ing

Each processor u g ives a t h e bi-connected components-abbreviated a s BCC h e r e a f t e r ) . l a b e l t o each l i n k ad jacen t t o i t which s a t i s f i e s t h e fol lowing condi t ion. l a b e l of l i n k e given by processor u i s de- noted by L(u, e ) .

Here t h e

L e t u and v be processors and l e t e and e' be a r b i t r a r y l i n k s connected t o u and V , r e spec t ive ly . Then L(u, e ) = L(u, e ' ) i f and only i f e and e' belong t o t h e same bi- connected component.

Example 1. Figure 1 shows an example of a s o l u t i o n t o a BCC problem. I n Fig. 1, t h e number a t t ached t o each l i n k (u, U) in- d i c a t e s t h e l a b e l given by t h e p rocesso r s u and v a t e i t h e r end of t h e l i n k .

Definition 3. A d i s t r i b u t e d a lgo r i thm c o n s i s t s of t h e programs executed by pro- cessors . A processor which starts t h e exe- c u t i o n of a program autonomously i s c a l l e d a s t a r t i n g processor. The processors o t h e r than t h e s t a r t i n g processors start execut ing t h e i r programs a f t e r they r ece ive messages from o t h e r processors. It is assumed t h a t one o r more s t a r t i n g processor begins exe- cu t ing programs with a l l the queues empty.

Depending on the s t a r t i n g processors , t ransmission de lays of messages and process- ing speeds of processors , v a r i e t i e s of exe- cu t ion can t ake place. However, f o r any execution when a l l t h e processors f i n i s h

execut ing t h e i r program a f t e r a f i n i t e num- be r of execut ions of commands, t h e d i s t r i b u - t ed a lgo r i thm i s s a i d t o have been termin- a ted. A d i s t r i b u t e d algori thm is s a i d t o s o l v e a BCC problem i f i t t e rmina te s a f t e r a f i n i t e amount of t i m e and each processor has f o r each ad jacen t l i n k a l a b e l which i s a s o l u t i o n t o t h e BCC problem.

A s s q t i o n 3. Each processor executes t h e same program.*

Assumption 4. A t t h e start of a d i s - t r i b u t e d a lgo r i thm each processor u knows t h e i d e n t i f i e r of u and t h e number of each of i t s por t s . .

A s s q t i o n 5. During t h e execut ion of a d i s t r i b u t e d algori thm no a d d i t i o n o r dele- t i o n of p rocesso r s o r l i n k s t akes p l a c e , and no f a i l u r e occurs among them.

A d i s t r i b u t e d a lgo r i thm gene ra l ly i s evaluated by t h e amount of message and t i m e . Since t h e t i m e eva lua t ion is not easy be- cause of t h e d i f f e r e n c e s i n message t r ans - mission delay and processing speed of a pro- ces so r , t h e concept of ideal-t ime complexity i s used.

Definition 4. The c o m u n i c a t i o n com- p l e x i t y i s t h e number of messages exchanged between a l l t h e p rocesso r s of t h e network i n t h e worst ca se during t h e execut ion of a d i s t r i b u t e d algorithm. The ideal-t ime com- p l e x i t y i s t h e amount of t i m e t o f i n i s h the execut ion of an algori thm measured i n u n i t s of t h e message t ransmission time through a l i n k ignoring processing t i m e by processors .

3. Algorithm t o Solve Bi-Connected Component Problem

This paper cons ide r s only connected graphs. I n t h e fol lowing, G = (V, E ) is an a r b i t r a r y connected network.

I n t h i s s e c t i o n a d i s t r i b u t e d algori thm ABCC ( t h e Algorithm of f i n d i n g t h e Bi-Con- nected Component) t o so lve t h e BCC prob- l e m i s presented. I n ABCC, t h e BCC problem i s solved using a d e p t h - f i r s t search span- ning tree [ l ] . Therefore , t h e concept of d e p t h - f i r s t s ea rch spanning tree and i ts p r o p e r t i e s are shown f i r s t .

~

*Some of t h e c o n s t a n t s used i n t h e pro- grams ( f o r example, i d e n t i f i e r s ) may have d i f f e r e n t va lues .

4

3.1. Dep th-f irs t sea rch spanning tree vl

L e t i be an a r b i t r a r y processor of G. A d e p t h - f i r s t s ea rch spanning tree wi th r o o t i i s a spanning tree obtained by t h e depth- f i r s t s ea rch [ l ] s t a r t i n g a t i. For each processor u t h e o rde r of u i n t h e sea rch is c a l l e d t h e d e p t h - f i r s t number. That is , i f u i s reached k-th (Osks 11- 1 ) , then t h e dep th - f i r s t number of u i s k. The depth- f i r s t number of i i s 0. I n gene ra l , t h e r e is more than one d e p t h - f i r s t search i n G s t a r t i n g a t i. One of them i s s e l e c t e d a rb i - t r a r i l y and t h e d e p t h - f i r s t search spanning tree generated by t h e sea rch i s denoted by T. The d e p t h - f i r s t number of a processor u by t h a t search i s denoted by DFSfu).

ExampZe 2. I n Fig. 2 , a d e p t h - f i r s t

1 search tree with r o o t t, ( s o l i d l i n e ) is

shown. The numbers i n t h e v e r t i c e s are t h e depth- f i rs t numbers .

Property 1 [ l ] . L e t u be an a r b i t r a r y processor. I f ~ € N c ( u ) , then u € A S C T ( U ) U D E C r ( u ) . A l s o , f o r an a r b i t r a r y w ( E A S C T ( a ) ) , D F S ( u ) ~ D F S ( Z U ) holds.

3 . 2 . P r o p e r t i e s of bi-connected compon- e n t and d i s t r i b u t e d a lgo r i thm

There are numerous sequen t i a l a lgori thms t o ob ta in c u t p o i n t s and bi-connected compon- e n t s using a d e p t h - f i r s t search tree and dep th - f i r s t numbers [ l , 91. I n a s e q u e n t i a l algorithm, a l l t h e information on t h e graph can be used by a s i n g l e processor. However, i n t he case of a d i s t r i b u t e d algori thm, each processor u must so lve t h e BCC problem on u ( t h e l a b e l s of t h e bi-connected components t o which t h e l i n k s connected t o u belong) using only l o c a l information a c c e s s i b l e by u and t h e messages received. Thus, h e r e , t o see how a s o l u t i o n t o t h e BCC f o r each pro- cessor can be obtained using a p a r t i c u l a r kind of information, t h e r e l a t i o n s h i p s be- tween an a r b i t r a r y d e p t h - f i r s t s ea rch tree T and bi-connected components of G are i n v e s t i - gated. T.

I n t h e fol lowing, i i s t h e r o o t of

Among t h e p rocesso r s ad jacen t t o u i n T, t he one w i t h t h e least d e p t h - f i r s t number is denoted by N E G ( u ) and among N E G ( v ) of t h e descendants v of u , t h e least one i s denoted by SUB(u). defined as fol lows:

That is, N E G ( u ) and SUBfu) are

Proposition 1 [ l ] . L e t u be a n a rb i - t r a r y processor of G ; u is a c u t p o i n t of G

. -

Fig. 2. A d e p t h - f i r s t s ea rch tree and d e p t h - f i r s t s ea rch numbering.

i f and only i f t i o n s holds:

(1) u = i

( 2 ) u*i

one of t h e fol lowing condi-

and I SON,( u ) I 2 2 ; and

and t h e r e e x i s t s V E SONT( Z I ) such t h a t SUB(v)SDFS(u).

E x a v p l e 3. I n Fig. 2 , t h e number t o t h e r i g h t of each v e r t e x v SUB(vi). The c u t p o i n t s i n Fig. 2 are v and

v 2 , and f o r v and f o r v 2 , ( 2 ) of P ropos i t i on 1 holds.

r e p r e s e n t s i 1

(1) of P r o p o s i t i o n 1 ho lds , 1'

Lemma 1. L e t u be an a r b i t r a r y cut- p o i n t of G. L e t v b e an a r b i t r a r y processor s a t i s f y i n g S U B ( v ) h D F S ( u ) and V € S O N T ( U ) and l e t G' be t h e bi-connected component t o which u and v belong. w EN^ u ) m E C r ( u ) ) belongs t o G ' .

Then an a r b i t r a r y

Proof. Suppose t h a t w does no t belong

Since t o G ' . Then w * V L e t <u, ( ~ , X I ( = V ) , X ~ , ..., xm, w > (m21) be a u- w pa th i n 7'. w does n o t belong t o G ' , t h e r e i s an i (1 5 is m) such t h a t cc i s a c u t p o i n t and i u and w belong t o d i f f e r e n t bi-connected com- ponents i n G -2 . .

u and w cannot belong t o d i f f e r e n t bi-connec- t ed components.

S i m i l a r l y , t h e fol lowing lemma can be

However, s i n c e ( U , w ) E E 2

proven.

L e m 2. L e t u be an a r b i t r a r y pro- ces so r of G o t h e r t han i and l e t G' be t h e bi-connected component t o which u and PART(u) belong. Then DFS(w) < DFS(u) and an

a r b i t r a r y processor wENc(?d) belongs t o G ' .

Theorem 1. L e t u be an a r b i t r a r y pro- ces so r of G. t h e fol lowing (1) and (2) hold.

For bi-connected components,

5

(1) L e t v and # be a r b i t r a r v p rocesso r s Phase 1. Using t h e method of [ 2 ] . , - - belonging t o SONT(u) and NGfu) , r e spec t ive ly .

I f DFs(u)SsUB(v) holds, then u i s t h e

select an a r b i t r a r y processor as t h e l e a d e r (denote t h e l e a d e r by i).

Phase 2. Using t h e method of [ 5 ] per- processor with t h e least d e p t h - f i r s t numbers i n t h e bi-connected component con ta in ing 1.4 and v ( c a l l i t G'). Furthermore, a neces- sary and s u f f i c i e n t condi t ion f o r t) t o be- long t o G ' is t h a t w E D E C T ( V ) holds.

form a d e p t h - f i r s t s ea rch on G s t a r t i n g a t i and cons t ruc t a d e p t h - f i r s t s ea rch tree with r o o t i (call i t 4 ) . That is, a t t h e end of Phase 2 , each processor u knows t h e p o r t number t o PART(u), t h e set of p o r t numbers

t o SONT(u) and D F S f u ) . ( 2 ) L e t U* i and l e t G" be t h e b i -

connected component containing u and PARTfu).

A necessary and s u f f i c i e n t cond i t ion f o r w ( € N c ( u ) ) t o belong t o G" i s t h a t one of t h e following ( i ) o r ( i i ) holds.

(i) There e x i s t s v such t h a t ZE S O N T ( U ) and D F S f u ) > SUBfv), and w E D E C T ( v ) .

( i i ) D F S f # ) < D F S ( u ) (W is an ances to r of 2.4).

A b r i e f proof. Proof of (1): I f u = i, then u obviously has t h e least d e p t h - f i r s t

Phase 3. By exchanging messages be- tween t h e ad jacen t p rocesso r s , each process- o r o b t a i n s t h e d e p t h - f i r s t numbers of t h e ad jacen t processors . That is, a t t h e end of Phase 3, each processor u knows N E G f u ) .

Phase 4 . By v i s i t i n g t h e v e r t i c e s i n t h e ascending o rde r of d e p t h - f i r s t number from i, o b t a i n t h e bi-connected components based on Theorem 1.

The d e t a i l s of Phase 4 are given below.

From Theorem 1 i f t h e following ( a ) , number among t h e processors of G'.

( b ) , ( c ) and (d) are obtained f o r each pro- ces so r u, u can determine which of t he l i n k s connected t o u belong t o which bi-connected component :

I f U # 2 , then by P ropos i t i on 1, u i s a cu tpo in t and u i s t h e processor w i th t h e l e a s t d e p t h - f i r s t number i n G' . Using Lemma 1, i t can be proven t h a t w E G' i f and only i f IU E DECT.

Proof of ( 2 ) . 0 Suff ic iency: (i) i f f o r lv(€SON~(u)) DFs(U)>.?uB(v) holds, then t h e r e i s a processor among t h e process- o r s of DEC ( v ) which i s ad jacen t t o pro-

ces so r s of A S C r ( u ) - { U ) Hence, V and PART(u) belong t o t h e same bi-connected c o w

ponent ( i . e . , G ' ) . From Lemma 1 WE D E C T ( v ) belongs t o G"; ( i i ) i s obvious from

Lema 2.

T

@ Necessity. The con t r apos i t i on w i l l be proven. Suppose t h a t n e i t h e r (i) nor ( i i ) holds f o r w ( € N G ( u)) Then t h e r e i s z such t h a t z E S O N T ( U ) and D F S ( u ) S S U B ( z ) and

w E D E C r ( z ) holds. l e a s t d e p t h - f i r s t number i n t h e bi-connected component containing u and z (denoted by G"') , and # belongs t o G"'. Since u h a s t h e least d e p t h - f i r s t number among t h e process- o r s of G"', PARTfu) is not contained i n G'".

Hence, t h e con t r apos i t i on holds .

From (1) u h a s t h e

3.2.1. D i s t r ibu ted algori thm ABCC

( a ) D F S ( u ) ;

(b) f o r each v(E S O N T ( U ) ) , SUB(V);;

( c ) f o r each v ( E N ~ ( u ) ) , D F S ( v ) ; and

(d) f o r each w(E NG(u) f3 D E C T ( U ) ) , a p o r t number t o v such t h a t 'u

so&(.) and w E DECT(V) .

To o b t a i n (d ) , it is s u f f i c i e n t t o f i n d max{ DFS(v) I v E SONT(U) DFS(V) 5 D F S ( w ) } . That is , s i n c e (d) i s obtained from (b) and (c) f o r each u , ( a ) , (b ) , and (c) are needed.

such t h a t

( a ) and (c) can be obtained i n Phases 2 and 3, r e s p e c t i v e l y ; (b) is obtained i n Phase 4 . F i r s t , messages and v a r i a b l e s used i n ABCC are explained b r i e f l y .

3.2.1.1. Message

(1) <SRT(h)>: This is the message f o r v i s i t i n g p rocesso r s i n t h e ascending o rde r of t h e dep th - f i r s t number and it i s s e n t from a pa ren t t o its ch i ld ren ; h (20) is t h e number of bi-connected components ob ta ined a t t h e t i m e of t h e t r ansmiss ion of <SRT(h)>.

The d i s t r i b u t e d algori thm ABCC c o n s i s t s (2) < B I C ( h ) > : This i s t h e message used of t h e fol lowing four phases. by t h e processor of G ' w i t h t h e least

6

depth- f i r s t number t o inform each processor of G’ t h a t t h e l a b e l of G’ i s h when t h e h-th bi-connected component ( c a l l i t GI) is obtained.

(3) <TfvaZ, h ) > : This i s t h e message used t o v i s i t t h e processors i n t h e ascend- ing order of depth- f i r s t number and i t is sent from u t o P A R T ( u ) when t h e ch i ldren of

processor u have been v i s i t e d ; vaZ represents SUB(u) and h ( 2 0 ) i n d i c a t e s t h e number of bi-connected components obtained by t h e t i m e <T(val, h)> i s sent . It i s sometimes c a l l e d a T message.

3.2.1.2. Variable

Each processor has t h e following l o c a l var iables:

(1) FAu: It s t o r e s the p o r t number t o

PART (u) . (2) CHu: It s t o r e s t h e set of por t num-

bers t o SONTfu).

(3) DNu. It s t o r e s D F S f u ) .

For t h e t h r e e foregoing v a r i a b l e s t h e cor rec t va lues are set i n Phase 2 and they a r e not changed a f t e r t h a t .

( 4 ) PCHu: A t t h e end of Phase 4 i t

s t o r e s the set of p o r t numbers t o t h e pro- cessors i n { V E SONT(U) I SLIB(V) < D F S ( u ) } . These va lues are set i n Phase 4 . Hence, a t t h e beginning of Phase 4 PCHu = $ holds.

(5) mu: It s t o r e s S U B f u ) . Since t h i s

value i s set i n Phase 4 , a t t h e start of Phase 4 , CPu = N E G f u ) holds ( t h i s va lue is

s e t i n Phase 3).

( 6 ) NRu: It s t o r e s t h e set of t h e p o r t

numbers corresponding t o those not y e t labeled among t h e adjacent l i n k s . beginning of Phase 4 , NRu - Nu holds.

A t t h e

( 7 ) Du: It s t o r e s t h e p o r t number t o

t h e processor with t h e least depth- f i r s t number among t h e unvis i ted processors i n S O N T ( u ) .

i t has t h e value 0.

When t h e r e are no such processors ,

( 8 ) BCu: It s t o r e s t h e set of p o r t

numbers corresponding t o t h e l i n k s of NRu

which are known t o belong t o t h e same bi- connected Component.

A t t h e start of Phase 4 , each processor knows t h e d e p t h - f i r s t numbers of t h e adja- cent processors. However, s i n c e t h e var i - ab les which s t o r e them do not appear i n Phase 4 , they are omitted.

(9) STu: It s t o r e s t h e state of u. The s ta te of u is one of t h e following:

* Waiting s t a t e : The state of u a t t h e beginning of Phase 4 .

End of v i s i t s t a t e : The state i n which a l l t h e d s ( E sor\’~(u)) have been v i s i t e d .

Terminal s t a t e : The s ta te a f t e r t h e execution of t h e program.

3.2.1.3. An o u t l i n e of Phase 4

Phase 4 starts when i sends t o ~ ~ ( € S O N T ( Z ) ) with D F S f p ) = 1 t h e message <SRT(O)> t o v i s i t t h e processor.

I f t h e processor which has received < S R T ( h ) > ( h >_ 0) is not a l e a f , i t sends <SRT(h)> t o t h e c h i l d with t h e least depth- f i r s t number. I f i t i s a l e a f , then s i n c e v does n o t have ch i ldren , t h e message < T f S U B f v ) , h ) > (here S U B f v ) = NEGfu) holds) ind ica t ing t h e end of t h e v i s i t s t o t h e ch i ldren of v is s e n t t o t h e parent .

Each u executes A o r B below when i t receives < T ( v a l , h ) > from a c h i l d V . Here V a l is S U B f v ) .

A. D F S f u ) > S U B ( v ) holds

From Theorem 1, u, V , and PART(u) be-

long t o t h e same bi-connected component; u adds t h e p o r t number t o v t o t h e v a r i a b l e PCHu.

are v i s i t e d according t o t h e i r depth- f i r s t numbers. I f a l l t h e ch i ldren have been v i s i t e d , then <T(SUB(u) , h ) > is s e n t t o

I f t h e r e are unvis i ted ch i ldren , they

P A R T f U ) .

B. DFS(zi)SSUB(u) holds

From Theorem 1, u is t h e processor with t h e least d e p t h - f i r s t number among t h e pro- cessors i n t h e bi-connected component ( c a l l it G I ) containing u and V ; u sends v t h e message < B I C ( h + 1)> which informs t h a t t h e ( h + 1)-th bi-connected component has been found; < B I C ( h + 1)> is s e n t t o a l l the pro- cessors of G’ through T; u gives t h e l a b e l h + 1 t o t h e l i n k (u, z ) between u and each

7

Table 1 . Phase 4 of Algorithm ABCC

3 M

.,+

.,+

3

E U

m

(a) Program f o r root processor i Message from v

<T(val.h)> S(v,CBIC(h+l)>), Del(v.CH), D:=nEle(CH),

Operation

S tar t D:=nEle(CH), S(D.(SRT(O)>), Rec(r).

D=O+Alo(NR.h+l), S k t e r m i n a t e ( i f h - 1, G i s bi-connected) D # 0 +BC:=Se 1 (NR, A , B) , Del(BC ,NR), Alo (BC, h+l), S(D, (SRT (h+ 1) >) , Rec (I),

Message from v

<SRT(h)>

(T(val,h)>

(BIC(h)>

Operation

D:=nEle(CH), D # O+S(D,(SRT(h)>), Rec(r).

CP:=min(CP,val). Del(v,CH). D:=nEle(CH), DN>val+Ins(v,PCH), D = O+S(FA,(T(CP,h)>), S k v i s i t e d , Rec(m) . DN 6val+S(v, (BIC(h+ 1) >) ,

D = O+S(FA,<T(CP,h)>), =:=v i s i t ed , Rec(m) .

D # 0 +S(D,<SRT(h)>), Rec(I).

D = 0 +BC.=Sel(NR,A.m), Dal(BC.NR), Alo(BC,h+l), S(FA, <T(CP, h+l)>) ,

D f 0 +BC:=Sel(NR,A, B) , Del(BC,NR), Alo(BC.h+l), S(D, (SRT(h+l) >), Rec(m). ST= V i s i t ed , Rec (I).

IPCHI=O+Alo(NR,h), ST= terminate. IPCHl #O+S(PCH,<BIC(h)>), Alo(NR,h), ST:= terminate.

1) A + B means t o execute B when A holds. 2) S(X, m) i s a shor t fo r SEND(X, m) and Rec(m) is f o r RECEIVE(M). If X is

a s e t , then S(x, m) is executed simultaneously f o r each x E X. 3 ) I f the message received by Rec(m) command is dummy, then Rec(m) is re-

peated. 4 ) The commands separated by commas a r e executed sequen t i a l ly . 5 ) The command Del(X, S) on a s e t va r i ab le S and a s e t v a r i a b l e X over the

power s e t of S de le t e s X from S , and MEl(S) s e l e c t s a por t leading t o the processor with the smal les t dep th - f i r s t number. If S i s empty, 0 is re- turned. I n Se l (S , A , B) A denotes the dep th - f i r s t number of the processor which sen t <(T(va l , h ) > and B g ives the dep th - f i r s t number of the processor corresponding t o the por t i n D,; Sel(S, A, B) s e l e c t s from the s e t S the s e t of po r t s leading t o the processors with dep th - f i r s t numbers g r e a t e r than A and l e s s than B. Also, Alo(S, h) l a b e l s the l i n k s corresponding t o the elements of S with l a b e l h.

s en t i n r e a l i t y ) .

cessors u other than the root .

6 ) The messages not shown i n the t a b l e a re ignored (such messages a r e not

7 ) (a ) shows the va r i ab le s o f the root i and (b) l ists the va r i ab le s of pro-

message from <BIC(h)>.

Phase 4 are shown i n Table l.*

a l l of i t s c h i l d r e n and sends z E NG(u) fl DEC=(v). bi-connected component has been ob ta ined , i f a l l t h e c h i l d r e n of u have been v i s i t e d , u sends <T(SUB(u), ( h + 1 ) > t o PART(u).

t h e r e are u n v i s i t e d c h i l d r e n , <SRT(h + 1 ) > is s e n t t o t h e c h i l d w i t h t h e least depth- f i r s t number. Phase 4

Since t h e ( h + 1) - th

The o p e r a t i o n o f each p rocesso r i n I f

3 . 2 . 1 . 4 . An example o f execu t ion of

F i g u r e 3(a) shows tha t t h e message <SRT(O)> is s e n t t o p rocesso r s V l , v 2 , v 4 , and v7 i n t h a t o rde r .

Each processor w which h a s r ece ived <BIC(h + 1)> from FAR ( w ) g i v e s the l a b e l T h + 1 t o a l l t h e a d j a c e n t un labe led l i n k s . They then send <BIC(h + 1 ) > t o t h e a d j a c e n t p rocesso r s corresponding t o the p o r t numbers, belonging t o FCHw and t h e a lgo r i thm i s ter-

minated.

*In Table 1 , t h e p a r t performed by t h e r o o t i and the p a r t done by t h e o t h e r pro- c e s s o r s are shown s e p a r a t e l y . I n r e a l i t y , each p r o c e s s o r has bo th p a r t s as a program. However, on ly the p rocesso r s e l e c t e d as t h e l e a d e r i n Phase 1 performs t h e p a r t f o r the

Phase 4 ends when i r e c e i v e s t h e T r o o t .

8

v1

V v4

1

V

( C ) (d)

Fig. 3. An example of the execution of the algorithm ABCC.

In Fig. 3(b), the visits to the chil- dren of V , and V have been completed, and V , and IJ send messages < T(2(= SUB(V.I)) , 4 0) > and < T(2(= S U B ( v ~ ) ) , O ) > to their parents v 4 and v respectively. When v 2 receives < T((2) ,0) >, from DFS(v2) I SUB(vd), it can be seen that the first bi- connected component (i. e., the one with label 1) has been found.

4

2'

In Fig. 3(c), V 2 sends to V the mess- 4 age < B E ( 1) > informing that the bi-connected component with label 1 has been obtained and to visit the unvisited v sends to v 5 5 <SRT ( 1 ) > .

In Fig. 3(d), since the bi-connected component with label 1 has been obtained and since v which has received <SRT( l )> from v 2 , k.as no children, < T(1 = S U B ( U S ) ) , 1) > is sent to v 2 ; v 2 , upon receiving <T(1) , 1> sends to v1 < T(1(= SUB(v2)), 1) > because of

5'

DFS(V2) > sum5).

3 . 2 . 2 . Validity of distributed algor- ithm ABCC

To prove the validity of the distribu- ted algorithm ABCC, the following will be shown :

(1) ABCC terminates within a finite amount of time (Lemma 3).

(2) At the termination of ABCC the labels each processor assigns to its adja- cent links form a solution to the BCC prob- lem (Lemmas 10, 11).

L e m 3. ABCC terminates within a fin- ite amount of time.

Proof outline. Phases 1 and 2 of the distributed algorithm ABCC terminates within a finite amount of time [2, 51. Phase 3 obviously stops within a finite amount of time. is done by each processor by visiting pro- cessors in the ascending order of depth- first number, Phase 4 terminates after a finite amount of time.

Also since in Phase 4 the processing

9

Definition 5. For an a r b i t r a r y posi- t i v e in teger h, l e t PLI,={PE I/ 1 when a l l t h e processors a r e i n t h e terminal s t a t e , p is a processor which gave t h e l a b e l h t o a t l e a s t one of t h e l i n k s connected t o i t ) and let GLh = G[PLh].

To show t h a t t h e l a b e l s given t o t h e adjacent l i n k s by each processor a t t h e ter- mination of ABCC form a so lu t ion t o the BCC problem t h e following w i l l be proved:

0 G[PLh] i s bi-connected (Lemma 10).

@ h is given t o a l l t h e l i n k s of G[PLh] (Lemma 11).

Lemmas 4 through 6 can e a s i l y be proven from t h e algorithm. Although PCHu i s t h e

v a r i a b l e which memorizes the p o r t numbers t o the processors i n ( v E S O N r ( U ) I SUB(v)< D F S ( u ) ) , i n t h e following, f o r s impl ic i ty , it i s considered t o memorize the set of pro- cessors connected through those p o r t s ( i . e . , ( 2 , ~ ~ ~ ~ r ( ~ ) l S U B ( V ) < D F S ( U ) ) ) .

Lemma 4. Let u be an a r b i t r a r y pro- cessor. When u sends out a T message, t h e following holds:

(1) L e t < T(vUl,h) > be t h e T message. Then V a l = SUB(u) holds.

(2) For v a r i a b l e PCH P C H , = u s { v E S O N T ( U ) I SUB(v)<DFS(u)) holds.

L m a 5. An a r b i t r a r y processor u sends out < B I C ( h ) > t h e following holds:

i f and only i f one of

0 When < T(va l ,h - 1 ) > such t h a t valzDFS(u) i s received < B I C ( h ) > i s sent t o t h e processor which s e n t t h i s < T(val,h - 1) >.

@ When < B I C ( h ) > i s received and PCH, # 4, < B I C ( h ) > is s e n t t o each pro- cessor i n PCH

U'

Lemma 6. An a r b i t r a r y processor u gives a l a b e l h t o t h e adjacent l i n k s i f and only i f i t receives e i t h e r < B I C ( h ) > o r < T ( v d , h - 1) > with v d 2 DFS(u) .

To show t h a t GL is bi-connected, the h condi t ion of Theorem 1 w i l l be shown t o hold f o r each u E PL,, (Lemma 8).

Lema 7. For an a r b i t r a r y h ( 4 n- 1 ) t h e r e e x i s t s only one w t h a t receives < ?'(Val, h ) > with val 2 D F S ( w ) .

Proof. Each u, when i t rece ives < T ( v a f , h )> with va lhDFS(u) , sends (BZC(h+l)> t o t h e v which sen t < T ( v a l , h ) ) t o it. t h e ascending order of depth- f i r s t number, u sends ( T ( S U B ( u ) , h + l ) > or ( S R T ( h + l ) ) by Lemma 4 . A t t h i s po in t the parameter t o determine t h e l a b e l of a bi-connected com- ponent is 3c + 1. This parameter is nonde- creasing monotonically. Hence, t h e r e is only one w t h a t rece ives ( T(va1, h ) > with v n I 2 DFS(w 1.

To continue v i s i t i n g v e r t i c e s i n

Lema 8.

h

For an a r b i t r a r y processor u of GL t h e following holds:

h' (1) I f DFS(u) is t h e smallest i n GL

then u rece ives ( T ( Val, h- 1 )> with val I DFS( u).

(2) I f DFS(u) is not t h e smallest i n GLh, then u rece ives (BZC(h)> .

Proof. (1) From Lemma 6, u has re- ceived (BZC( h ) ) o r ( T ( Val, h- 1 ) ) with V a l 2 DFS( u ) . (BZC(h)>. Then from Lemma 5, a processor z sends (BIC(h)) when i t has received (BZC( h 1) or ( T ( V a l , h - 1 )) with va f 2 DFS(2). i t z ) which s e n t (BIC(h)> t o u has received (BZC(h)>. Then s i n c e i t sends (BZC(h)> t o PCH and PCHzESONr(z) , from Lemma 5

DFS(u) > DFS(z) holds. Hence, i t contra- d i c t s t h e minimality of DFS(u). Next, sup- pose t h a t z has received < T ( Val, h- 1 )> with val I DFS(Z 1. Since z sends (BZC( h )> t o z ' which s e n t t o z ( T ( v a 1 , h- 1)) with v a l 2 DFS(z ) and s i n c e each z ' sends <T(val , h-1)) . t o PART(z'), DFS(U) > DFSfz) holds.

Hence, i t cont rad ic t s the minimality of DFS (u) .

Suppose i t has received

Suppose t h a t t h e processor ( c a l l

2

(2) This is obvious from Lemmas 6 and 7 and Lemma 8 ( 1).

L e m 9 . For an a r b i t r a r y processor u of GLh, the following holds: one v i n

Proof. (1) By Lemma 8 t h e r e e x i s t s a processor ( c a l l i t v ) which s e n t t o u

10

( T ( v a f , h-1)) with v a l L D F S ( u ) . As f o r Lemma 7, it can be shown t h a t v is t h e only processor which s e n t t o u ( T ( v a l , h-1)) with v a l Z D F S ( u ) ; u sends (BZC(h)> t o v when i t rece ives ( T ( u a 1 , h - 1 ) ) and each z which rece ives (BIG( h)> sends (BZC( h)). t o PCHz.

only one v i n P L h n S O N r ( u ) and f L h n NG( u)G DECr(U)ONc( U ) holds. On the o ther hand, l e t 0 be an a r b i t r a r y processor i n I ) E C T ( ? m NG( u ) and l e t q be an a r b i t r a r y processor on the V-w path i n T d i f f e r e n t from V . Then from s E A S C r ( w ) , S U B ( q ) S S U B ( w ) h o l d s and from w E N c ( u ) , S U B ( w ) 5 D F S ( u ) holds. Also, from uE f l s C r ( P A R ~ ( 4 ) ) - { P A R r ( q ) } , D F S ( u ) < DI;‘S(PARr(q)) holds. Hence, S U B ( q ) S S U B ( w ) 5 D F S ( u ) < D F S ( P A R r ( 4 ) ) holds. Hence, from Lemma 4 when PART(q) sends a T

message, 4 E f cH.-AR(q) holds. Since u sends (BIC(h)> t o v and s i n c e qEPCHPAmq) , w re- ceives (BIC(h)> and i t g ives a l a b e l h t o a t l e a s t one l i n k (PART(w), w ) . Hence, f L , n

Since f C H z E S O N r ( z ) , t h e r e e x i s t s

N c ( u )n DECr ( v 12 DECr ( Nc( u ) holds.

( 2 ) Since Nc( u ) S D E C r ( u )UASCr( U ) from property 1, i t i s s u f f i c i e n t t o prove the following :

0 f L h n N c ( u ) n D E C r ( u ) = (U DSCr( v ) ) m ” ( u )

= A s c r ( u ) n N c ( u ) @ f L h n N d u ) n A S C r ( u )

Since 0 can be proven s i m i l a r l y t o ( l ) , 0 is proven here.

holds.

It is obvious t h a t P ~ h n N G ( U ) n A S C r ( u ) E A S C r ( u ) n N c ( U )

Next, l e t US show P L h n N c ( U ) n 0 A S C r ( u ) 3 A S C r ( u ) n N c ( u ) holds. L e t v

be the processor i n PLh with t h e smal les t

depth- f i r s t number and l e t v l be t h e pro-

cessor which sen t t o v ( T ( v a I , h- 1)) with

va lL DFS(vo) , From (1) t h e r e i s exac t ly one such processor V 1 .

receives ( T ( Val, h - 1 )) with va1 L D F S ( V O ) and from Lemma 4 vaz = SUB(v1) holds. Hence

from Lemma 5 every processor 2 other than

(BZC(h)> from vo t o PCH,.

(BIC(h)> and s ince PCHZ S S O N r ( z ) , from em ma 8, M E DECr(Vo) holds. Since SLIB(v1) 2 D F s ( V o ) , there is nothing i n NG(u) t h a t belongs t o ASCr(Vo)-{VoJ. Hence, f o r each w E A S C r ( U ) n N c ( U), DECr(Vo) holds, and s i n c e u received (BIC(h)>, w must have s e n t (BZC(h)>. a f t e r sending (BIC(h)>, w gives a l a b e l h

0

From Lemma 7, only

v O

which s e n t (BZC( h I>, simply relayed v O * Since u received

W E

Since

From Lemma 9 t h e following holds.

CoroZZq 1. Let u be the processor with t h e smallest d e p t h - f i r s t number i n P L h ( l s h 4 n - 1 ) and l e t v be a processor i n P,!,hnSONT(u) (from Lemma 9 , v i s uniquely determined) . Then f o r each t ( E PL h - { u ) ) , z € DECr ( V ) holds.

From Lemma 9 and Theorem 1 the follow- ing lemma holds.

L e m a 10. GL i s a bi-connected com- h ponent.

L e m a 11. Each l i n k of GL has a l a b e l h h.

Proof. This is proven by induct ion on h.

( h - 1). L e t GL1 = GIPL1] and l e t u

be the processor wi th t h e smallest depth- f i r s t number i n PL1. From Lemma 8 , u re-

ceives ( T ( v f f ! , O ) > with D F S ( u ) s v a l (V is t h e processor which s e n t < T(va1,O) > t o u ) , sends (BZC(1)) t o V , and g ives a l a b e l 1 t o each l i n k (u, W ) l ead ing t o each w

u ) n D E C r ( v ) ) .

From Lemma 1 0 and Theorem 1, these l i n k s belong t o GLl and t h e only l i n k s i n

GL t h a t are ad jacent t o u are those t o w.

Also, each z (€pL,-{u]) gives a l a b e l 1 t o a l l t h e adjacent l i n k s when i t rece ives <BIG( 1 )). Since u received ( T ( ual, 0)) with t h e parameter value 0, which determines the l a b e l of t h e bi-connected component, s i n c e Corol lary 1 holds , and s i n c e each processor is v i s i t e d i n t h e ascending order of depth- f i r s t number, SUB(z ) 5 D F S ( z ) holds f o r each 2 ’ ( E S O N r ( z ) ) .

1

Hence, from Lemma 10 and Theorem 1 a l l

1’ the l i n k s ad jacent t o z belong t o GL

Since t h e l a b e l s are not changed once they a r e given, a l l t h e l i n k s i n GL have a l a b e l

1 a t the end of the algorithm. 1

Induct ion s tep . Assume t h a t t h e lemma holds f o r h < k.

( h = k ) . L e t GLh = G[PLh] and l e t u

be t h e processor wi th t h e smallest depth- f i r s t number i n PLh.

the b a s i s s t e p t h a t t h e ad jacent l i n k s

It can be shown a s i n

1 1

Table 2. Complexity of algorithm ABCC

I Communication 1 complexity Ideal-time com-

plexity

labeled h by

only links of GL h labeled h. Also, by Lemma 8, each z (E PLh - { u ) ) receives (BZC( h )> and gives a label h to all the unlabeled adjacent links. the ascending order of depth-first number, by the induction hypothesis and Corollary 1, at each z , which received ( T ( V U / , 1 ) ) ( I 5 h - 1 ) with val & D F S ( z ) from z' ( E S O N r ( z ) ) the links leading to D E C r ( z ' ) f ] N c ( z ) are labeled.

belong to GLh and that the

adjacent to U are those

Since each processor is visiting in

Hence for each unlabeled link (u, w ) ,

(where L ' E S O N r ( Z ) and S I / B ( z ' ) < D F S ( z ) ) holds. By Lemma 10 and Theorem 1 these links (2, w ) belong to GL Since the links GL

ing to w , all the links in GL

at the end of the algorithm.

w E A S C r ( z ) n N , ( z ) or w E D E C d z ' ) n N d z )

h' which are adjacent to z are those lead- h

are labeled h h

From Lemmas 3, 10 and 11 the following theorem holds.

Theorem 2. The distributed algorithm ABCC solves the bi-connected component prob- lem correctly.

3 . 3 . Evaluation of distributed algor- ithm ABCC

In this section the communication com- plexity and ideal-time complexity of the algorithm ABCC are calculated and they are put into Table 2. Also, lower bounds of the communication complexity and ideal-time com- plexity for the bi-connected component prob- lem are shown.

Theorem 3. The communication complex- ity of the distributed algorithm ABCC is O(n1ogn + e ) .

& U V

Fig. 4 . Network N and N' of the proof of Theorem 5.

Proof. The communication complexities of Phases 1 and 2 are O(n1ogn + e ) [ 2 ] and O(e) [ 5 ] , respectively. The communication complexity of Phase 3 is O(e) . sent in Phase 4 are ( S R T ( h ) > , ( T ( v a 1 , h)>, and (BIC(h)> only. ( S R T ( h ) ) and ( T ( v a i , h ) > to visit process- ors are sent to each of the links of T once and since (BZC(h)i to inform the label of the bi-connected component is also sent to each link of T once, the communication com- plexity of Phase 4 is O(n). Hence, the com- munication complexity of algorithm ABCC is O(n1ogn + e ) .

The messages

Since the messages

Theorem 4. The ideal-time complexity of the distributed algorithm ABCC is O(nG(n> 1

Proof. The ideal-time complexicies of Phases 1 and 2 are O(nG(n)) [ 2 ] and O(n) [5], respectively. In Phase 3 the leader sends out messages through T and each pro- cessor, upon receiving a message from its parent, exchanges messages with its neigh- bors. Hence, the ideal-time complexity is O(n). In Phase 4 the processors are visited in the ascending order of depth-first number to find bi-connected components.

Thus the messages exchanged in Phase 4 behave in the same way as in the case of the depth-first search through T. Hence the ideal-time complexity for Phase 4 is O(n). Thus the ideal-time complexity of ABCC is O(nG(n>> *

Theorem 5. A lower bound for the com- munication complexity of the problem of find- ing bi-connected components is f l ( e ) .

Proof. If the number of messages is less than e - 1, then there is a link to which a message has not been sent. Let (u, V ) be a link in a network N = ( V , E ) to which a message has not been sent [Fig.

12

4(a)]. Also, consider the following network N' = ( V ' , E ' ) [Fig. 4(b)]:

V ' = V U ( w ) . E ' = ( E - { ( u , v ) ) ) U { ( U , W ) , ( W , u)).

Also, determine the port correspondence of each processor p (E v') as follows. For each b ( l S b S d e g ( p ) )

( u l w ) (if p = w and b = 1)

(uIw) (if p = w and b = 2)

p , ~ ( p , b) (all the other cases).

The only pieces of information each processor can use at the start of the algor- ithm are its identifier and the port numbers to the adjacent links. Hence, in N' the same operations as in the case of solving the bi-connected component problem in N ate sometimes necessary. That is, each proces- sor other than IJ executes the same instruc- tion at the same time as for N; and if an instruction is Rec(m) command,* the same message is received from the same port. Thus, w does not receive messages from u or v . Hence, if w is not the starting proces- sor, w does not label links (u, w ) and ( w , v ) . This contradicts the fact that tl labels all the links.

Theorem 6. A lower bound for the ideal-time complexity of the problem of finding the bi-connected components is f i (n) .

Proof. Let V = { V ~ I l S i 5 n ) , E = { ( U z , U l + ~ ) [ 1 ~ ~ S ~ - - 1 } and N - (V, E ) [Fig. 5(a)]. For simplicity, assume that n is even. AISO, let v ' = V , E '=EU{(VI , ~ n ) ) and N' = ( V ' , E ' ) [Fig. 5(b)]. Since in N,

and v do not belong to the same V

bi-connected component, V gives different n/2

labels to links

n/2-1

n /2 v n I 2 ) and (vn12,

' n / 2+1)

On the other hand, since all the pro- cessors belong to the same bi-connected component in N, V gives the same label n/2

*According to Definition 2, for the same Rec(m) command a message may actually be received from a different port. by this the possibility of receiving a mes- sage from a different port is removed.

However,

G" 4 v1 9

(b) N'=(V,E')

Fig. 5. Network N and N' of the proof of Theorem 6.

to links (vn12-1s vnI2> and ( v n I 2 , vn,2+1) . Hence, for vnI2 to give the correct label to ( ~ n / 2 - 1 * 'n /2 ) and ('n/23 'n/2+1 ) in N

and in N', it must receive information from v or v . For that the ideal-time complex- 1 n ity of dlv(vn,2, v ) = n / 2 - 1 is necessary. Hence, a lower bound of the ideal-time com- plexity of the problem of finding the bi- connected components is fi (n) .

1

4. Distributed Algorithms to Solve Other Problems

In this section, three algorithms to solve the bi-connectedness problem, the cut- point problem, and the bridge problem are presented. an arbitrary connected network.

In the following N = (P, L ) is

4.1. Bi-connectedness problem

Bi-connectedness problem. Each pro- cessor has a solution informing whether or not N is bi-connected.

13

The bi-connectedness problem can be solved by adding t o algorithm ABCC a test f o r the ex is tence of a l i n k with l a b e l l a r g e r than 1.

4.2. Cutpoint problem

Cutpoint problem. Each processor u has a so lu t ion reveal ing whether or not u i s a cutpoint .

By Proposi t ion 1, a t each processor u whether o r not u i s a cutpoint can be deter- mined a s follows.

@ By algorithm ABCC, l a b e l each l i n k connected t o u with the l a b e l of t h e bi- connected component.

@ I f l i n k s with d i f f e r e n t l a b e l s a r e connected t o u, then u is considered t o be a cutpoint. Otherwise u i s not a cutpoint .

Example 4. In Fig. 1, V and 2, a r e

connected t o l i n k s with d i f f e r e n t labe ls . Hence, V 1 and V 2 a r e cu tpoin ts and a l l the

o thers a r e not a cutpoint.

1 2

4 . 3 . Bridge problem

Bridge problem. Each processor u has a so lu t ion which revea ls whether or not each l i n k connected t o u is a bridge.

By the d e f i n i t i o n of bridge, t h e fol- lowing lemma holds.

Lema 11. Let N = (P, L ) be an arbi- t r a r y connected network and l e t (u, V ) be an a r b i t r a r y l i n k of N; (u, V ) is a br idge i f and only i f the following condi t ion holds.

Bridge condition. There is no proces- s o r belonging t o the same bi-connected com- ponent as (u, V ) i n ( N c ( u ) U N c ( v ) ) - ( u , v ) .

From Lemma 11, whether o r not an adja- cent l i n k (u, v ) a t u is a br idge can be determined a s follows.

@ By algorithm ABCC, l a b e l each l i n k connected t o u with t h e l a b e l of t h e bi- connected component.

@ I f there is no l i n k with t h e same l a b e l a s (u, V ) connected t o u other than (u, v), then (u, v) is a bridge. Otherwise, (u, V ) i s not a bridge.

Example 5. In Fig. 1 -since no l i n k s with t h e same l a b e l as (V v ~ ) other than

1’

(v1, tr ) a r e connected t o v 1 , ( v l , v8> is a 8 bridge and t h e o t h e r s are not a bridge.

4.4. Evaluation of t h e algorithms

For t h e bi-connectedness problem, the cu tpoin t problem and t h e br idge problem, the following theorem holds.

Theorem 7. There a r e algorithms t o solve t h e problems of bi-connectedness, cut- po in t and br idge with t h e comunicat ion com- p l e x i t y O(n1ogn + e) and t h e ideal-t ime com- p l e x i t y O(nG(n) 1.

Also, t h e following theorem can be proved a s Theorems 5 and 6 .

Theorem 8. Lower bounds of the com- munication complexity and ideal-t ime com- p l e x i t y f o r t h e problems of bi-connected- ness , cutpoint and br idge are Q(e) and Q ( n ) , respec t ive ly .

5. Dis t r ibu ted Algorithm t o Solve Strongly Connectedness Problem

Up t o t h i s p o i n t , a network G has been considered a nondirected graph and d i s t r i b u - ted algorithms t o so lve problems on un- d i r e c t e d graphs have been discussed. t h i s s e c t i o n , a d i rec ted graph [ 4 ] defined by a network G is considered and d i s t r i b u - ted algori thms t o solve problems on direc- ted graphs are discussed. is determined by a binary r e l a t i o n a s fo l - lows and t h e l i n k s of a network are b id i rec- t i o n a l a s before.

I n

A d i r e c t e d graph

Defini t ion 6. Let G = ( V , E ) be an a r b i t r a r y network. L e t R (2 V X V ) be an a r b i t r a r y binary r e l a t i o n def ined on t h e ver tex set V. I f R s a t i s f i e s t h e following condi t ion, R i s s a i d t o be defined on G.

I f ( U, v ) E R , then ( U, t i )€ E where ( u , v ) represents an ordered p a i r of u and V.

Let R be an a r b i t r a r y binary r e l a t i o n defined on G. The d i r e c t e d graph G(R>= ( V , R ) is c a l l e d a d i r e c t e d graph defined on G by R.

Here w e consider the problem of find- ing t h e s t rongly connected components [ I ] of C ( R ) f o r an a r b i t r a r y network G and an a r b i t r a r y binary r e l a t i o n R defined on G. It i s assumed here t h a t each processor ( c a l l i t U) knows f o r each l i n k connected t o u ( c a l l i t (u, v ) ) whether or no t < u , u ) € R and ( v , u ) E R a t t h e s ta r t of the algor- ithm (each processor has a v a r i a b l e t o s t o r e t h i s information and a va lue i s assigned a t t h e start of t h e algorithm).

14

v l

Fig. 6. A depth first search numbering and the value of function L O W ( v i ) .

Numerous sequential algorithms are known to find strongly connected components [ l , 91. Here as an idea for a distributed algorithm to solve the strongly connected component problem (defined similarly to the bi-connectedness problem) on a network it is shown how the strongly connected component problem is solved by each processor.

First, let us summarize properties of a directed graph G(R> and a depth-first search tree T with an arbitrary processor of G(R> as its starting vertex. Here the depth-first number of each processor u on T is represented by DFS(u) and the processor with the smallest depth-first number in an arbitrary strongly connected component of C ( R > is called the root of the strongly connected component. Also, a function L O W ( u ) is defined as

,COW( u ) = m i n ( D F S ( u ) I u= u

or for a descendant w of u in T there is a link (u, u ) not in T and the root of the strongly connected component containing V is an ancestor of u l .

Example 6. In Fig. 6 the solid lines indicate a depth-first search tree starting

i at v The number inside each vertex represents DFS(v.) and the number to the right of v is LOW(Vi ) .

1’

2

i

Proposition 2 [ 11. Let V’ ( S 1/ ) be an arbitrary subset of processors of G. induced subgraph G(R>[ V’]= ( V’, E’ ) of G(R> is a strongly connected component if and only if the following two conditions hold:

The

0 If u is the root of C(R>[1/’], then LOW(u) = DFS(u).

@ If u is not the root of G(R>[V’I , then L O W ( u ) < DFS(u).

By Proposition 2 each processor u can obtain a solution to the strongly connected component problem by finding L O W ( u ) . Hence the following theorem also holds.

Theorem 9. There is an algorithm which solves the strongly connected compon- ent problem with the communication complex- ity O(n1ogn + e ) and the ideal-time complex- ity O(nG(n)).

Also, the following theorem can be proven as Theorems 5 and 6.

Theorem 10. Lower bounds of the com- munication and ideal-time complexities for the strongly connected component problem are Q ( e ) and Q(n) , respectively.

6. Conclusions

In this paper five distributed algor- ithms using the depth-first search have been presented. these algorithms a distributed algorithm simulator [lo] developed by one of the authors has been used.

To verify the operations of

Acknowledgement. This research was supported in part by MAZDA.

REFERENCES

1.

2.

3.

4 .

5.

6.

7.

8.

A. V. Aho, J. E. Hopcroft, and J. D. Ullman. The Design and Analysis of Com- puter Algorithms. Addison-Wesley, Read- ing, MA (1974). F. Chin and H. F. Ting. An almost linear time and O(n1ogn + e ) messages distributed algorithm for MST. Proc. of 26th FOCS, pp. 257-266 (1985). Ken-ichi Hagihara. On the complexity of distributed algorithms. The Logic Pro- gramming Conference ‘87, pp. 11-20 (1987). F. Harary. Graph Theory. Addison- Wesley, Reading, MA (1969). K. B. Lakshmanan, N. Meenakshi, and K. Thulasiraman. A time-optimal message efficient distributed algorithm for depth-first search. Information Process- ing Letters, 25, pp. 103-109 (1987). J. Park, T. Masuzawa, K. Hagihara, and N. Tokura. An efficient algorithm to construct a breadth-first search tree. I.E.C.E. Trans. (D), J71-D, 7, pp. 1176- 1188 (July 1988). - - J. Park, T. Masuzawa, K. Hagihara, and N. Tokura. Distributed algorithms solv- ing updating problems. 3rd Joint Com- puter Communication Workshop, Korea, pp. 157-166 (1988). J. Park, T. Masuzawa, K. Hagihara, and N. Tokura. On algorithms t o solve

15

problems on connectivities of a network. 10. Nobuki Tokura. On distributed algor- I.E.C.E. Tech. Report, COMP88-61 (1988). ithms-An attempt on simulation. Re-

9. R. Tarjan. Depth-first search and line- search on architecture, language, and ar graph algorithms. SIAM J. Comput., algorithm for parallel processing com- 1, pp. 146-160 (1972). puters (61302080); Ed., Hiroshi Hagi-

harai, Kaken Research Report (1987).

AUTHORS (from left to right)

Jungho Park graduated in 1980 from Seikinkan University, Korea, where he obtained a

He has been working on distributed algorithms. He is a member of the Japanese Master's degree in Management in 1982. versity. Information Processing Society.

He is currently in the doctoral program at Osaka Uni-

Toshimitsu Masuzawa graduated in 1982 from the Computer Science Department, Faculty of Engineering Science, Osaka University. In 1987 he obtained a Ph.D. from Osaka University. He has been an Assistant Professor at the Education Center for Information Processing of Osaka University since 1987. parallel algorithm and graph theory. He is a member of the Japanese Information Processing Society.

His research interest is in the areas of distributed algorithm,

Ken'ichi Hagihara graduated in 1974 from the Computer Science Department, Faculty of Engineering Science, Osaka University, where he obtained a Ph.D. in 1979 and joined the Facul- ty of Engineering Science of Osaka University. Currently, he is an Associate Professor at the Education Center for Information Processing of Osaka University. member of the working group of the Institute for New Generation Computer Technology Develop- ment (ICOT). His research interest is in database theory, graph theory, parallel algorithm, distributed algorithm, and software education. Research Group of Japanese Information Processing Society from 1986 to 1988. He is a member of IEEE; Japanese Information Processing Society; and LA.

Since 1982 he has been a

He was the secretary of the Computation

Nobuki Tokura graduated in 1963 from the Electronic Engineering Department, Faculty of

Currently, he is a Pro- Engineering, Osaka University, where he obtained a Ph.D. in 1968 and joined the Faculty of Engineering Science of Osaka University as an Assistant Professor. fessor of Computer Engineering, Osaka University. ware techniques and theory, programming language, complexity theory of VLSI, etc. He is a member of ACM; the Japanese Information Processing Society; the Japanese Software Science Society; and the Artificial Intelligence Society.

He has been working in the areas of soft-

16