Efficient Parallel Algorithms on Distance-Hereditary Graphs (Extended Abstract)
Sun-yuan Hsieh
*Chin-Wen Ho
Dept. of Computer Science
&
Info. Eng.
National Taiwan University, Taiwan
e-mail: d3506013 @csie.ntu.edu.tw
e-mail: [email protected]
Tsan-sheng Hsu
t
Ming-Tat KO
Dept. of Computer Science
&Info. Eng.
National Central University, Taiwan
Institute of Information Science
Institute of Information Science
Academia Sinica, Taiwan
Academia Sinica, Taiwan
e-mail: [email protected]
e-mail: [email protected]
Gen-Huey Chen
Dept. of Computer Science
&
Info. Eng.
National Taiwan University, Taiwan
e-mail: [email protected]
Abstract
In this papel; we present eficient parallel algorithms forjinding a minimum weighted connected dominating set, a minimum weighted Steiner tree for a distance-hereditary graph which take O(1og n ) time using O(n+m) processors on a CRCW PRAM, where n and m are the number of vertices and edges of a given graph, respectively. We also find a maximum weighted clique - of - a distance-hereditary graph in O(log2 n) time using O ( n
+
m) processors on a CREW PRAM.1
Introduction
A graph is distance-hereditary if every two vertices have the same distance in every connected induced subgraph containing both (where the distance between two vertices is the length of a shortest path connecting them). Properties and optimization problems in distance-hereditary graphs have been extensively studied during the past two decades [ 2 , 7 , 8 , 9 , 111.
A dominating set D of a graph G = (V,
E)
is defined as D V such that every vertex in V\
D is either in D or is adjacent to some vertex in D. A dominating set D is connected if the subgraph induced by D is connected. For a given graph G and a set KC
V (of terminal ver- tices), a Steiner tree is a tree which spans all vertices of I<-. The connected dominating set problem CD (respectively, Steiner tree problem S7) asks for a minimum cardinality connected dominating set (respectively, Steiner tree). In this paper, we consider the following weighted version of the CD and ST on distance-hereditary graphs. Let w(w)be a non-negative weight associated with each vertex w in
'Supported in part by Institute of Information Science, Pcademia Sinica, Teipei, Taiwan.
Supported in part by NSC Grant 86-22 13-E-001-012,
G. We want to find a connected dominating set D (respec- tively, Steiner tree T ) such that
xwED
w(w) (respectively,CwET
w(w)) equals the smallest possible value. We show that the above problems can be solved in O(1ogn) time using O(n+
m ) processors on a CRCW PRAM, where n and m are the number of vertices and edges of a given graph, respectively.A graph C is a clique if there is an edge between every pair of vertices. We say that C is a clique of G if C is an in- duced clique of G. If each vertex is assigned anon-negative weight, a maximum weighted clique is a clique of G with the maximum total weight. In this paper, we also compute a maximum weighted clique of a distance-hereditary graph in O(log2 n ) time using O(n
+
m) processors on a CREW PRAM.2
Preliminaries
This paper considers finite, simple loopless, undirected and connected graphs G = (V, E ) , where V and
E
are the vertex and edge set of G, respectively. Let n = IVI and m = (E l. The distance &(z, y) or d ( z , y) between two vertices z and y in G is the length of a shortest z-y path in G. Let v be a vertex of G. We denote the neighborhoodof w, consisting of all vertices adjacent to w , by N ( w ) , and the closed neighborhood of w , the set N ( w ) U {w}, by N[w]. Let S be a subset of V. We denote N ( S ) the open neighborhood of S , that is the set of vertices in G, exclusive of S, which are adjacent to any vertex in
S.
We also denote N [ S ] = N ( S ) US.
The subgraph induced by S , denoted by (S), consists of the vertices of S and edges (2, y) with 2, y E S and (z, y) E E .The hanging of a connected graph G = (Vi E ) at a vertex U E
V ,
denoted as h,, is the collection of sets & ( U ) ,Ll ( u ) ,..., Lt(u)(orsimplyLo,L1 ,..., Lt whennoambiguity
20
arises), where t = maxUE v ( E G ( u , v) and Li(u) = {v E V : & ( U , W) = i} for0
5
i5
t . For any vertex E Li and vertexsets C_ Li, 1 5 i5
t,letN’(v) = N (v) n Li- land let N ’ ( S ) = N ( S )n
Li-1. Any two vertices x , y E Li (15
i
5
t -
1) are said to be tied if x and y have a common neighbor in Li+l. A homogeneous set of a graphG
is a set A of vertices such that every vertex in V ( G) - Ais adjacent to either all or none of the vertices of A. A graph is a cograph (also a P4-free graph) [5] if it is either a vertex, the complement of a cograph, or the union of two cographs (where by union of two graphs G1 =
(V,
,
E l ) and G2 =(fi,
E2) we mean the graph G =(V,
Uh,
El UE2)). A cograph G has a parse tree representation called
cotree, denoted by TG, with (a) the leaves of TG are the vertices of G; (b) the internal nodes of TG are labelled 0 or 1 ; (c) 0 nodes and 1 nodes alternate along every path staring from the root; (d) two vertices x and y of the cograph are adjacent if and only if the least common ancestor of z and y in TG is a 1 node. In the following, we introduce properties of distance-hereditary graphs.
Proposition2.1
181
Suppose h, = (L0,Ll,...,
Lt) is the hanging at U of a connected distance-hereditary graph. r fx, y E Li (1
5
i5
t ) are in the same component of<
Li>,
or x and y are tied, then N ’ ( x ) = N’(y).Fact 1 A hanging of a connected distance-heredita graph can be computed in O(1ogn) time using O ( n
+
my processors on a CRCW PRAM.Proo$ An implementation is described as follows. (a) We first find an arbitrary spanning tree S for G in O(1og n ) time using O ( ( m
+
n)a(m, n ) / logn) processors on a CRCW PRAM, where a is the inverse Ackermann function [4], and then transform it into a rooted tree with the root U inO(1ogn) time using O ( n ) processors on an EREW PRAM [lo]. (b) For each vertex v(# U ) , we associate it with a
number num(v) which is the distance from v to U in S
(the computation of distances for those non-root vertices can be done in O(1og n ) time using O( n/ log n ) processors on an EREW PRAM [lo]). (c) For each vertex 2, let
(x , y) E E T ) if num( y) is the smallest value in { num(z)
I
t E N ( x )
i
.
This can he done in O(1ogn) time using O ( n+
m) processors on an EREW PRAM by the sorting algorithm described in [3]. It can be verified that T =(V, E ( T ) ) is a quasi-breadth-first-search tree which is a hanging at U . It has been shown that a quasi-breadth-first-
search tree is also a breadth first search tree on a distance- hereditary graph [6]. Note that Li is the set of vertices x E T , such that the unique path from x to U is of length
exactly i. Q.E.D
Proposition 2.2 [2] Suppose h, = (LO, L1
,
.
. .
,
L,) is a hanging of a connected distance-heredita graph at U .For any two vertices x , y E Li, i
2
1, N ’ Z ) and N‘(y) are either disjoint, or one of the two sets is contained in the othel:We call a family of subsets arboreal if any two elements of the family are either disjoint or comparable (by set inclu- sion). For example, { 1
,
2,3}, { 1,2}, (4)) is an arboreal family of subsets ofJ!
1,2,3,4}. Given an arboreal family of distinct subsets, denoted by S I , S2,...,
S,, we can define a partial order5
between Si’s by S,5
S,e
S,C
S,,where 1
5
p , q5
r . An element S is said to be minimal in the given family if S,2
S,, for a i q#
p and 15
q5
r .In [8], Hammer and Maffary defines an equivalence re- lation rabetween vertices of Li by x
s
i
y meansx
and yare in the same connected component of La or IC and y are
tied. Let be defined on V ( G ) by x y means IC =i y
for some
i.
They make explicit the structural aspects of distance-hereditary graphs by deriving the following char- acteristics.Proposition2.3 [8] Let U be a vertex of a connected
distance-hereditary graph G and let h, be the hanging at U of G. Let R I , R2,
...,
R, be the equivalence classes ofthe relation sa. Then, ( a ) the graph obtained from G by shrinking each Rj into one vertex is a tree rooted at U (for
convenience, we call such a tree an equivalence-tree Th, .);
( b ) each Rj induces a P4-jree subgraph; (c) f o r each j , the family {NI( R k ) : N‘( R k ) Rj} is an arboreal family of
homogeneous subsets of Rj.
3 Minimum Weighted Steiner Tree
This section deals with the weighted Steiner tree proh- lem on a distance-hereditary graph with the terminal vertex set
Ii.
Given a hanging h,, where U is an arbitrary vertexof IC, let Th, he the equivalence-tree defined in Proposition 2.3. Note that each node w in Th, represents an equiva- Ience class, denoted by R,. For each node v in a rooted tree T , let T ( v ) be the subtree rooted at v. We present our algorithm below.
Algorithm WCD
Input: A distance-hereditary graph G = (V, E ) and a set I<
c
V composed of terminal vertices.Output: A minimum weighted Steiner tree T on It”.
Step 1. Let U be an arbitrary vertex in the target set
IS-
and let U =
Ii.
Determine a hanging h, and construct the equivalence-tree T h ,.
Step 2. For each node w in Th,, if all of the following conditions (a) U X f V ( T h u ( W ) ) { R X
n
K}
#
0,
(b) N I ( & ) contains no vertex in K , and (c) N’( R,) contains no proper subset N’(R,), such that the node v in Th, satisfies that { R,n
Ii}
#
0;
hold, then select a minimum weighted vertex y E N’(R,) and add it to U .Step 3. Find a spanning tree T for
<
U>, which is the
desired output.Theorem 3.1 Algorithm WCD generates a minimum
weighted Steiner tree for the distance-hereditarv nraDh in
U X E V ( T h u ( u ) )
O(lu0g n> time using O ( n
+
m ) processors on’a“
CRCW PRAM.Proofi For each vertex
w(#
U ) EIt‘,
it can be verified thatthere is a path, connecting w and U , in
<
U>
after Step2. Thus < U
>
is a connection of K. We then show that< U
>
has the minimum weight. Observe that for each node w in Th, satisfying conditions (a), (b) and (c) in step 2 of algorithm W C D , a minimum weighted connection of I< must contain a vertex of N’(R,). Since the algorithm selects a vertex with the minimum weight from w , the weight of U is clearly minimum. After executing Step 3, the algorithm finds an arbitrary spanning tree T for < U>.
By definition, T is a minimum weighted Steiner tree.We now analyse the time-processor complexities. In Step 1, the implementation of a hanging is described in Fact 1. We note that the computation of T h , can be done by finding the equivqlence classes with respect to h,. It takes O(1ogn) time using O ( n
+
m ) processors on a CRCW PRAM. In step 2, associate each vertex v with t a g ( v ) such that t a g ( v ) = 1 for v E K and t a g ( v ) = 0 otherwise. Using the above information, the Euler-tour technique [lo] can be applied to check the condition (a) which takes O(1og n ) time with O ( n / log n ) processors on an EREW PRAM. Condition (b) can be checked in O(1og n ) time using O ( n / log n ) processors on an EREW PRAM by slightly modifying optimal parallel prefix-sum computation [lo]. A method to check condition (c) can be done similar to the implementation of the algorithm in Section 3 for finding a connected dominating set. In Step 3, finding a spanning tree can be done in O(1og n ) time using O ( ( m + n ) a ( m , n)/ l og n ) processorsonaCRCWPRAM[41. Q.E.D.
4
Maximum weighted Clique
It is easy to see that any clique of a distance-hereditary graph G belongs to Li U Li+l for some 0
5
i
5
t-
1. Let R denote an equivalence class of G with respect to h,.
Observation 1 A maximum weighted cliaue of a distance- hereditary graph is a maximum“weight.cd clique of some
<
R U N’(R)>.
We call < R U NI(
R)
> a
candidate subgraph of a maxi- mum weighted clique. For abbreviation, we also call it is a candidate subgraph. Since there are at most n equivalence classes for G, we have the following observation.Observation 2 There are O ( n ) candidate subgraphs f o r a distance-hereditary graph.
For two graphs
G I
and G2, the join of GI and G2, denoted by G1 @ G2, is the graph consists of G1 U G2 and all edges joing V(G1) and V(G2) [12]. From structure characteristics of G, every candidate subgraph<
RU N’(R)>=<
R>
@<
N’(R)>.
If C1 and C2 are maximum weighted cliques of R and N’(R) re- spectively, then C1 @ C2 is a maximum weighted clique of<
R U N’(R)>.
By Observation 2 and 1 , a maximumweighted clique of G is a clique with the maximum weight among O ( n ) candidate subgraphs.
It is assured by Proposition 2.3 that
<
R>
and<
N’(R)> are cographs. In
[I], Abrahamson, et. al. present an algorithm to find a maximum weighted clique of a cograph G: Given a cotree T of G a maximum weighted clique can be found by applying the tree contraction tech- nique to T which takes O(1ogn) time using O ( n / logn) processors on an EREW PRAM. Hence, if cotrees TI andT2 for < R > and < N ’ ( R ) > are given, a maximum
weighted clique of the candidate subgraph < R U N’( R )
>
can be computed by applying the algorithm in [ l ] to TI and T2. But it is necessary to construct cotrees for each R and N ’ ( R ) , the above algorithm takes a large number of processors to achieve the desired computation. Here we provide a different way (described latter) which requires fewer processors than the above one.For any node v in a tree T , let l e a f ( v ) be the ieaves of T (v ) (recall that T ( v ) is the subtree of T rooted at
v). Let SR =
{SI
there is an equivalence class R’ with N’(R’) = S and S R } . By the algorithm in [l], given a cotree T all maximum weighted cliques of cographs in- duced by deaf (v), where v is an internal node of T , can be found simultaneously in O(1og n ) time using O ( n / log n ) processors on an EREW PRAM (see [ 11 for details). Based on this result, we concentrate our effort to construct a spe- cial cotree TR for<
R> such that for each
S E SR there exists a node v in TR with Z e a f ( v ) = S and T R ( Y ) is a cotree of<
S
>.
For convenience, we call TR a canonical cotree.Lemma 4.1 I f a canonical cotree of
< R >
is given, all maximum weighted cliques of<
S>,
where SE
SE, can be computed in O(1og IRI) time using O(lRI/ log IRI) processors on an EREW PRAM.In the following, we show how to construct the canonical cotree for
<
R>. By Proposition 2.3,
SR is the arboreal family of homogeneous subsets of R. Let S’R = SE U { R } . According to the partial order5
defined in Section 2 , wefirst construct an auxiliary tree structure AR as follows. We create IS’I nodes where each node represents an element (a set) in S’R. Let S, denote the set represented by the node
v in A R , and p a r ( v ) (respectively, child(v)) be the parent (respectively, children) of v. For any two created nodes a and @, there is a directed edge from a to ,B if S ,
5
Sp and no other S, satisfies Sa5
S,5
Sp.Lemma 4.2 The auxiliary tree structure AR can be con- structed in O(1ogp) time using O ( p
+
q ) processors on an EREW PRAM, where p =I
RI and q =I
E (< R>
)I.
Proof: Suppose R = { V I , 212,...,
vp} and SR=
{SI, S 2 , ..., S,.}. LetSi
= N’(R;) where Ri is an equiva- lence class. For ease of description, we assume the vertices are represented by their indices. So R = { 1 , 2 , . . . , p } .We construct AR as follows. Let U be any vertex of Ri and Si = {tl,t2, . . . , t k } , where ti E {1,2,
...,
p } . Note that N’ U ) =Si.
We assign ISiI
processors to the edges( u , t l ) ,
r
u,t2) ,..., (u,tk)forcreatingtupIes(tl,i),(t;?,i) ,...,( t k ,
i).
Thus there are totally[Si
I
created tuples thatare stored in an array B.
We first sort those tuples according to their first indices. Then B is divided into p blocks (recall that /RI = p)
B1, B2,
...,
B,, whereBi
records those tuples (i, a)’s for all a such that i E Sa. We then sort the tuples in eachBi
according to the cardinalities of those sets indicated by second indices. Suppose (i, a l ) , (i,4,
..., (i, a k ) are thesorted elements in
Bi
and let ai be the created node repre- senting Sa*. Set par(ai) = ai+l, 15
i5
k-
1 and let p a r ( a k ) be the node representing R.After executing the above algorithm, AR can be con-
structed. The correctness follows directly from the prop- erty that if S,
5
S,,then: (i)ISPI
<
I
S
,
l
and (ii) 2 Es,
implies 2 E
S,.
Using the sorting algorithm described in[ 3 ] , the implementation can be done in O(1ogp) time using O ( p
+
q ) processors on an EREW PRAM. Q.E.D Lemma4.3 A canonical cotree TR can be generated in O(log2p) time using ~ (+
pq ) processors on a CREWPRAM,
wherep = ]RI and q = IE(< R>)I.
Pro08 Given the auxiliarly tree structure A R , we generate a tree TR in the following way. Let us consider the cograph
<
S,> for each node
U E AR. We first shrink each<
S,
>
in<
S,
>,
wherex
E child(u), into a vertexs called shrinked vertex. Since S, is a homogeneous set of
< S,
>,
the resulting graph, denoted by H , is still a cograph. Applying the algorithm in [6] to H , a cotreeTH
can be constructed for H in O(log2 p ) time using O ( p+
q )processors on a CREW PRAM. Note that each shrinked vertex is a leaf in T H . There are totally ~ S ' R
1
constructed cotrees. For each leaf of the generated cotrees, if it is ashrinked vertex s,, we replace it with the "corresponding" cotree T,. It takes a constant time using O ( p ) processors.
We now show that TR is the canonical cotree of
< R
>.
Clearly, TR has the following properties: (1) the leaves of TR are all vertices of R, (2) each internal nodes are either 0 node or 1 node, and (3) if two verticesx
and y of<
R > are adjacent, the least common ancestor ofx
and y in TR is a 1 node (this property can be verified from the fact that SR is a family of homogeneous sets of R). Moreover, from the construction of TR, for eachS
E SR there exists a nodeU in
TR
such that l e a f ( u ) = S. Hence T' is a canonicalcotree of < R
>.
Q.E.DRemark: Note TR is not the standard form of the cotree since it violates the definition (c) (refer to Section 2.1) that 0 nodes and 1 nodes alternate along every path star- ing from the root. For an internal node U of a cotree
with children 1-11, 1-12,
...,
I l k , let G ( u ) be the cograph in-duced by l e a f ( u ) and G p , be the cograph induced by l e a f ( p ; ) . From the definition (d), if U is a 1 (res ec-
tively, 0) node, G ( u ) = G(p1) f3 G(1-12) @
. . .
f3 G & E )(respectively, G(u) = G(p1) U G(p2) U.. .U G ( p k ) ) . Ac- cording to the above observation, the definition (c) can be relaxed (note that this kind of cotree representation is no longer unique).
Theorem 4.4 The maximum weighted clique problem f o r distance-hereditary graphs can be solved in O(log2 n ) time using O ( n
+
m ) processors on a CREW PRAM.Proofi It takes O(1ogn) time using O ( n f m) CRCW processors to determine a hanging and compute the equiv- alence classes by Fact 1 and Lemma 5.2. By Observation
2, we have O ( n ) candidate subgraphs, i.e., O ( n ) candidate cliques. According to Lemma 4.3, we compute canonical cotrees for those equivalence classes of G in O(logn2) time using O ( n
+
m ) processors on a CREW PRAM. By applying the algorithm in [ 11 to canonical cotrees, O ( n ) candidate cliques can be found in O(1ogn) time using O ( n / log n ) processors on an EREW PRAM. Thus we can find the one with the largest total1 weight in O(1og n ) time using O(n/ log n ) processors [IO]. Q E D5 Minimum Weighted Connected Dominat-
Given a hanging h,, let RI, R2, ..., R,. be those equiva- lence classes of the relation -I+] (see Proposition 2.3). LetS = { S C LII there exists an R; with N ' ( R i ) = S}. For convenience, we call S the upper-neighborhood system of
Lt+1. By Proposition 2.3, S is arboreal. So the partial order
5
described in Section 2 can be defined onS.
LetU
={S
E SI there exists no SI E S, S ;I! SI} , i.e.,U
ing Set
23
is the set composed of those minimal elements of
5.
We call U the minimal upper-neighboorhoods of Ll+l. Foreach
5'
EU ,
we select a vertex x, E S with the minimum weight. LetD I
= {rsl S EU}.
Lemma5.1
[ I l l
Suppose G = (V, E ) is a connected distance-hereditary graph with a non-negative weightfunc- tionw
on vertices. Let U be a vertex of minimum weight andh , = (Lo, L1,
. . . ,
L,) be the hanging at U . Then, one of thefollowing three sets of vertices is a minimum weighted con- nected dominating set of G: ( I ) U;,: DI ; ( 2 ) U:=: DI U { U } ;
(3) some vertex of G .
Lemma5.2 Given a hanging h,, D I , f o r all 1
5
15
t
-
1, can be computed in O(1ogn) time using O ( n+
m )processors on a CRCW PRAM.
Proot We first compute the auxilary tree structure AR for each R L I (see Lemma 4.2). Let l e a f ( A R ) denote the leaves of AR. So U={SlS E leaf(&), R
C
L I } (recall thatU
is the minimal upper-neighborhood of Ll+l).Clearly, DI can be determined from
U.
Q.E.D. Theorem 5.3 A minimum weighted connected dominating set for distance-hereditary graphs can be found in O( log n ) time using O ( n+
m ) processors on a CRCW PRAM.References
[ l] K. Abrahamson,N. Dadoun, D. G. Kirkpatrick, andT. Przy- tycka, "A simple parallel tree contraction algorithm," Jour- nal ofAlgorithms, vol. 10, no. 2, pp. 287-302, 1989. [2] H. J. Bandelt and H. M. Mulder, "Distance-hereditary
graphs," Journal of Combinatorial Theory Series B, vol.
14, no. 1, pp. 182-208,1986.
[3] R. Cole, "Parallel merge sort," SIAM Journal on Computing,
vol. 17, no. 4, pp. 770-785,1988.
[4] R. Cole and R. Thurimella, "Approximate parallel schedul- ing, 11: application to optimal parallel graph algorithms in logrithmic time," Information and Computation, vol. 92, no. 1, pp. 1-47, 1991.
[5] D. G . Comeil, H. Lerchs, and L. S. Burlingham, "Comple- ment reducible graphs," Discrete AppliedMathematics, vol. [6] E. Dahlhaus, "Efficient parallel recognition algorithms of cographs and distance-hereditary graphs," Discrete Applied Mathematics, vol. 57, pp. 29-44, 1995.
[7] A. D'atri and M. Moscarini, "Distance-hereditary graphs, steiner trees, and connected domination," SIAM Journal on Computing, vol. 17, no. 3, pp. 521-538, 1988.
[8] P. L. Hammer and E Maffray, "Complete separablegraphs,"
Discrete Applied Mathematices, vol. 27, pp. 85-99,1990. [9] E. Howorka, "A characterization of distance-hereditary
graphs," Quarterly Joumal of Mathematics Oxford Series 2 , vol. 28, pp. 417-420,1977.
[lo] J. Ja'Ja', An Introduction to Parallel Algorithms, Addison Wesley, 1992.
[ 1 I] Hong-Gwa Yeh and Gerard J. Chang, "Weighted connected domination and Steiner trees in distance-hereditary graphs," manuscripts, 1994.
[ 123 A. A. Zykov, On some properties of linear complexes. Math- ematics Sbornik, vol. 24, pp. 163-188,1949.