A linear time algorithm to solve the weighted perfect domination problem in series-parallel graphs

A linear time algorithm to solve the weighted perfect domination problem in series-parallel graphs

192 European Journal of Operational Research 73 (1994) 192-198 North-Holland Theory and Methodology A linear time algorithm to solve the weighted p...

379KB Sizes 1 Downloads 153 Views

192

European Journal of Operational Research 73 (1994) 192-198 North-Holland

Theory and Methodology

A linear time algorithm to solve the weighted perfect domination problem in series-parallel graphs Chain-Chin Yen Switching Technology Laboratory, Telecommunication Laboratories, Ministry of Communication P.O. Box 71, Chungli 32020, Taiwan, ROC, and Department of Computer Science, National Tsing Hua University, Hsinchu 30043, Taiwan, ROC

R.C.T. Lee

Department of Computer Science, National Tsing Hua University, Hsinchu 30043, Taiwan, ROC Received July 1991; revised April 1992

Abstract: In this paper, we consider the weighted perfect domination problem in series-parallel graphs. Suppose G = (V, E ) is a graph in which every vertex x ~ V has a cost c(x) and every edge e ~ E has a cost c(e). The weighted perfect domination problem is to find a subset D c V such that every vertex not in D is adjacent to exactly one vertex in D and its total cost c(D) - E{c(x): x ~ D} + E{c(x, y): x D, y ~ D and (x, y ) ~ E } is minimum. This problem is NP-complete for bipartite graphs and chordal graphs. In this paper, we present a linear time algorithm for the problem in series-parallel graphs. Keywords: Perfect domination; Series-parallel graph; Parsing tree; Dynamic programming

1. Introduction

A dominating set of a graph G = (V, E ) is a subset of vertices D c V such that every vertex not in D is adjacent to some vertex in D. The domination problem is to find a dominating set of minimum size. The domination problem and its variants have been extensively studied during the past two decades; see [1-4,9]. This p a p e r discusses one v a r i a n t 0 f the domination problem, which is called the perfect domination [12]. A perfect dominating set of a graph G = (V, E ) is a subset of vertices D c V such that every vertex not in D is adjacent to exactly one vertex in D. The perfect domination problem is to find a minimum sized perfect dominating set of a graph. Suppose furthermore in the graph G = (V, E), every vertex x ~ V has a cost c(x) and every edge e ~ E has a cost c(e). The weighted perfect domination problem is to find a perfect dominating set D of G such that its total cost c(D) - ~ { c ( x ) : x ~ D } + Y'~{c(x, y ) : x ~ D , y ~ D and ( x , y) ~ E } Correspondence to: R.C.T. Lee, Department of Computer Science, National Tsing Hua University, Hsinchu 30043, Taiwan, ROC. 0377-2217/94/$07.00 © 1994 - Elsevier Science B.V. All rights reserved SSDI 0377-2217(92)00074-E

C.-C. Yen, R.C.T. Lee / Linear time algorithm to solve the weighted perfect domination problem

193

OY

Figure la. Two series-parallel graphs G and H

is minimum. This minimum cost is denoted by 6(G, c). In the case where c(x) = 1 for each vertex x and c(e) = 0 for each edge e, c(D) = I D I and the problem becomes the perfect domination problem. The weighted perfect domination problem can be viewed as a model for the following location problem. In the model, each vertex of G represents a customer and a potential site for a facility. A perfect dominating set corresponds to a set of facilities located at D c V so that a customer in D is served by the facility at the same place and a customer not in D is served by the unique facility adjacent to it. Suppose that a facility x in D costs c(x) and customer x in D is served free by the facility at x, then a customer x not in D is served with cost c(x, y) by the unique facility y in D. The concept of perfect domination was introduced by Weichsel [17] who studied perfect domination in hypercubes. A related concept, called efficient domination, was introduced in [7]. In [12], the authors proved that the perfect domination problem is NP-complete for bipartite graphs and chordal graphs by reducing the known NP-complete problem 'Exact Cover' to it. In the same paper, a linear time algorithm for the weighted perfect domination problem was given for trees by using the dynamic programming approach. This paper gives a linear algorithm for the series-parallel graphs by means of dynamic programming as well. The algorithm for the domination, the connected domination and the cycle domination problems in series-parallel graphs were given in [8], [11] and [5] respectively.

2. Series-parallel graphs (Two-terminal) series-parallel graphs are obtained only by the following recursive rules: (1) An edge (x, y) is a series-parallel graph with terminals x and y. (2) Suppose that G is a series-parallel graph with terminals x and y, and H is a series-parallel graph with terminals z and w. Then the series connection of G and H by identifying y with z is a series-parallel graph and the parallel connection of G and H by identifying x with z, and y with w is a series-parallel graph. For the two series-parallel graphs G and H in Figure la, Figure lb shows their series connection and Figure lc shows their parallel connection. In [8], a linear time algorithm to recognize whether a graph G is a series-parallel graph was given. In case of a positive answer, a parsing tree is also given. A parsing tree T of a series-parallel graph G = (V, E ) (with terminals x and y) is a binary tree, in which every internal node has exactly two children and there are ]EI leaves. Each edge (u, v ) ~ E corresponds to a leaf of T which is labelled by (u, c,). Each internal node of T corresponds to the series-parallel graph obtained from a series or parallel operation of its two children, and labelled by the terminals of the graph. The root of the parsing tree is labelled (x, y), which represents the graph G. Figure 2b shows a parsing tree T of the series-parallel graph G in Figure 2a.

Figure lb. The series connection of G and H

C.-C. Yen, R.C. T. Lee / Linear time algorithm to solve the weighted perfect domination problem

194

Figure

lc. The parallel

connection

of G and H

Our dynamic programming algorithm for the weighted perfect domination problem in a series-parallel graph G works on a parsing tree T of G. It starts from the leaves of T and works toward to the root of the tree. Note that a parsing tree of a series-parallel graph G may be not unique, but we do not need the uniqueness of parsing trees in our algorithm.

3. The weighted perfect domination problem in series-parallel

graphs

Suppose G is a series or parallel connection of two series-parallel graphs G, and G,. The main idea of our algorithm is to compute 6(G, c) from 6(G,, c) and 6(G,, c). For technical reasons, we define the following. For (Y,p E {l, 01, 00) and (a, /?&perfect dominating set of a series-parallel graph G = (V, E) with terminals x and y is a perfect dominating set D of G

if a#OOand

G-Ix}

if cu=OOand @ZOO,

G-(Y) G - {x,

if CY# 00 and p = 00, Y}

p#OO,

if (Y= 00 and p = 00,

such that XED XeD

Y~D

y@D N[y]nD=@

i N[x]nD=fi

v-r

v6

Figure

2a. A series-parallel

graph

G

C.-C. Yen, R. C. T. Lee / Linear time algorithm to solve the weightedperfect domination problem

195

(Vl,V3) (b)

W

(V1,V4)

~

,

v

3

)

(W4,V5) Figure 2b. A parsing tree T of the series-parallel graph G

The minimum weight of an (a,/3)-perfect dominating set of G is denoted by 3(G, x ", y~, c). The fol|owing lemmas are the bases of our algorithm to solve the weighted perfect domination problem in series-parallel graphs. Lemmas 3.1 and 3.2 can be easily proved by using the definition of 3(G, x", yt~, c). Lemma 3.1. For any weighted series-parallel graph G with terminals x and y, we have

(3.a)

8(G, c) = min{6(G, x ~, y~, e): a,/3 ~ {1, 01}}

Lemma 3.2. I f G is a series-parallel graph consisting of two vertices x and y and an edge xy between them, then

3(G, x', y', c ) = c ( x ) + c ( y ) ,

(3.2a)

a ( G , x 1, yOl, c ) = c ( x )

(3.2b)

-+-c(xy),

(~(G, x 1, yOO, c ) = ~,

(3.2c)

~(G, x °', y', c ) = c ( x y ) + c ( y ) ,

(3.2d)

~(G, x m, ym, c ) = 0%

(3.2e)

#(G, x m, yOO, c ) = 0%

(3.2f)

,~(G, x °°, yl, c ) = ~,

(3.2g)

3(G, x °°, ym, c ) = 0%

(3.2h)

a(G, x °°, y00, c ) = 0.

(3.2i)

Lemma 3.3. I f G is a series connection o f a series-parallel graph G 1 with terminals x and y and another series-parallel graph G 2 with terminals z and w, then for any a and 3 ~ {1, 01, 00}:

I (cl, xO,/, 6(G,x~,wt~,c)=min~(Ga,

x% y ° l , c ) + ~ ( G 2 ,

zl,:,c) c(y),} z°°,wt~,c),

.

(3.3)

~(~(G1 ' x a, yOO, c ) + 6 ( G 2, z °', w t~, c)

Proof. For any (a,/3)-perfect dominating set D of G, either y = z ~ D or y = z e? D. For the former case, D = D 1UD 2 where D 1 is an (a, 1)-perfect dominating set of G 1 and D 2 is a (1, /3)-perfect

196

C.-C. Yen, R.C.T. Lee / Linear time algorithm to solve the weighted perfect domination problem

dominating set of G2, and c(D) = c ( D 1) + c ( D 2) - c ( y ) . For the latter case, D = D 1 U D 2 where either D 1 is an (a, 01)-perfect dominating set of G 1 and G 2 is a (00,/3)-perfect dominating set of G 2, or D 1 is an (a, 00)-perfect dominating set of G 1 and D 2 is a (01,/3)-perfect dominating set of G2; and c(D) = c(D 1) + c(D2). Thus the lemma holds. [] I.emma 3.4. If G is a parallel connection of a series-parallel graph G 1 with terminals x and y and another series-parallel graph G 2 with terminals z and w, then

6(G, x 1, yl, c) = 6 ( G l, x 1, yl, c) + 6 ( G 2, z 1, w 1, c) - c ( x ) - c ( y ) ,

(3.4a)

xl' y°l) + a(G2' Zl' wol) } - c ( x ) , ~ ( a , x l, y°l, c ) = m i n ( ~a(Gl' ( G I , X, ' yOO)-b~(a2, z1 wOo)

(3.4b)

6(G, x 1, yOO,c ) = 6 ( G 1 , x 1, Yoo, c) + 6(G2, z 1, w oo, c) - c ( x ) ,

(3.4c)

6(G,x ° l , y l , c ) = m i n

6(Gl, X°°,Y

+6(G2 ,zol,wl )

(~(G1, x 01, y°l)q--~(G2, Z00, W00)] /~(G1, X01, yoo) q_t~(a2, zOO,wOl) 6 ( G , x 01, y°l, c ) = m i n l ~ ( G 1 , x 00, Y ° l ) + ~(G2, zOl, wOO)l,

(3.4e)

~a(Gl, x°°, y°°)W~(G2, z°l,w°l)) 6(G, zOl, yOO,c)=min{:l;:',x°l'Y°°)+6(G2'z°°'w°°) 3(G,x °°,yl,c)=6(Gl,x 6(G,

}

xOO, y0O) + 8(G2 ' z0,, wOO) '

(3.4f)

° ° , y l c)+6(G2, z oo, w 1 , c ) - c ( y ) ,

(3.4g)

xOO, ym, c ) = m i n / 8 ( G l '

x°°' y m ) + 6(G2 ' zOO, wOO)}

6(G1 ' xOO, yOO)+/~(G2, z °°, w ° l ) , ,

6(G, x °°, yOO,c)=3(G1, x °°, yOO,c)+ 6(G2, z °°, w °°, c).

(3.4h) (3.4i)

Proof. a) For any (1, 1)-perfect dominating set D of G, D = D 1 L ) 0 2 where D 1 is a (1, D-perfect dominating set of G 1 and D 2 is a (1, D-perfect dominating set of G2; and c(D) = c(D 1) + c(O 2) - c(x) - c ( y ) . Thus (3.4a) holds. b) For any (1, 01)-perfect dominating set D of G, D = D 1 U D 2 where either D 1 is a (1, 01)-perfect dominating set of G 1 and D 2 is a (1, 00)-perfect dominating set of G2, or D 1 is a (1, 00)-perfect dominating set of G 1 and D 2 is a (1, 01)-perfect dominating set of G2; and c(D) = c(D 0 + c(D 2) - c(x) in either case. Thus (3.4b) holds. c) For any (1, 00)-perfect dominating set D of G, D = D 1 U D 2 where D 1 is a (1, 00)-perfect dominating set of G 1 and D 2 is a (1, 00)-perfect dominating set of G2; and c(D) = c(D 1) + c(D 2) - c(x). Thus (3.4c) holds. d) For any (01, D-perfect dominating set D of G, D = D 1 L)D 2 where either O 1 is a (01, D-perfect dominating set of G 1 and D 2 is a (00, D-perfect dominating set of G2, o r 9 1 is a (00, 1)-perfect dominating set of G 1 and D 2 is a (01, D-perfect dominating set of G2; and c(D) = c(D 0 + c(D 2) - c(y) in either case. Thus (3.4d) holds. e) For any (01, 01)-perfect dominating set D of G, D = D 1 U D 2 where O 1 is a (01, 01)-perfect dominating set of G 1 and D 2 is a (00, 00)-perfect dominating set of G 2, or D 1 is a (01, 00)-perfect dominating set of G 1 and D 2 is a (00, 01)-perfect dominating set of G2, o r O 1 is a (00, 01)-perfect

C.-C. Yen, R.C.T. Lee / Linear time algorithm to solve the weighted perfect domination problem

197

dominating set of G~ and D 2 is a (01, 00)-perfect dominating set of G2, or D 1 is a (00, 00)-perfect dominating set of G 1 and D 2 is a (01, 01)-perfect dominating set of G2; and c(D) = c(D 0 + c ( D 2) in any case. Thus (3.4e) holds. f) For any (01, 00)-perfect dominating set D of G, D = D 1 U D 2 where either D~ is a (01, 00)-perfect dominating set of G 1 and D 2 is a (00, 00)-perfect dominating set of G 2, or D 1 is a (00, 00)-perfect dominating set of G 1 and D 2 is a (01, 00)-perfect dominating set of G2; and c ( D ) = c(D I) + c ( D 2) in either case. Thus (3.4f) holds. g) For any (00, D-perfect dominating set D of G, D = D 1 U D 2 where D 1 is a (00, 1)-perfect dominating set of G 1 and D 2 is a (00, 1)-perfect dominating set of G2; and c(D) = c(D 1) + c(D2). Thus (3.4g) holds. h) For any (00, 01)-perfect dominating set D of G, D = D 1 U D 2 where either D~ is a (00, 01)-perfect dominating set of G~ and D 2 is a (00, 00)-perfect dominating set of G 2, or D 1 is a (00, 00)-perfect dominating set of G 1 and D 2 is a (00, 01)-perfect dominating set of G2; and c(D) = c(D 1) + c(D 2) in either case. Thus (3.4 h) holds. i) For any (00, 00)-perfect dominating set D of G, D = D~ U D 2 where D~ is a (00, 00)-perfect dominating set of G 1 and D 2 is a (00, 00)-perfect dominating set of G2; and c(D) = c(D l) + c(D2). Thus (3.4i) holds. [] Based on the above lemmas, we now present our linear time algorithm for solving the weighted perfect domination problem in series-parallel graphs.

Algorithm WPD-SP Input. A series-parallel graph G = (V, E ) in which every vertex x has a cost c(x) and every edge e has a cost c(e). Output. 8( G , c ). Method. Construct a parsing tree T of G; T * *- T; do while ( T * ~ ~b); Choose a leaf node N of T* and delete it from T * ; Case 1. N corresponds to a series-parallel graph G consisting of two vertices x and y and an edge xy: Apply (3.2a-i) to compute all 8(G, x ", y~, c); Case 2. N has two children N 1 and N2, where N~ corresponds to a series-parallel graph G1 with terminals x and y and N 2 corresponds to a series-parallel graph G 2 with terminals z and w. G is a series connection of G~ and G2: Apply (3.3) to compute all 8(G, x ~, yt3, c); Case 3. N has two children N l and N 2, where N 1 corresponds to a series-parallel graph G 1 with terminals x and y and N 2 corresponds to a series-parallel graph G 2 with terminals z and w. G is a parallel connection of G~ and G2: Apply (3.4a-i) to compute all 8(G, x ~, yt3, c); end do while; 8(G, c) = min{8(G, x ~, yt3, c): a , / 3 ~ {1, 01}} where x and y are two terminals of graph G; end of WPD-SP. Theorem 3.5. Algorithm WPD-SP solves the weighted perfect domination problem in series-parallel graphs in linear time. Proof. The construction of the parsing tree takes O(I V I) time [8]. T h e r e are O(I E l ) leaf nodes on the parsing tree. Since the parsing tree is a binary tree, there are O( I E l) nodes on the tree. Therefore it takes O ( I E I ) time to complete the process. Since for a planar graph, I E I < 3 1 V I - 6 , and a seriesparallel graph is also a planar graph, the time complexity of our algorithm needs O(I V I) time. []

198

C.-C. Yen, R.C.T. Lee / Linear time algorithm to solve the weighted perfect domination problem

4. Conclusion T h e main result of this p a p e r is to give a linear time algorithm for the weighted perfect domination p r o b l e m in series-parallel graphs. N o t e that the algorithm is optimal since any algorithm for the p r o b l e m has to process all vertices of the graph. T h e p r o b l e m was known to be N P - c o m p l e t e in bipartite graphs and chordal graphs. A linear time algorithm was also known previously for the p r o b l e m in trees. W e expect that the p r o b l e m is also solvable for special chordal graphs, e.g. k-trees, internal graphs and strongly chordal graphs.

References [1] Chang, G.J., "Labeling algorithms for domination problems in sun-free chordal graphs", Discrete Applied Mathematics 22 (1989) 21-34. [2] Chang, G.J., and Nemhauser, G.L., "The k-domination and k-stability problems on sun-free chordal graphs", SlAM Journal on Alg. Discrete Mathematics 5 (1984) 332-345. [3] Cockayne, E.J., "Domination of undirected graphs - A survey", Springer-Verlag, Berlin, Lecture Notes in Mathematics 642 (1978) 141-147. [4] Cockayne, E.J., and Hedetniemi, S.T., "Towards a theory of domination in graphs", Networks 7 (1977) 247-261. [5] Colbourn, C.J., and Stewart, L.K., "Dominating cycles on series-parallel", Ars Combinatoria 19A (1985) 107-112. [6] Duffin, R.J., "Topology of series-parallel networks", Journal of Mathematics Analysis and Applications 10 (1965) 303-318. [7] Hedetniemi, S., "Open algorithmic problems in trees", manuscript, 1990. [8] Kikuno, T., Yoshida, N., and Kakuda, Y., "A linear algorithm for the domination number of a series-parallel graph", Discrete Applied Mathematics 5 (1983) 299-311. [9] Laskar, R., and Walikan, H.B., "On domination related concepts in graph theory", Springer-Verlag, Lecture Notes in Mathematics 885 (1980) 308-320, Combinatorics and Graph Theory Proceedings. [10] Weichsel, P.M., "Large subgraphs of hypercubes; Steiner systems and codes", preprint, 1989. [11] White, K., Farber, M., and Pulleyblank, W., "Steiner trees, connected domination and strongly chordal graphs", Networks 15 (1985) 109-124. [12] Yen, C.C., and Lee, R.C.T., "The weighted perfect domination problem", Information Processing Letters 35 (1990) 295-299.