*Article* **Total Roman {3}-Domination: The Complexity and Linear-Time Algorithm for Trees**

**Xinyue Liu, Huiqin Jiang, Pu Wu and Zehui Shao \***

Institute of Computing Science and Technology, Guangzhou University, Guangzhou 510006, China; xinyue050420@outlook.com or 2111906061@e.gzhu.edu.cn (X.L.); hq.jiang@hotmail.com or 1111906006@e.gzhu.edu.cn (H.J.); puwu1997@126.com or 2111806056@e.gzhu.edu.cn (P.W.)

**\*** Correspondence: zshao@gzhu.edu.cn

**Abstract:** For a simple graph *G* = (*V*, *E*) with no isolated vertices, a total Roman {3}-dominating function(TR3DF) on *<sup>G</sup>* is a function *<sup>f</sup>* : *<sup>V</sup>*(*G*) → {0, 1, 2, 3} having the property that (i) <sup>∑</sup>*w*∈*N*(*v*) *<sup>f</sup>*(*w*) <sup>≥</sup> <sup>3</sup> if *<sup>f</sup>*(*v*) = 0; (ii) <sup>∑</sup>*w*∈*N*(*v*) *<sup>f</sup>*(*w*) <sup>≥</sup> 2 if *<sup>f</sup>*(*v*) = 1; and (iii) every vertex *<sup>v</sup>* with *<sup>f</sup>*(*v*) <sup>=</sup> 0 has a neighbor *<sup>u</sup>* with *<sup>f</sup>*(*u*) <sup>=</sup> 0 for every vertex *<sup>v</sup>* <sup>∈</sup> *<sup>V</sup>*(*G*). The weight of a TR3DF *<sup>f</sup>* is the sum *<sup>f</sup>*(*V*) = <sup>∑</sup>*v*∈*V*(*G*) *<sup>f</sup>*(*v*) and the minimum weight of a total Roman {3}-dominating function on *G* is called the total Roman {3}-domination number denoted by *<sup>γ</sup>t*{*R*3}(*G*). In this paper, we show that the total Roman {3} domination problem is NP-complete for planar graphs and chordal bipartite graphs. Finally, we present a linear-time algorithm to compute the value of *<sup>γ</sup>t*{*R*3} for trees.

**Keywords:** dominating set; total roman {3}-domination; NP-complete; linear-time algorithm

#### **1. Introduction**

Let *G* = (*V*, *E*) be a graph with vertex set *V* = *V*(*G*) and edge set *E* = *E*(*G*). For every vertex *v* ∈ *V*, the open neighborhood *NG*(*v*) = *N*(*v*) = {*u* ∈ *V*(*G*) : *uv* ∈ *E*(*G*)} and the closed neighborhood *NG*[*v*] = *N*[*v*] = *N*(*v*) ∪ {*v*}. We denote the degree of *v* by *dG*(*v*) = *d*(*v*) = |*NG*(*v*)|. A vertex of degree one is called a leaf and its neighbor is a support vertex, and a support vertex is called a strong support if it is adjacent to at least two leaves. Let *Sn* be a star with order *n*. A tree *T* is an acyclic connected graph. *G* = (*G*<sup>1</sup> ∪ *G*2) is a union graph *G* such that *V*(*G*) = *V*(*G*1) ∪ *V*(*G*2) and *E*(*G*) = *E*(*G*1) ∪ *E*(*G*2).

Given a graph *G* and a positive integer *k*, assume that *f* : *V*(*G*) → {0, 1, 2, ..., *k*} is a function, and suppose that (*V*0, *V*1, .., *Vk*) is the ordered partition of *V* introduced by *f* , where *Vi* = {*v* ∈ *V*(*G*) : *f*(*v*) = *i*} for *i* ∈ {0, 1, ..., *k*}. Then we can write *f* = (*V*0, *V*1, .., *Vk*) and *<sup>ω</sup>f*(*V*(*G*)) = <sup>∑</sup>*v*∈*V*(*G*) *<sup>f</sup>*(*v*) is the weight of a function *<sup>f</sup>* of *<sup>G</sup>*.

A subset S of a vertex set *V*(*G*) is a dominating set of *G* if for every vertex *v* ∈ *V*(*G*) \ *S*, there exists a vertex *w* ∈ *S* such that *wv* is an edge of *G*. The domination number of *G* denoted by *γ*(*G*) is the smallest cardinality of a dominating set *S* of *G* [1]. A function *f* : *V*(*G*) → {0, 1} is called a dominating function(DF) on *G* if every vertex *u* with *f*(*u*) = 0 has a vertex *v* ∈ *N*(*u*) such that *f*(*v*) = 1 [2]. The dominating set problem(DSP) is to find the domination number of *G*, which has been deeply and widely studied in recent years [3–7].

A subset S of a vertex set *V*(*G*) is a total dominating set of *G* if - *<sup>v</sup>*∈*<sup>S</sup> <sup>N</sup>*(*v*) = *<sup>V</sup>*(*G*). The total domination number of *G* denoted by *γt*(*G*) is the smallest cardinality of a total dominating set *S* of *G* [8]. The literature on the subject of total domination in graphs has been surveyed and provided in detail in a recent book [9]. Moreover, Michael A. Henning et al. presented a survey of selected recent results on total domination in graphs [10].

The mathematical concept of Roman domination is originally defined and discussed by Stewart et al. [11] and ReVelle et al. [12]. A Roman dominating function(RDF) on graph *G* is a function *f* : *V*(*G*) → {0, 1, 2} such that every vertex *v* ∈ *V*(*G*) for which *f*(*u*) = 0 is adjacent to at least one vertex *u* with *f*(*u*) = 2 [13]. The Roman domination number of

**Citation:** Liu, X.; Jiang, H.; Wu, P.; Shao, Z. Total Roman {3}-Domination: The Complexity and Linear-Time Algorithm for Trees. *Mathematics* **2021**, *9*, 293. https://doi.org/10.3390/ math9030293

Academic Editor: Javier Alcaraz Received: 22 December 2020 Accepted: 26 January 2021 Published: 2 February 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional clai-ms in published maps and institutio-nal affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

*G* is the minimum weight overall *RDF*s, denoted by *γR*(*G*) [14]. On the basis of Roman domination, signed Roman domination [15], double Roman domination [16] and total Roman domination [17] have been proposed recently.

The total Roman dominating function(TRDF) on *G* is an RDF *f* on G with an additional property that every vertex *v* ∈ *V*(*G*) with *f*(*v*) = 0 has a neighbor *u* with *f*(*u*) = 0. Let *γtR*(*G*) denote the minimum weight of all TRDFs on *G*. A TRDF on G with weight *γtR*(*G*) is called a *γtR*(*G*)-function. The conception of TRDF was first defined by Hossein Ahangar et al. [18]. In addition, Nicolás Campanelli et al. studied the total Roman domination number of the lexicographic product of graphs [17] and Chloe Lampman et al. presented some basic results of Edge-Critical Graphs [19].

The Roman {2}-dominating function (also named Italian domination) *f* [20] introduced by Chellali et al. which is defined as follows: *f* : *V*(*G*) → {0, 1, 2} has the property that <sup>∑</sup>*u*∈*N*(*v*) *<sup>f</sup>*(*u*) ≥ 2 for *<sup>f</sup>*(*v*) = 0 [21]. Chellali et al. proved that the Roman {2}-domination problem is NP-complete for bipartite graphs [21]. Hangdi Chen showed that the Roman {2}-domination problem is NP-complete for split graphs, and gave a linear-time algorithm for finding the minimum weight of Roman {2}-dominating function in block graphs [22]. As a generalization of Roman domination, Michael A. Henning et al. studied the relationship between Roman {2}-domination and dominating set parameters in trees [20].

A Roman {3}-dominating function(R{3}DF) *f* defined by Mojdeh et al. [23], which is defined as follows: *f* : *V*(*G*) → {0, 1, 2, 3} has the property that for every vertex *v* ∈ *V*(*G*) with *<sup>f</sup>*(*v*) ∈ {0, 1} and <sup>∑</sup>*u*∈*N*(*v*) *<sup>f</sup>*(*u*) ≥ 3. Mojdeh et al. presented an upper bound on the Roman {3}-domination number of a connected graph *G*, characterized the graphs attaining upper bound and showed that the Roman {3}-domination problem is NP-complete, even restricted to bipartite graphs [23] .

The total Roman {3}-domination [24] was studied recently . The total Roman {3}-dominating function(TR3DF) on a graph *G* is an R{3}DF on *G* with the additional property that every vertex *v* ∈ *V*(*G*) with *f*(*v*) = 0 has a neighbor *w* with *f*(*w*) = 0. The minimum weight of a total Roman {3}-dominating function on *<sup>G</sup>* denoted by *<sup>γ</sup>t*{*R*3}(*G*) is named the total Roman {3}-domination number of *<sup>G</sup>*. A *<sup>γ</sup>t*{*R*3}(*G*)-function is a total Roman {3}-dominating function on G with weight *<sup>γ</sup>t*{*R*3}(*G*). Doost Ali Mojdeh et al. showed the relationship among total Roman {3}-domination, total domination, and total Roman{2}-domination parameters. They also presented an upper bound on the total Roman {3}-domination number of a connected graph *G* and characterized the graphs arriving this bound. Finally, they investigated that total Roman {3}-domination problem is NP-complete for bipartite graphs [24].

In this paper, we further investigate the complexity of total Roman {3}-domination in planar graphs and chordal bipartite graphs. Moreover, we give a linear-time algorithm to compute the *<sup>γ</sup>t*{*R*3} for trees which answer the problem that it is possible to construct a polynomial algorithm for computing the number of total Roman {3}-domination for trees [24].

#### **2. Complexity**

In this section, we study the complexity of total Roman {3}-domination of graph. We show that the total Roman {3}-domination problem is NP-complete for planar graphs and chordal bipartite graphs. Consider the following decision problem.

#### **Total Roman {3}-Domination Problem TR3DP.**

**Instance:** Graph *G* = (*V*, *E*) , and a positive integer *m*. **Question:** Does *G* have a total Roman {3}-function with weight at most *m*?

Please note that the dominating set problem is NP-complete for planar graphs [25] and chordal bipartite graphs [26]. We show the NP-completeness results by reducing the well-known NP-complete problem, dominating set, to TR3D.

Let *G* be a graph on n vertices. Let *Tv* be the treewith *V*(*Tv*) = {*v*, *va*, *vb*, *vc*, *vd*, *ve*, *vf* , *vp*, *vq*}, *E*(*Tv*) = {*vva*, *vavc*, *vcve*, *vcvf* , *vvb*, *vbvd*, *vdvp*, *vdvq*}, as depicted in Figure 1.

**Figure 1.** The tree *Tv*.

Let *G* be the graph obtained by adding edges between *v* ∈ *Tv* and *v* ∈ *Tv* if *v v* ∈ *E*(*G*) from the union of the trees *Tv* for *v* ∈ *V*(*G*). Please note that |*V*(*G* )| = *n* × |*V*(*Tv*)| = 9*n* and |*E*(*G* )| = |*E*(*G*)| + *n* × |*E*(*Tv*)| = |*E*(*G*)| + 8*n*.

**Lemma 1.** *If G is a planar graph or chordal bipartite graph , so is G .*

**Lemma 2.** *([24]) Let Sn be a star with n* ≥ <sup>3</sup>*, then <sup>γ</sup>t*{*R*3}(*Sn*) = <sup>4</sup>*.*

**Lemma 3.** *Let g be a TR3DF of G. If v is a strong support vertex of G, then ωg*(*N*[*v*]) ≥ 4*.*

**Proof of Lemma 3.** Let *v*1, *v*2, .., *vk* be leaves of *v* with *k* ≥ 2. Since *g*(*N*[*vi*]) ≥ 3 for *i* ∈ {1, 2, .., *k*}, we have *g*(*vi*) ≥ 3 − *g*(*v*) for *i* ∈ {1, 2, .., *k*}. Then *ωg*(*N*[*v*]) = *g*(*v*) + <sup>∑</sup>*i*∈{1,2,...,*k*} *<sup>g</sup>*(*vi*) ≥ *<sup>g</sup>*(*v*) + *<sup>g</sup>*(*v*1) + *<sup>g</sup>*(*v*2) ≥ <sup>6</sup> − *<sup>g</sup>*(*v*). If *<sup>g</sup>*(*v*) ≤ 2, it is clear that *<sup>ω</sup>g*(*N*[*v*]) ≥ 4. If *g*(*v*) = 3, there exists a vertex *u* ∈ *N*(*v*) with *g*(*u*) = 0. Then *ωg*(*N*[*v*]) ≥ 4.

**Lemma 4.** *If f is a DF of G with ωf*(*G*) ≤ -*, then there exists a TR*3*DF g of G with ωg*(*G* ) ≤ -+ 8*n.*

**Proof of Lemma 4.** For each *v* ∈ *V*(*G*), we define *g* as follows: *V*(*Tv*) → {0, 1, 2, 3}, *g*(*va*) = *g*(*vb*) = 1, *g*(*vc*) = *g*(*vd*) = 3, *g*(*v*) = *f*(*v*), *g*(*x*) = 0 otherwise. It is clear that *g* is a *TR*3*DF* of *G* . Therefore we have that *ωg*(*G* ) = *ωf*(*G*) + 8*n* ≤ -+ 8*n*.

**Claim 1.** *Let g be a TR*3*DF of G , then ωg*(*T <sup>v</sup>*) ≥ 8*.*

**Proof of Claim 1.** By Lemmas 2, 3 and definition, we have that *ωg*(*N*[*vc*]) ≥ 4 and *ωg*(*N*[*vd*]) ≥ 4. Since *N*(*vc*) *N*(*vd*) = ∅, then we can reduce *ωg*(*T <sup>v</sup>*) = *ωg*(*N*[*vc*]) + *ωg*(*N*[*vd*]) ≥ 8.

**Claim 2.** *If there exists a TR*3*DF h of G with h*(*va*) + *h*(*vb*) ≥ 3 *for va*, *vb* ∈ *V*(*Tv*)*, then there exists a TR*3*DF g of G such that ωg*(*G* ) ≤ *ωh*(*G* ) *and g*(*va*) + *g*(*vb*) ≤ 2*.*

**Proof of Claim 2.** By the definition of *TR*3*DF*, we have *ωh*(*N*[*ve*]) ≥ 3 and *ωh*(*N*[*vp*]) ≥ 3, then we have *ωh*(*T <sup>v</sup>*) ≥ 9.

If *h*(*v*) = 0, then we define *g* : *V*(*G* ) → {0, 1, 2, 3} such that *g*(*ve*) = *g*(*vf*) = *g*(*vp*) = *g*(*vq*) = 0, *g*(*v*) = *g*(*va*) = *g*(*vb*) = 1 , *g*(*vc*) = *g*(*vd*) = 3, *g*(*x*) = *h*(*x*) otherwise, seeing Figure 2. Therefore *g* is a *TR*3*DF* of *G* such that *g*(*va*) + *g*(*vb*) ≤ 2 and *ωg*(*G* ) = *ωh*(*G* ).

If *h*(*v*) ≥ 1, then we define *g* : *V*(*G* ) → {0, 1, 2, 3} such that *g*(*ve*) = *g*(*vf*) = *g*(*vp*) = *g*(*vq*) = 0, *g*(*va*) = *g*(*vb*) = 1 , *g*(*vc*) = *g*(*vd*) = 3, *g*(*x*) = *h*(*x*) otherwise. Therefore *g* is a *TR*3*DF* of *G* such that *g*(*va*) + *g*(*vb*) ≤ 2 and *ωg*(*G* ) ≤ *ωh*(*G* ).

**Figure 2.** Pre-labeling of *g*.

**Lemma 5.** *If g is a TR*3*DF of G with ωg*(*G* ) ≤ - + 8*n, then there exists a DF f of G with ωf*(*G*) ≤ -*.*

**Proof of Lemma 5.** By Claim 2, w.l.o.g, let *g* be a *TR*3*DF* of *G* with *g*(*va*) + *g*(*vb*) ≤ 2 for *va*, *vb* ∈ *V*(*Tv*), *v* ∈ *V*(*G*). Define *f* : *V*(*G*) → {0, 1} such that *f*(*v*) = *g*(*v*) if *g*(*v*) ≤ 1, and *f*(*v*) = 1 if *g*(*v*) ≥ 2. For each vertex *v* ∈ *V*(*G*), since *g*(*va*) + *g*(*vb*) ≤ 2, we have *g*(*v*) ≥ 1 or there exists a vertex *u* ∈ *N*(*v*) ∩ *V*(*G*) such that *g*(*u*) ≥ 1. Therefore *f* is *DSF* of *G* and *ωf*(*G*) ≤ *ωg*(*G*) − 8*n* ≤ by Claim 1.

**Theorem 1.** *By Lemmas 1, 4, 5, the total Roman {3}-domination problem is NP-complete for planar graphs and chordal bipartite graphs.*

#### **3. A Linear-Time Algorithm for Total Roman {3}-Domination in Trees**

In this section, we present a linear-time algorithm to compute the minimum weight of total Roman {3}-dominating function for trees. First, we define the following concepts:

**Definition 1.** *Let <sup>u</sup> be a vertex of G, and let <sup>F</sup>*(*i*,*j*) *<sup>u</sup>*,*<sup>G</sup> on G be a function f* : *V*(*G*) → {0, 1, 2, 3} *having the property that (i) <sup>f</sup>*(*u*) = *i,* <sup>∑</sup>*w*∈*N*(*u*) *<sup>f</sup>*(*w*) ≥ *j; (ii)* ∀*<sup>v</sup>* ∈ *<sup>V</sup>*(*G*) \ {*u*}*,* <sup>∑</sup>*p*∈*N*[*v*] *<sup>f</sup>*(*p*) ≥ <sup>3</sup> *if f*(*v*) ≤ <sup>2</sup> *and* <sup>∑</sup>*p*∈*N*(*v*) *<sup>f</sup>*(*p*) ≥ <sup>1</sup> *if f*(*v*) = <sup>3</sup>*.*

**Definition 2.** *The minimum weight overall <sup>F</sup>*(*i*,*j*) *<sup>u</sup>*,*<sup>G</sup> functions on <sup>G</sup> denoted by <sup>γ</sup>*(*i*,*j*) *tR*<sup>3</sup> (*u*, *G*) *is the <sup>F</sup>*(*i*,*j*) *<sup>u</sup>*,*<sup>G</sup> number of G, and a <sup>γ</sup>*(*i*,*j*) *tR*<sup>3</sup> (*u*, *<sup>G</sup>*)*-function is an F*(*i*,*j*) *<sup>u</sup>*,*<sup>G</sup> function on G with weight <sup>γ</sup>*(*i*,*j*) *tR*<sup>3</sup> (*u*, *G*)*.*

**Definition 3.** *Let coil*(*x*) *be a function defined as follows: coil*(*x*) *= x*, *x* ≥ 0; 0, *x* < 0.

**Lemma 6.** *For any graph G with specific vertex u, we have*

$$\gamma\_{t\{R3\}}(\mathcal{G}) = \min\{\gamma\_{t\mathcal{R3}}^{(0,3)}(\mathfrak{u}, \mathcal{G}), \gamma\_{t\mathcal{R3}}^{(1,2)}(\mathfrak{u}, \mathcal{G}), \gamma\_{t\mathcal{R3}}^{(2,1)}(\mathfrak{u}, \mathcal{G}), \gamma\_{t\mathcal{R3}}^{(3,1)}(\mathfrak{u}, \mathcal{G})\}.$$

**Lemma 7.** *Suppose T*<sup>1</sup> *and T*<sup>2</sup> *are trees with specific vertices v and u, respectively. Let T*<sup>3</sup> *be the tree with the specific vertex u, which is obtained by joining a new edge uv from the union of T*<sup>1</sup> *and T*2*, as depicted in Figure 3.*

**Figure 3.** *T*3.

*Then the following statements hold for <sup>γ</sup>*(*i*,*j*) *tR*<sup>3</sup> (*u*, *Tk*)*.*

(*a*) *For i* = 0*, j* ∈ {0, 1, 2, 3}*, we have :*

$$\begin{aligned} \gamma\_{t\gets 3}^{(0,j)}(\boldsymbol{u}, T\_3) &= \min \{ \gamma\_{t\gets 3}^{(3,1)}(\boldsymbol{v}, T\_1) + \gamma\_{t\gets 3}^{(0,0)}(\boldsymbol{u}, T\_2), \\ &\quad \min \{ \gamma\_{t\gets 3}^{(s,3-s)}(\boldsymbol{v}, T\_1) + \gamma\_{t\gets 3}^{(0,\operatorname{coli}(j-s))}(\boldsymbol{u}, T\_2) | \boldsymbol{s} = 0, 1, 2 \} \} \end{aligned}$$

(*b*) *For i* ∈ {1, 2, 3}*, j* ∈ {0, 1, 2, 3}*, we have :*

$$\gamma\_{lR3}^{(i,j)}(\mathbf{u}, T\_3) = \min \{ \gamma\_{lR3}^{(s,coil(3-i-s))}(\mathbf{v}, T\_1) + \gamma\_{lR3}^{(i,coil(j-s))}(\mathbf{u}, T\_2) | \mathbf{s} = \mathbf{0}, 1, 2, 3 \} $$

**Proof of Lemma 7.** Let *V*(*T* <sup>1</sup>) = *V*(*T*1) ∪ {*u*}, *E*(*T* <sup>1</sup>) = *<sup>E</sup>*(*T*1) ∪ {*vu*}, *<sup>f</sup>* be a *<sup>γ</sup>*(*i*,*j*) *tR*<sup>3</sup> (*u*, *G*) function of *T*3, *f* be the restriction of *f* on *T* <sup>1</sup> and *f* be the restriction of *f* on *T*2.

(a) If *<sup>f</sup>* is a *<sup>γ</sup>*(0,*j*) *tR*<sup>3</sup> (*u*, *T*3)-function on *T*<sup>3</sup> , for *j* ∈ {0, 1, 2, 3}. By the definition of *γ*(*i*,*j*) *tR*<sup>3</sup> (*u*, *<sup>G</sup>*)-function, we have that if *<sup>f</sup>*(*v*) = 3, then <sup>∑</sup>*w*∈*NT*3\{*u*} *<sup>f</sup>*(*w*) <sup>≥</sup> 1. It follows from the fact that *<sup>f</sup>* is a *<sup>γ</sup>*(0,*j*) *tR*<sup>3</sup> (*u*, *G*)-function of *T*<sup>3</sup> if and only if *f* = *f* ∪ *f* , where at least one of followings holds: (i) *f* is a *γ*(0,0) *tR*<sup>3</sup> (*u*, *<sup>G</sup>*)-function of *<sup>T</sup>*<sup>2</sup> , *<sup>f</sup>* is a *<sup>γ</sup>*(3,1) *tR*<sup>3</sup> (*v*, *T*1)-function of *<sup>T</sup>*<sup>1</sup> ; (ii) *<sup>f</sup>* is a *<sup>γ</sup>*(0,*coil*(*j*−*s*)) *tR*<sup>3</sup> (*u*, *<sup>G</sup>*)-function of *<sup>T</sup>*<sup>2</sup> , *<sup>f</sup>* is a *<sup>γ</sup>*(*s*,3−*s*) *tR*<sup>3</sup> (*v*, *T*1)-function of *T*1,for *s* ∈ {0, 1, 2}.

(b) It follows from the fact that *<sup>f</sup>* is a *<sup>γ</sup>*(*i*,*j*) *tR*<sup>3</sup> (*u*, *T*3)-function of *T*3, for *i* ∈ {1, 2, 3}, *j* ∈ {0, 1, 2, 3} if and only if *f*=*f* ∪ *f* , where *<sup>f</sup>* is a *<sup>γ</sup>*(*i*,*coli*(*j*−*s*)) *tR*<sup>3</sup> (*u*, *T*2)-function of *T*<sup>2</sup> and *f* is a *γ*(*t*,*coil*(3−*i*−*s*)) *tR*<sup>3</sup> (*v*, *T*1)-function of *T*1, for *s* ∈ {0, 1, 2, 3}.

Lemmas 6 and 7 give the following dynamic programming algorithm 1 for the total Roman {3}-domination problem in trees.

## **Algorithm 1** Counting *γt*{*R*3} in trees.

**Input:** A tree *T* with a tree ordering [*v*1, *v*2, .., *vn*]. **Output:** the TR3D number *<sup>γ</sup>t*{*R*3}(*T*) of *<sup>T</sup>*. **for** *p* = 1 *to n* **do for** *i* = 0 *to 3, j* = 0 *to3* **do if** *j=0* **then** *<sup>γ</sup>*(*i*,*j*)(*vp*) <sup>←</sup> *<sup>i</sup>*; **<sup>5</sup> else** *<sup>γ</sup>*(*i*,*j*)(*vp*) <sup>←</sup> <sup>∞</sup>; **for** *p* = 1 *to n* − 1 **do** let *vq* be the parent of *vp* **for** *i* = 0 *to* 3 *and j* = 0 *to* 3 **do if** *i=0* **then** *<sup>γ</sup>*(*i*,*j*)(*vq*)=min{min{*γ*(*s*,3−*<sup>s</sup>*)(*vp*) + *<sup>γ</sup>*(*i*,*coil*(*j*−*<sup>s</sup>*))(*vq*)|*<sup>s</sup>* <sup>=</sup> 0, 1, 2}; *<sup>γ</sup>*(3,1)(*vp*) + *<sup>γ</sup>*(*i*,0)(*vq*)}; **<sup>12</sup> else** *<sup>γ</sup>*(*i*,*j*)(*vq*)=min{*γ*(*s*,*coil*(3−*i*−*<sup>s</sup>*))(*vp*) + *<sup>γ</sup>*(*i*,*coil*(*j*−*<sup>s</sup>*))(*vq*)|*<sup>s</sup>* <sup>=</sup> 0, 1, 2, 3}; **return** *min*{*γ*(0,3)(*vn*), *<sup>γ</sup>*(1,2)(*vn*), *<sup>γ</sup>*(2,1)(*vn*), *<sup>γ</sup>*(3,1)(*vn*)}

#### **4. Conclusions**

The total Roman {3}-domination problem was introduced and studied in [24] , and it was proven to be NP-complete for bipartite graphs. In this paper , we prove that the total Roman {3}-domination problem is NP-complete for planar graphs or chordal bipartite graphs , and showed a linear-time algorithm for total Roman {3}-domination problem on trees. For the algorithmic aspects of the total Roman {3}-domination problem , designing exact algorithms or approximation algorithms on general graphs , or polynomial algorithms for total Roman {3}-domination problem on some special classes graphs deserve further research.

**Author Contributions:** Conceptualization, X.L., H.J. and Z.S.; writing, X.L. and Z.S.; review, H.J. and Z.S.; investigation: P.W. All authors have contributed equally to this work. All authors have read and agreed to the possible publication of the manuscript.

**Funding:** This work is supported by the Natural Science Foundation of Guangdong Province under Grant 2018A0303130115.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Abbreviations**

The following abbreviations are used in this manuscript:


#### **References**

