Parallel algorithms on circular-arc graphs

Parallel algorithms on circular-arc graphs

Information Processing North-Holland Letters 33 (1989/90) 275-281 Alan A. BERTOSSP and Sabrina MORETTI Dipartimento di Informatica, Universitci di ...

1001KB Sizes 3 Downloads 122 Views

Information Processing North-Holland

Letters 33 (1989/90)

275-281

Alan A. BERTOSSP and Sabrina MORETTI Dipartimento di Informatica, Universitci di Pisa, Corso Italia 40, 56100 Pisa, Ita&

Communicated by L. Boasson Received 31 May 1989 Revised 29 September 1989

Parallel algorithms are given for finding a maximum weighted clique, a maximum weighted independent set, a minimum weighted dominating set, and a minimum weighted total dominating set of a circular-arc graph. The shared memory model (SMM) of parallel computers is used to obtain algorithms running in O(log’n) time. Sequential implementation of the two algorithms for the minimum weighted dominating set and minimum weighted total dominating set problems leads to 0( n3) time algorithms, thus improving previously known results. Thus far, polynomial-time serial algorithms were known only to solve the minimum cardinality (untotal) dominating set problem.

Keywords: Analysis of algorithms,

combinatorial

problems,

parallel processing,

discrete mathematics

write into the same memory location neously [1,3-5,11-141. As r?ery iar : e scaie integration (‘dUIj technoiogy has advanced, parallel computers consisting of many thousands of processors dedicated to solving a single problem at a time have become increasingly feasible. This has motivated the study of parallel algorithms [4,5,12-141. Unlike sequential algorithms, for which standard models of computation exist, there are several contending models of computation for parallel algorithms [12,14]. We consider here the single irqstruction

multiple

m (SI

model with memory ( this m the same instruction is performed at the same time by different p-n*--=’ IubbDsors, possibly on different data. Ite ;C valort IMP that execaate .J nn~~;kl~ C.‘“Jcm”‘~ tn .” ilYIYVL La&Vrrrnr~ccnq r” “_....-r_ instruction on the’ data, while the other rocessors can corn the common memory, ifferent processors may

lishers

simulta-

. narnlbl Ifi ihi iXlpCi , .xra Wb --a-n* pl'brc7wa.C y"'""_,_ aigorith,ms

for

solving several combinatorial optimization problems on those graphs which represent intersecting arcs of a circle. These graphs have been introduced in recent years as a generalization of the well-know? interval graphs [7] and have found applications in genetics, traffic control, cyclic scheduling and computer compiler design [7,15]. Specifically, a circular-arc family is a set of n arcs on a circle. A graph is a circular-arc graph if there is a one-to-one correspondence between the nodes of the graph altrd the arcs of a circular-arc family such that two nodes of the graph are joined by an edge if and only if their corresponding arcs ave nonempty intersection. A circular-arc graph

275

Volume 33, Number 6

INFORMATION PROCESSING LETTERS

present here, throughout Sections 3-6, parallel algorithms for finding a maximum weighted clique, a maximum weighted independent set, a minimum weighted dominating set, and a minimum weighted total dominating set of 8 cixular-arc graph. by extending reductions to shortest path problems introduced in [3], all of the p:oposed parallel dgorithms are solved via a perallel shortest path algorithm, whose time complexity is 0(log2n) [4]. Sequential implementation of the two algorithms for the minimum weighted dominating set and minimum weighted total dominating set problems leads to 0(n3) time algorithms, thus improving previously known results. Thus far, polynomialtime serial algorithms were known only to solve the minimum cardinality (untotal) dominating set problem [lo]. In addition to analyzing the time complexity of the given algorithms, we also evaluate their ef-‘ fectiveness of processor utilization (EPU). This is the ratio between (1) the time complexity of the fastest sequential algorithm known for the problem in qbzstion and (2) the number of processors times the time complexity of the proposed parallel algorithm [4,5].

2. Let A = {A,,..., A, } be a circular-arc family. Without loss of i;enerality, assume that all endpoints of the n arcs are distinct. Let the length of the circle be 1 and assume all arcs have length less than 1. We assume an origin is arbitrarily chosen on the circle as the counterclockwise en< c f an arc. We label the endpoints along the clockwise direction, starting from the chosen end, as e,, e 25.**9e,_??. We specify an order ot’ the arcs by increasing counterclockwise ends. Arc Ai will be denoted by [a,, bj], i = 1,. . . , n, where ai is its counterclockwise end and bi is its clockwise end. Of course, a, can be larger than hi, in which case arc A, extends across a, = ek, ek+ 1, . . . , e2,,,

10 February 1990

[ai,bi] and [aj, ti] are said to intersect strictly if either (1) a, is in [aj, bj] and bj is in [ ai, b,], or (2) aj is in [ai, bi] and bi is in [ aj, bj]. Clearly, two strictly intersecting arcs overlap but none of them is properiy contained wihin liiz iii&x. -=“i pw--are said to form a Type I pair if together they do not cover the whole circle, while are said tc form a Type II pair otherwise. Clearly, it is possible to check in O(1) time whether two arcs Ai and Aj either strictly intersect, forming a Type I or a Type II pair, intersect with proper containment, or do not intersect at all. Thus, given any arc Ai, we can find in O(l) time all the arcs Aj which strictly intersect, contain, are contained or do not intersect Ai by using O(n) processors or, equivalently, in O(log n) time using O(n/log n) processors, simply by letting each processor sequentially manage O(log n) pairs of circular-arcs. This in turn can be done over all the Ai’S also in O(1) time, but using 0( n2 ) processors, or. equivalently, in O(log n) time using 0( n2/log n) processors. A!1 of the algorithms to be presented in this paper are based on a parallel algorithm for shortest Faths, which now we briefly recall. Let D( N, E) be a directed network, with N = (1, 2,. . . , n }, and let Cij be the length of the directed arc (i, j) E E. A path from node i to j in D is a sequence of nodes swyh that the first node is i, the last one is j, and every two consecutive nodes h and k in the sequence are the endpoints of a directed arc (h, k) E E. The length ol” such a path is the sum 6 the lengths chk of the directed arcs (h, k) in the path. A shtirtest path from node i to node j is a path having minimum overall length. One algorithm for finding shortest paths between all pairs of nodes in ?v’,Wkidi is suitable for parallel implementation on an SIMM, is the following. Let: d ‘JrG = the length of a shortest path from i

to j containing at most k arcs. Clearly,

e1 ,*-a, e,. = b,. Let [y, z] be an arc segment of the circle with

drjk =

erclockwise end y and clockwise end Z. A x is said to be in [y, z] if either (1)~ c x -c Z, or (2) y>z and either x>y or xcz. wo arcs

Since a shortest path c;rnnut contain more than ,I,- 1 arcs, the optimal lengths dij can be comI;ute as r’ollows [4,12]:

276

min ( drh.+ + d,,,,,

4gti
)

for k < n.

INFORMATION

Volume 33, hiumber 6

PROCESSING LETTERS

S&zp (1) For all i nnd j such that 1 < i, j f n do in parallel: dij := Cij if (i, j) E E, dij := 0 if i = j, and dij := 00, otherwise; Stc,r? (2) For m frolm 1 to [log nl do: (2.1) k := 2”, (2.2) For all i and j such that 1 -<,i, j < n do in parallel: dij = min 14h
A clique of a graph is a set of nodes such that every two nodes in the set are joined by an edge. Hsu [9] has given a classification of cliques in a circular-arc graph. Let C be a collection of arcs forming a clique. Then one of the following two conditions is true: (i) There exists an arc [a ._ b. 3 which is properly contained within every other arc of C; (ii) There exist two strictly intersecting arcs [a,, bi] and [ai, bi] in C such that no arc of C is properly contained in either one of them and for -. ---. UiliCl ._rl_ __ I _< bkj 1~ C exactly one of the GVCiy &CC LUG, following conditions holds: (a) [ax-, bk] properly CO!lt&IX [ai, bi]; (b) ak is in [ aJ, a,] and b, is in [k;, b,]; and 6, is in jbi, a,]; (cj 4 ,. is in [ai, (d) ak is in [b,, bi] and also in [ei, aJ, and b, is in a,]; (e) b, is in [b,, a,], ak is in [b,, a,], and b, is in [bj, bi]* Of course, it is not difficult to find all the cliques satisfying condition (i) above. Let C = be an n x n Boolean array such t ~ji

[llj,

10 February 1990

only if -4. is properly contained within A . C can be set up’ in G(1) time using C(n* ) proce&ors, or in O(lQg pi) time using 0( n*/log n ) processors. Row i of C clearly defines a clique satisfying (i). The weight of such a r!iqw tyn he cr\yytr_ltecj in o&g n) time using O(n/log n) processors by summing up all the WI’S for which c, j = 1 JS]. Thus all the cliques satisfying (i) can be found in O(log n ) time using 0( n */log n ) processors. Next, one has to find all the cliques satisfying (ii). Given a pair (Ai, Aj) of arcs, arcs satisfying (a)-(e) can be found in 0( 4) time with O(n) processors. However, although every arc satisfying condition (a), (c) or (e) will intersect with every other arc satisfying condition (ii), arcs satisfying (b) might not intersect arcs satisfying (d). Consider firstly Type I pairs (A,, A,). For the sake of simplicity, since a, < a2 < - . - < a,,_, c a ,,, assume i = n. If this is not the case, a new origin on the circle can be chosen and the arcs can be relabelled in O(log n ) time using 0( n */log n ) processors via a parallel sorting algorithm [13] so as to meet this assumption. Consider all the arcs A, which form a Type I pair with arc Ai. Since each Type I pair satisfies that a, is in Ibi, ai], and Aj does not properly contain A,, we can find all these arcs, in O(1) time with Qn ) processors, and arrange their indices into a list (i(1). %.. , i(m)> ordered by decreasing values of their counterai(l) > a,,,, > ’ - > clockwise ends, namely, This takes O(log n) time on ai(m-l) ’ ar(*l)’ 0( n*/log n ) processors [I 31. Observe that once a selection of arcs satisfying (b) is determmed, a seiection of arcs satisfving _ (d) . , is also determined. Let X,(i, j) be the total weight of arcs satisfying (d). Clearly. h&, j) can be computed for a given j in O(log n) time using 0( n/log n ) processors. Thus computing &( I, j) in parallel for a given i and all j, i(1)
( n 3/lag n ) processors. 277

INFORMATION PitOCESSING LETTERS

Volume 33, Number 6

Hsu [9] has proved the following recurrent relations:

’ J-onhnf set of a grap is a set of nodes aA :.zy.--.., such that no two nodes in the set are joined by an edge. In a circuiar-arc graph, it COrreSpOndS to a set of mutually nonintersecting circular-arcs. First of all, we define a directed network D as follows. For each Ai E A there are two nodes, say . zIN and iouT, in D. For each Ai E A, there is also a directed arc (iIN i,,,) in D, whose length is - wi. Moreover, there is a directed arc ( iOUT, jiN) in D whenever e, < ai < bi < aj. The length of (IoUT9 &‘dj is zero. It is easy to see that, by construction, D is acyclic. Ai > be an independent Let S= (Ai(l),. set for A. Without loss of generality, assume the circular-arcs in s are sorted by increasing counterclockwise ends. Three cases may appear: (1) No circular-arc in S does include point e,, the origin of the circle. (2) The only circuiar-arc of S which includes point e, is arc Al. Then, it must be Ai( the first circular-arc in S, and ai(l) = a, = e,. (3) There is exactly one circular-arc of S including point e,, but it is not A,. Then, it must be the last circular-arc in S. Ai(kjv ln au cases, g clearly corresponds to a directed path in D, starting from node i(1) IN and ending at node i(k)O Obvious!y, the converse is not true, since there are paths in D which do not correspond to independent sets of A. By construction of D, however, &is ilappens wnenever the iast circular-arc in the path includes point e, and it intersects with the first circui +r-arc of the path. This property suggests a wav for finding a minimum weighted independent set: Step(1) Find the shortest paths between all pairs of nodes in D; StepCO Consider those paths between an “IN” node and an “OUT” node such that the last circular-arc in the path either does not include point e,, or it includes e, but does not intersect -with the first circular-arc of the path; Step (3) Select as the optimal solution the h among those conI

=

max(max,{X(i,

i(t)) + a(i. i(t), i(k))

+x&(t),

i(k))),

&,(i, i(k))),

where V=(tltE(l,...,k-1) and hi(r) is in ibi(k), bil$* These relations are a reminiscence of the wellknown Bellman’s optimality conditions for shortest paths. Indeed, imagine a directed network B with nodes i, i(1). . . . , i(m). For each i(k), include the edge (i, i(k)) with length A,(i, i(k)). For each t c k, include also the edge (i(t), i(k)) with length ar(i, i( t ), i( k )) + hd(i( t ), i(k)) whenever bi(,) is in [hi(k), bi]. Then A(i, i(k)) corresponds to the length of a longest path from node i to node i(k). Since a,(,,,) < ai(,,,_i) -C < a,(,) < ai, the network B is :-cyclic. Thus longest paths correspond to shortest paths once the signs of the edge lengths have been reversed. Computing X(i: i(k)) for all i(1) < i(k) < i(m) then reduces to finding a shortest-path tree rooted at i, which can be done in O(log’n) time using 0(n3/log n) processors. Therefore, finding all the cliques “generated” by all Type I pairs (Ai, Aj) which satisfy condition (ii) above requires 0(log2n) time and 0( n 4/ lop n j pmtyccnrc Finally, Hsu has proved that for every Type II pair (Ai, Ai j tire cliques satisfying condition (iij include arcs satisfying (aj; (bj; (c), (ej together with only these arcs satisfying (d) with their counterclockwise endpoints between a, and their clockwise endpoints. Once we have determined an optimal selection l

l

l

10 February 1990

INFORMATION

Volume 33, Number 6

PROCESSING

Step (1) of the above algorithm can be performed in parallel in Q(log2n) time using O( n3/’ log n) processors via the parallel shortest path algorithm, once the node-to-node adjacency ma. tnx

Of

5

iias riizzii-&~y;i+zi~u_ 1

crt:, ilu3 ZZ

weighte

Ft dominating set of a graph is a subset S of the nodes such that every node of the graph either is in S or is joined by an edge to at least one node in s_ ‘Ixr.4 ._.. ioss 01c ~~11~1QllCJ) cwama+m1;tx, UJdIIIV QCCI t-no thema c,re r,,-, 77d,uut LIEVIY u1w 11v negative weights (in the presence of negative weights, one can temporarily replace negative weights with zero -weights, find a minimum dominating set, and successively add all the original negative weighted nodes to the solution). We construct a directed network H associated to the circular-arc family A in a way similar to that employed in [3] for interval graphs. For each Ai E A there are two nodes, say i,, and iouT, in I?. For each A, E A, there is also a directed arc in H, whose length is wi. There is a (i,,, i,,,) directed arc (inI r-r9 jrN ) in H with zero length if and only if j &P(i) U Q(i), where: P(i) = (k: ak is in [ai, b,l [a,,

bk]).

Q(i) = {k: A, and A, do not intersect and there is no A, such that [a,,, b,J

e may readily

verify

that

any path

10 February 1990

for A, where:

R(i) = (i>

if there is no A, such that [ah, bh] is properly contained within

L.-bAA,, irr.irwiir

in O(1) time and 0( n2) processors. Step (2) can also be performed in 0( 1) time and 0( n2) processors. Finally, the minimum required in Step (3) can be computed in O(log n) time using 0( n 2/lag n ) processors. By the algorithm above, a minimum weighted independent set can be found in O(log’n) time using 0( n3/log ~2) processors. Since an 0( n 2 log n) time sequential algorithm is known [6], the resulting EPU is &1(1/n).

and b, isin

LETTERS

R(i) = empty,

rh L-17

n --I,’

1

otherwise (note that u E R(u) implies 24= u ) .

Indeed, for each directed arc (i,,,, j,,) in such a path, the corresponding circular-arcs A,. and Aj dominate all the circular-arcs A, which have nonempty intersection with [/a;, G,j. Thus the circular-arcs correspondrng to all the nodes in such a path dominate all the circular-arcs in A. Conversely, it is not true that any dominating set S for A corresponds to a path in H from node urN to node uour such that us P(u)u Q(E)‘u R(v). However, this is true for proper dominating sets, namely, those corresponding to subfamilies of circular-arcs no one of which is properly contained within another. Since we assumed nonnegative weights, any minimum weighted dorr?ina;ing set must be proper. This suggests an algorithm for finding it as foilows: Step

(1) Find the shortest paths between all

pairs of nodes in H; Step (2) Consider those paths between uIN and uoLT such that u E P(v) u Q(v) u R(u); Step (3) Select as’ the optimal solution the minimum path among those considered in Step (2). Since constructing H does not take more time and number of processors than finding the shortest paths between all pairs of nodes, a minimum weighted dominating set of a circular-arc graph can be found in O(log’n) time using 0(n3/lcT n) processors. When the above algorithm is implemented time. Since this is sequentially, it requires sed tiii now for the the first seriai aigori thm pr m, the EPW of the weighted version of the

in

273

INFORMATION PROCESSING LETTERS

Volume 33, Number 6

hating set A total dominating set of a graph is a dominating set S such that every node of F isjoined ky XI edge to at least another node in S (e.g., see 121). The problem of finding a minimum weighted total dominating set can also be reduced to a ---ahlpm on a suitable directed netshortest path ~IU~~_._ work PI’. Assuming again without loss of generality there are only nonnegative weights, the nodes of H’ are obtained from those of H by splitting each node i,, (and iOUT, of course) into two further nodes, say ih and ifN (i& and i&-, respectively). There are directed arcs (ifN, i&,), (iL iguT), (i$L i&), each with length equal to wi, and also the arc (ifN, i&), with length wi + we, where: Wk(i)

=

min{wh: A, is properly contained within Ai } (if there is no such A,, then wktiJ = CQ).

As for the remaining arcs in H’, whose length is zero, they are defined as follows: there is an arc (i&, jrN) if and only if j E P(i), while there is an arc (ig,,, jg ) if and only if j E Q(i). The directed network H’ is constructed in such a way that only “P-arcs” enter into an “i$node” and leave from an “i&,-node”, while only “Q. F;” enter into an “ lIN ‘Q-node” and leave from an . rouT-node9’. This is because a total dominating set S cannot contain any isolated circular-arc, that is one which does not intersect with any other circular-arc in S. Since P-arcs are induced by circu!ar-arc intersection but Q-arcs are not, the only way of entering into an “IN-node” with a Q-arc and leaving from an “OUT-node” with a Q-arc is to take into account a circular-arc properly contained within another (indeed, that having minimum weight) by including arc (i&, &,.). The algorithm for finding a minimum weighted total dominating set is similar to that reported in section but applied to network H’ in which we consider those paths

10 February 1990

the same as before. Since an 0( n3) time sequential implementation of the above parallel algorithm is the first serial algorithm proposed till now for the problem, the resulting EPU is 8(1/lag n).

7. Conclusion In this paper, we provided parallel algorithms running in O(log’n) time for solving several combinatorial optimization problems on circular-arc graphs. As in [3], the common framework of all the proposed algorithms was a reduction to properly defined shortest path problems on suitable directed networks. In particular, both sequential and parallel algorithms for finding minimum weighted dominating sets and minimum weighted total dominating sets in circular-arc graphs have been presented here for the first time. Throughout the paper, we assumed that a circular-arc family was known. Whenever it happens that an n-node graph is given, one has to test whether it is a circular-arc granll r”’ 1% anA ?Urn*c+r~l~t V”I.“LlUY) if possible, a circular-arc representation of it. Tucker [ 171 has devised an 0( n3 ) sequential algorithm for doing this task, but no parallel algorithm is known up to now.

erences

PI B. Awerbuch, A. Israeli and Y. Shiloach, Finding Euler circuits in logarithmic parallel time, In: Proc. 16th Ann. ACM Symp. on Thecry of Computing (1984) 249-257. 121A.A. Berrossi, Total domination in interval graphs, fnform. Process. Lett. 23 (1986) 131-l 34. [31 A.A. Bertossi anti M.A. Bonuccelli, Some parallel algorithms on interval graphs, Discrete Appl. Math. 16 (1987) lOl-iii. WI E. Dekel, D. Nassimi and S. Sahni, Parallel matrix and graph algorithms, SIAM J. Comput. 18 (1981) 657-61~. PI E. Dekel and S. Sahni, Binary trees and para!!el scheduling algorithms, k’Ei;,E Trans. Comput. 32 (1983) 307-315. El F. Gavril, Algorithms on circular-arc grayhJ, it’tfworks 4 (1974) 357-369.

VI M.C. Golumbic, Algorithmic Graph Theory anti Perfect Graphs (Academic Press, New York, !98O!, ‘81 U.I. Gupta, D.T. Lee and J.Y.-T. Leung, Efficient al@XiihS FE in!erval graphs and circular arc graphs, Net-

Volume 33, Number 6

INFORMATION

PROCESSING

]9] W.-L. Hsu, Maximum weight clique algorithms for circular-arc graphs and circle graphs, SIAM J. Com~~ut. 14 (1984) 224-231. [lo] W.-L. Hsu and K.H. Tsai, Linear time algorithms on circular-arc graphs, In: Proc. 26th Allerton Conf: on Communication, Control and Computing (1988). [ll] A. Israeli and Y. Shiloach, An improved parallel algorithm for maximal matching, Inform. Process. Lett. 22 (1986) 57-60. [12] G.A.P. Kindervater and J.K. Lenstra, An introduction to parallelism in combinatorial optimization, DLx;ete Appl. Maths 14 (1986) 135-156. [13] D.E. Mulier and F.P. Preparata, Bounds to complexities

LETTERS

10 February

1990

of networks for sorting and switching, J. Assoc. Comput. Mach. 22 (1975) 195-201. [14] M.J. Quinn and N. Deo, Parallel graph algorithms, Comput. Surveys 16 (1984) 319-348. [ 151 F.S. Roberts, Discrete Mathematical Eodels, with Applications to Social, Bio!ogicai and ~nvironmenttxf .pFob!ems (Prentice-Hall, Englewood Cliffs, NJ, 1976). [16] W.-K. Shih and W.-L. Hsu, An O(n log n + m log log n) maximum weight clique algorithm for circular-arc graphs, Inform. Process. Lett. 31 (3) (1989) 129-134. [17] A. Tucker, An efficient test for circular-arc graphs, SIAM J. Copput. 9 (1980) l-24.

281