On the k-rainbow domination in graphs with bounded tree-width

Given a positive integer k and a graph G = (V,E), a function f from V to the power set of Ik is called a k-rainbow function if for each vertex v 2 V , f(v) = ; implies [u2N(v)f(u) = Ik where N(v) is the set of all neighbors of vertex v and Ik = {1, . . . , k}. Finding a k-rainbow function of minimum weight of P v2V |f(v)|, which is called the k-rainbow domination problem, is known to be NP-complete for arbitrary graphs and values of k. In this paper, we propose a dynamic programming algorithm to solve the k-rainbow domination problem for graphs with bounded treewidth tw in O ⇣ 2 + 1 tw n ⌘ time, where G has n vertices. Moreover, we also show that the same approach is applicable to solve the weighted k-rainbow domination problem with the same complexity. Therefore, both problems of k-rainbow and weighted k-rainbow domination belong to the class FPT, or fixed parameter tractable, with respect to tree-width. In addition to formally showing the correctness of our algorithms, we also implemented these algorithms to illustrate some examples.


Introduction
Different variations of dominating sets are defined and studied in graph theory and solving these problems algorithmically is an active field of study both among mathematicians and computer scientists [16]. The concept of k-rainbow domination for a graph G was initially proposed and studied in [7,8]. It is shown that it coincides with the standard domination of the Cartesian product of G with K k , the complete graph with k vertices.
It is known that rainbow domination problem is NP-complete for arbitrary graphs and values of k. More interestingly, the k-rainbow domination is still NP-complete for chordal and bipartite graphs [11]. The same thing holds for split graphs [15] or planar graphs [26]. Even, when restricted to chordal or bipartite graphs, the 2-rainbow domination problem is known to be NP-complete [9]. By the way, the k-rainbow domination problem can be solved in linear time for trees [11,26] and for cographs [15]. In addition, polynomial time algorithms are proposed to solve 2-rainbow domination for interval graphs [15] and k-rainbow domination for strongly chordal graphs [10].
Beside algorithmic and computational complexity approaches to the k-rainbow domination problem, several scholars tried to provide bounds on k-rainbow domination number for some classes of graphs and/or for specific values of k. For example, the 2-rainbow domination number for a variety of graph classes such as paths, cycles and suns in [9], generalized Peterson graphs P (n, 2) in [20] is determined. In addition to these exact values, upper or lower bounds for the 2-rainbow domination number in some other kinds of graphs such as generalized Peterson graphs P (n, 3) in [25], and a tight upper bound for generalized Peterson graphs P (n, k) for n 4k + 1 in [22] are obtained. Another interesting topic studied for rainbow domination problem is bounding the 2-rainbow domination number of lexicographic product of two graphs G and H in terms of the 2-rainbow domination of G and H [19].
There is also a line of research comparing rainbow domination with other kinds of domination, e.g. Roman domination number in [24,14] and perfect domination in [13].
One trivial way to compute the k-rainbow domination number exactly is to use the fact that rk (G) = (G⇤K k ) [7,8]. This way, one can compute the exact value of rk (G) by iterative computing the (G⇤K k ). Note that this is feasible since rk (G)  k ⇥ (G) by Vizing's conjecture. The time complexity of this approach is O 1.4969 n⇥k for G with n vertices [21,15].
It has been shown that k-rainbow domination problem belongs to FPT, i.e. fixed parameter tractable, in [15]. Their proof uses the fact that every graph property which can be expressed in monadic second-order logic is fixed-parameter tractable with respect to tree-width or rank-width [12] and then expresses the k-rainbow domination problem in monadic second-order logic.
In this paper, we will show that k-rainbow domination problem belongs to FPT by proposing a dynamic programming approach and give its runtime as O The rest of the paper is organized as follows. Some necessary topics in graph theory and krainbow domination are reviewed in Section 2. In Section 3, we first illustrate our fixed-parameter algorithm for 2-rainbow domination problem and is then followed by a rigorous correctness proof and runtime enhancement by a modification in handling join bags. In Section 4, we will generalize the algorithm of Section 3 for arbitrary values of k and obtain its runtime. Section 5 solves the wighted k-rainbow problem by the same algorithmic approach. A conclusion is drawn in Section 6. Finally, the algorithms of this paper are illustrated in several examples in Appendix A by implementing them in Python 2.7.1.

Preliminaries
In this section, we will review some vital topics and set our notation. Throughout the paper, graph G = (V, E) is a simple undirected graph with the set of the vertices V and the set of edges The k-rainbow domination problem for a graph G is finding a kRDF function f with minimum weight. The minimum weight of any kRDF on G is called the k-rainbow domination number of G and is denoted by rk (G). It is easy to see that 1-rainbow domination problem coincides with the ordinary domination problem. More interestingly, it is known that rk (G) = (G⇤K k ) where (G), ⇤ and K k denote the ordinary domination number of graph G, the Cartesian product of two graphs, and the complete graph with k vertices, respectively [8].
It is well-known that the k-rainbow domination problem is NP-complete. A main road of attack against NP-complete problems is studying their complexity with respect to some fixed parameter such as tree-width [1]. A problem is FPT if its running time with respect to a fixed parameter t and complexity parameter n is O f (t)n O (1) for an arbitrary function f which depends only on parameter t.
The notion of tree-width is proposed in [17,18] and is a famous fixed-parameter. Our presentation is taken from [3]. Given a graph G = (V, E), a tree decomposition of G is a pair defined as max i2I |X i | 1 and the tree-width of a graph G equals the minimum width over all tree decompositions of G and is denoted as tw(G), or simple tw whenever the G is clear from the context. Computing the tree-width of arbitrary graphs is an NP-complete problem [2]. However, finding exact or an approximate solution is an active field of research, e.g. [6,5]. Recently, it is shown that tree-width is computable in O ? (2.9512 n ) for a graph with n vertices in polynomial space [6]. Note that O ? (·) is used to suppress all other polynomially bounded terms dependent on the complexity parameter [23].
A tree decomposition T for graph G can be simply rooted by designating a bag as the root bag. A rooted tree decomposition is called nice whenever each bag i 2 I is one of the following types: • leaf bag: i has no child.
• forget bag: i has exactly one child j where X i ✓ X j and |X i | = |X j | 1.
• introduce bag: i has exactly one child j such that X j ✓ X i and |X i | = |X j | + 1.
• join bag: i has exactly two children j and j 0 where X i = X j = X j 0 .
In addition to being nice, if all leaf bags i satisfy |X i | = 1, then it is called very nice [4]. The input tree decomposition to our algorithm is supposed to be very nice, however, as Lemma 2.1 shows, any tree decomposition can be converted in polynomial time to a corresponding very nice one with the same tree-width. Note that Lemma 2.1 stated here is a corollary of Lemma 6 in [4], which was stated for nice tree decomposition rather very nice ones. It is easy to see that a very nice tree decomposition can be easily obtained from a nice tree decomposition by adding extra bags to leaves.
For a graph G and its corresponding tree decomposition T = ({X i } i2I , (I, F )), we associate a subgraph of G as G i = (V i , E i ) to each bag X i where V i is the union of all X j 2 X such that either j = i or j is a descendant of bag i in tree T and E i is the set of all edges in E which has both of its endpoints in V i .

Algorithm for 2-Rainbow Domination
In this section, we illustrate the idea of our proposed algorithm for k = 2 and consider its correctness and running time. The input to this algorithm is a graph G = (V, E) and its corresponding very nice tree decomposition T = (X , T = (I, F )) where X = {X i | i 2 I and X i ✓ V }. We assume that for every i 2 I, there is a fixed ordering on X i , i.e. X i = (x i 1 , · · · , x in i ) where For each bag X i , 5 |X i | different color labellings like L i = (`i 1 , . . . ,`i n i ) are defined where where card(`) denotes the cardinality of set`. It is worth noting that for each bag, the maximum number of color labels equals 5 tw +1 where the tree-width of graph is tw. For each bag X i , the cost and validation functions are of the form C i : , +1}, respectively. The first function denotes the cost of each coloring and the last one denotes the validity of the colorings. Finally, for coloring L m , s n (L m ) is defined as where

1-Initialization
Step:. For all leaf bags X i where i 2 I, the cost and validation functions are defined as and respectively, for all possible colorings L m = (`). Finally, s 1 (L m ) is defined as Lemma 3.1. The initialization step consisting of evaluating the cost and validation functions for a leaf node can be carried out in O (1) time.
Proof. The proof is clear considering the fact that the input tree decomposition is very nice. Therefore, every leaf bag has exactly one member and each of the cost and validation functions have at most 5 possible inputs.
Proof. It is clear.

2-Iterative
Updating:. In a bottom-up traversal of the tree decomposition, from the leaves to the root, after initialization step and based on the bag type, the cost and validation functions are calculated according to the following rules.
• INTRODUCE: Let i be an introduce bag with child j such that . . ,`n j is a coloring for bag X j and t 2 where L m = Proof. As we just replace the ; by {⇤} in function t and the cost of both is zero, then the cost function does not change.
Lemma 3.4. The cost and validation functions for introduce bag X i with child bag X j are defined as and Proof. In Equation (8), we consider the following cases for`: . The value of cost function does not change if the label of the introduced vertex`is {⇤} or ;.
This case can be shown with the same approach for the previous case.
For correctness of Equation (9), it is enough to verify its validity for color L m ⇥ ;. Since X i is the first node with vertex v present, then all of the neighbors of v appear in X i and its In other cases, the validity L m ⇥ ; is similar to the validity of L m .
It is not hard to verify the following statement.
Lemma 3.5. The cost function defined in Equation (8) is monotonous if the cost function for X j is also monotonous.
Lemma 3.6. The cost and validation functions defined in Equations (8) and (9) can be calculated in O (5 n i n i ) time.
Proof. For bag X i , there are 5 |X i | different color labels that we need to compute. Also, to compute the cost and validation functions for every color label, we need to spend O (|X i |) time. Therefore, the cost and validation functions are computable in O 5 |X i | |X i | time.
• FORGET: Let i is a forget bag with child j such that X i = X j \ {v}. Suppose that L m = `1, . . . ,`n j be a coloring for bag X j .
Lemma 3.7. The cost and validation functions for forget bag X i with child bag X j are defined as and where L m 0 = `1, . . . ,`n j 1 is a coloring for bag X i and Also, we have considered`n j as the corresponding color for vertex v. Finally, for n = 1, . . . , n j 1, we set s n (L m 0 ) = s n (L m ).
for bag X j . Since X i is a forget bag, then there are no other ascendant bags of bag X i which contains v. So, we consider minimum value of all C(L m ⇥`) needs to be computed, where L m ⇥`is a valid labeling. If all possible color labels of L m ⇥`are invalid, then label L m cannot lead to a valid color label for bag X i .
The following lemmas are easy to verify.
Lemma 3.8. The cost function defined in Equation (10) is monotonous if the cost function for X j is also monotonous.
Lemma 3.9. The cost and validation functions defined in Equations (10) and (11) can be calculated in O (5 n i ) time.
• JOIN: Let i is a join bag with two children j and j 0 . Since X i is a join bag, we know that These five cases partition the state space for possible colorings of bag X i and hence can be used to construct the cost and validation of colorings for X i . Lemma 3.10. The cost and validation function for join bag X i with children X j and X j 0 are defined as: and respectively, where We set s n (L m ) = s n (L m 0 ) \ s n (L m 00 ) for all n = 1, . . . , n i and (m 0 , m 00 ) 2 M m .
Proof. We determine color labels of bag X i using labels of bags X j and X j 0 . Suppose v 2 X i and nodes X j and X j 0 are children of X i . Also, assume that L m 0 = (`m If there are no any valid color labels L m 0 or L m 00 to compute L m , then we set C(L m ) = 1 and E(L m ) = 1, otherwise E(L r i ) = 1. Lemma 3.11. The cost function in Equation (13) is monotonous if the cost functions for X j and X j 0 are also monotonous.  (13) and (14) can be calculated in O (25 n i n i ).
Proof. These values can be calculated by combining the colorings for bags j and j 0 , which are totally O (25 n i n i ) pairs.

3-Final
Step:. Suppose that X i is the root of the tree decomposition T . Then, we have r,2 (G) = min r=1,...,5 n i

Correctness and Time Complexity
By the above steps, we have the following results.
Theorem 3.1. The value computed in Equation (17) is the 2-rainbow domination number of graph

G.
Proof. It is obvious that the domination computed in Equation (17) is the 2-rainbow domination as we just considered valid color labels in the root of the tree. The property of tree decomposition guarantees that every vertex in graph is labeled along the algorithm. In the leaf bags, we have initialized with the possible color labels corresponding to that leaf bag. For introduce bags, we have considered and computed the cost and validation of all color labels after addition of the new vertex. Also, for forget and join bags, we have chosen the minimum cost for among color labels. So, as all the vertices have labels and we have selected valid color labels in the tree root and also, minimum color label is preserved for each color label in the bottom-up approach of the algorithm, then the result is easily concluded. Let L m = (`i 1 ,`i 2 , · · · ,`i n i ) be a labeling for bag X i , and z d = |{t 2 {i 1 , i 2 , · · · , i n i } :`t = d and L m is a color label for bag X i }|, www.ejgta.org On the k-rainbow domination in graphs with bounded tree-width | M. A. Meybodi et al.
= 7 n i (9/7) n i = 9 n i Theorem 3.2. The value computed in Equation (17) is the 2-rainbow domination number of graph G if the division condition is changed as is described in this section.
Proof. The proof is similar to the proof of Theorem 3.1. (17) can be computed in O (9 tw N ) time for a graph G with N nodes and treewidth of tw given a very nice tree decomposition for it and that the improved division condition is used for join bags.

Theorem 3.3. The value in Equation
Proof. The proof is similar to the proof of Corollary 3.1, except that the division condition for join bags is different with time complexity of Lemma 3.13.

Generalization for arbitrary k
The algorithm stated in Section 3 can be easily generalized to compute the k-rainbow domination number of a graph G with N vertices in O . This is easily done by substituting the set {1, 2} by the set {1, . . . , k}, using the improved division condition stated in Section 3.2 and changing the way we compute the cost function of an introduce bag X i with child where bag X j is labeled by L m = `1, . . . ,`n j and`2 P ({1, . . . , k}) [ {⇤}.
Theorem 4.1. Given that X i is the root of the tree decomposition, then the value of min m=1,...,(2 k +1) By induction on the number of ⌃s in T , denoted as # ⌃ , we show T = 2 k+1 + 1 n i . If # ⌃ = 1, Let p 2 be given and suppose (18) is true for # ⌃ = p. Then Thus, (18) holds for # ⌃ = p + 1, and the proof of the induction step is complete. For 2-rainbow domination, we have # ⌃ = 4 so T = 9 n i . Also for k-rainbow domination number, it is easy to see that # ⌃ = 2 k , therefore we have T = (2 k+1 + 1) n i .

Weighted k-Rainbow Domination
In this section, we extend the approach discussed in Section 4 in order to find the weighted domination of a graph G = (V, E). Each vertex v 2 V has k positive weights which are denoted by w j (v) for j = 1, . . . , k. Then, for a rainbow function f : Note that f (v) is the same as the label of v. The only modification we need to make in the approach of Section 4 is to change the cost functions. Everything else remains the same. To be precise, we will use the following modified cost functions: 1. for a leaf bag X i = {v} with coloring L m = (`1), its cost function is modified as 2. for an introduce bag X i with child X j such that X i = X j [ {v}, we use the following cost function where bag X j is labeled by L m = `1, . . . ,`n j and`2 P ({1, . . . , k}) [ {⇤}. 3. for a forget bag, we use exactly the same approach. 4. for a join node X i with children X j and X j 0 , we will change Equation (13) to where X i = (v 1 , . . . , v n i ) and w t (v) for t ✓ {1, . . . , k} and vertex v 2 V is defined as Theorem 5.1. Given that X i is the root of the tree decomposition, then the value of Proof. The proof is similar to the proof of Theorem 4.1.

Conclusion
In this paper, we presented a novel dynamic programming algorithm to solve the k-rainbow domination for graphs with bounded tree-width tw in O This problem is known to be NP-hard for general graphs and arbitrary values of k. We also used the same approach to solve the weighted k-rainbow domination problem with the same complexity. So, we have shown that both problems belong to the class FPT with respect to tree-width. We have also illustrated our algorithms by implementing them in Python.  We also run the algorithm to compute the 3-rainbow domination for the graph G which gives r,3 = 5 with 3-rainbow function f 3 defined as follows The values of cost, validation and symbol functions for leaf bag {D}, forget bag {C}, introduce bag {C, D} and join bag {A, C} are given in Tables 5, 6, 7 and 8 respectively. Finally, we run the algorithm to compute the weighted 2-rainbow domination for the graph G with respect to the weights in Table 9. The algorithm returns wr,2 = 8 with weighted 2-rainbow function f w,2 defined as follows

www.ejgta.org
On the k-rainbow domination in graphs with bounded tree-width | M. A. Meybodi et al.

www.ejgta.org
On the k-rainbow domination in graphs with bounded tree-width | M. A. Meybodi et al.      Table 9: Weights for vertices of graph G where the i th row corresponds to the weight of color i for the vertex of corresponding column A B C D E F 1 2 3 2 2 3 1 2 3 1 1 2 2 3