1 Introduction and preliminaries

Let \([n]=\{1,2,\ldots ,n\}\) be the set of positive integers at most n. For every pair of positive integers n and t,  the Sierpiński graph \(S(K_n,t)\) is defined as the simple graph with vertex set \([n]^t=\{v_1v_2\ldots v_t\mid v_i\in [n]~\text {for}~1\le i\le t\}\), in which \(u_1u_2\ldots u_t\) and \(v_1v_2\ldots v_t\) are adjacent if and only if there exists \(s\in [t]\) satisfying

$$\begin{aligned} \left\{ \begin{array}{ll} u_j=v_j &{} \quad \text {if}~j<s; \\ u_s\ne v_s; &{} \\ u_j=v_s~\text {and}~v_j=u_s &{} \quad \text {if}~j>s. \end{array}\right. \end{aligned}$$

In short, the consecutively repeated entries in a vertex are often written together. For example, the vertex \(u_1u_2\underbrace{u_3\ldots u_3}_{t-2}\) can be denoted by \(u_1u_2u_3^{t-2}.\) See Fig. 1 as an example of \(S(K_n,t)\) when \(n=4\) and \(t=3.\)

Fig. 1
figure 1

Sierpiński graph \(S(K_4,3)\)

Let \(G=(V,E)\) be a graph with vertex set V and edge set E. For each \(v\in V,\) \(N_G(v)\) denotes the set of vertices adjacent to v in G, and \(N_G[v]=N_G(v)\cup \{v\}.\) A set \(D\subseteq V\) is said to be dominating in G if \(\cup _{v\in D}N_G[v]=V.\) The domination number \(\gamma (G)\) of G is the minimum cardinality among all dominating sets of G. It is well known, for example, see [7], that testing whether \(\gamma (G)\le k\) or not for some input k is an NP-complete problem. A Roman dominating function on G is defined as a function \(f:V\rightarrow \{0,1,2\}\) such that every vertex \(u\in V\) with \(f(u)=0\) has at least a neighbor \(v\in N_G(u)\) satisfying \(f(v)=2.\) The weight of f is realized as \(f(V)=\sum _{v\in V} f(v),\) and the Roman domination number of G, denoted by \(\gamma _R(G),\) is the minimum weight among all Roman dominating functions of G. A double Roman dominating function on G is defined as a function \(f:V\rightarrow \{0,1,2,3\}\) such that

  1. (i)

    every vertex \(u\in V\) with \(f(u)=0\) has at least one neighbor \(v\in N_G(u)\) satisfying \(f(v)=3\) or at least two distinct neighbors \(w,x\in N_G(u)\) satisfying \(f(w)=f(x)=2,\) and

  2. (ii)

    every vertex \(u\in V\) with \(f(u)=1\) has at least one neighbor \(v\in N_G(u)\) satisfying \(f(v)\ge 2.\)

Similarly, the weight of f is realized as \(f(V)=\sum _{v\in V} f(v),\) and the double Roman domination number of G, denoted by \(\gamma _{dR}(G),\) is the minimum weight among all double Roman dominating functions of G.

Klavžar and Milutinović introduced the graph \(S(K_n,t)\) in [12] and noticed that when \(n=3\) those graphs are isomorphic to the Tower of Hanoi graphs. Later in [13], \(S(K_n,t)\) have been called Sierpiński graphs and studied from many aspects, for example, in [9, 14]. One can refer to [10, Chapter 3] and [11, Section 4.2.2] for a more systematic overview about the Sierpiński graphs. The Roman domination was defined in [16, 17] and has been widely studied. The authors in [5, 6] proposed inspiring properties and problems involved with Roman domination in graphs. In 2016, Beeler et al. pioneered the study of double Roman domination in [4]. The decision of double Roman domination numbers was verified to be NP-complete for some families of graphs in [1]. Some upper and lower bounds for \(\gamma _{dR}(G)\) were given in [2, 3, 18] in terms of the number of vertices and various parameters in a graph.

A 1-perfect code (or an efficient dominating set) in a graph G is a vertex subset of V(G) with the property that the closed neighborhoods of its elements form a partition of V(G). In [13, Theorem 3.6], Klavžar et al. proved that \(S(K_n,t)\) posses a unique 1-perfect code if t is even, and exactly n 1-perfect codes if t is odd. Furthermore, they calculate the values of \(\gamma (S(K_n,t))\) in [13, Theorem 3.8] as follows.

Theorem 1.1

$$\begin{aligned} \gamma (S(K_n,t))=\left\lceil \frac{n^t}{n+1}\right\rceil = \left\{ \begin{array}{ll} \displaystyle \frac{n^t+1}{n+1} &{}\quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,odd}}; \\ \displaystyle \frac{n^t+n}{n+1} &{}\quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,even}}. \end{array}\right. \end{aligned}$$

In Ramezani et al. [15] made a progress in Roman domination numbers of Sierpiński graphs.

Theorem 1.2

For any integers \(n\ge 2\) and \(t\ge 1,\)

$$\begin{aligned} \gamma _R(S(K_n,t))\le \left\{ \begin{array}{ll} \displaystyle \frac{2n^t+2}{n+1} &{}\quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,odd}}; \\ \displaystyle \frac{2n^t+n-1}{n+1} &{}\quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,even}}. \end{array}\right. \end{aligned}$$

When \(t=2,\) the inequality in Theorem 1.2 was verified to be tight in [3]. Moreover, the authors in [3] also gave exact values of \(\gamma _{dR}(S(K_n,2))\). In this paper, we will show that the bounds in Theorem 1.2 are tight and determine the precise values of \(\gamma _{dR}(S(K_n,t))\) for each positive integer t.

This paper is organized as follows. Basic definitions and previous results are mentioned in Section 1. In Section 2, a dominating set \(D_{n,t}\) of the Sierpiński graph \(S(K_n,t)\) is constructed, whose cardinality is \(|D_{n,t}|=\gamma (S(K_n,t)).\) With the aid of \(D_{n,t}\), in Section 3, we reprove Theorem 1.1, and attain the Roman domination number \(\gamma _R(S(K_n,t))\) and the double Roman domination \(\gamma _{dR}(S(K_n,t))\) of \(S(K_n,t)\). The results are reviewed as a concluding remark in Section 4.

2 Dominating sets \(D_{n,t}\) of \(S(K_n,t)\)

We propose a subset \(D_{n,t}\) of vertices in \(S(K_n,t)\) for every pair of positive integers \(n\ge 2\) and t in this section. It will be shown that \(D_{n,t}\) is a dominating set for \(S(K_n,t).\) An extreme vertex in \(S(K_n,t)\) is a vertex of form \(\alpha ^t\) for some \(1\le \alpha \le n.\)

Definition 2.1

For positive integers n and t, let \(D_{n,t}\) be a subset of the vertex set \(V_{n,t}\) of \(S(K_n,t)\) such that \(D_{n,1}=\{1\}\) and \(D_{n,2}=\{11,21,\ldots ,n1\}.\) When \(t\ge 3,\) for each \(\mathbf{v} =v_1v_2\ldots v_{t-2}\in D_{n,t-2},\) let

$$\begin{aligned} E_1(\mathbf{v} )= & {} \big \{v_1v_2\ldots v_{t-3} v_{t-2} \alpha \alpha \mid \alpha \in [n]\big \}, \\ E_2(\mathbf{v} )= & {} \big \{v_1v_2\ldots v_{t-3}\alpha \beta v_{t-2}\mid \alpha ,\beta \in [n]\setminus \{v_{t-2}\}\big \}, \end{aligned}$$

and, if \(\mathbf{v} \) is not an extreme vertex, let \(\ell =\ell (\mathbf{v} )\) denote the largest number in \([t-3]\) satisfying \(v_\ell \ne v_{\ell +1}\) and

$$\begin{aligned} E_3(\mathbf{v} ) =\big \{v_1v_2\ldots v_{\ell -1}v_{\ell +1}v_\ell ^{t-\ell -2}\alpha v_\ell \mid \alpha \in [n]\setminus \{v_\ell \}\big \}. \end{aligned}$$

Then, we define \(D_{n,t}\) as follows.

  1. (i)

    If \(t\ge 3\) is odd, then

    $$\begin{aligned} D_{n,t}=E_1(1^{t-2})\cup E_2(1^{t-2})\cup \bigcup \limits _\mathbf{v \in D_{n,t-2}\setminus \{1^{t-2}\}}E_1(\mathbf{v} )\cup E_2(\mathbf{v} )\cup E_3(\mathbf{v} ). \end{aligned}$$
  2. (ii)

    If \(t\ge 4\) is even, then

    $$\begin{aligned} D_{n,t}=\{1^{t-2}\alpha 1\mid \alpha \in [n]\}\cup \bigcup \limits _\mathbf{v \in D_{n,t-2}\setminus \{1^{t-2}\}}E_1(\mathbf{v} )\cup E_2(\mathbf{v} )\cup E_3(\mathbf{v} ). \end{aligned}$$

The sets \(D_{n,t}\) are constructed inductively by odd and even t, respectively. For example, one can see the subset \(D_{3,4}\) of vertices in \(S(K_3,4)\) in Fig. 2.

Fig. 2
figure 2

Set \(D_{3,4}\) (filled dots) in \(S(K_3,4)\)

In the rest of this section, we aim to describe the properties of \(D_{n,t}.\)

Remark 2.2

Some quick observations involved with \(D_{n,t}\) are given below.

  1. (i)

    We verify that \(1^t \in D_{n,t}\) while all of the vertices \(\{\alpha ^t\mid \alpha \in [n]\setminus \{1\}\}\) are not in \(D_{n,t}\) so that Definition 2.1 is well defined. Since the vertices in \(E_2(\mathbf{v} )\) and \(E_3(\mathbf{v} )\) are obviously non-extreme vertices, we focus on \(E_1(\mathbf{v} ).\) Clearly, \(E_1(\mathbf{v} )\) contains an extreme vertex in \(D_{n,t}\) if and only if \(\mathbf{v} \) is an extreme vertex in \(D_{n,t-2}\). Moreover, 1 and 11 are the only extreme vertices in \(D_{n,1}\) and \(D_{n,2}\), respectively. The claim immediately follows by induction.

  2. (ii)

    Directly from Definition 2.1, \(|E_1(\mathbf{v} )|=n\) and \(|E_2(\mathbf{v} )|=(n-1)^2\) for \(\mathbf{v} \in D_{n,t-2}\) (if applicable), and \(|E_3(\mathbf{v} )|=n-1\) for \(\mathbf{v} \in D_{n,t-2}\setminus \{1^{t-2}\}.\)

To simplify the notation, let \(D_{n,t}^*\) denote the set \(D_{n,t}\setminus \{1^t\}\) throughout this paper.

Lemma 2.3

Let nt be positive integers not less than 3. If t is odd, then the sets \(E_1(\mathbf{u} ),\) \(E_2(\mathbf{v} ),\) and \(E_3(\mathbf{w} )\) are pairwise disjoint for \(\mathbf{u} ,\mathbf{v} \in D_{n,t-2},\) and \(\mathbf{w} \in D_{n,t-2}^*.\) If t is even, then the sets \(E_1(\mathbf{u} ),\) \(E_2(\mathbf{v} ),\) \(E_3(\mathbf{w} ),\) and \(\{1^{t-2}\alpha 1\mid \alpha \in [n]\}\) are pairwise disjoint for \(\mathbf{u} ,\mathbf{v} ,\mathbf{w} \in D_{n,t-2}^*.\) Additionally, for each \(1\le i\le 3,\) \(E_i(\mathbf{u} )\) and \(E_i(\mathbf{v} )\) are disjoint if \(\mathbf{u} \ne \mathbf{v} \) in their proper domain. (Proper domain means that \(\mathbf{u} ,\mathbf{v} \in D_{n,t-2}\) if \(1\le i\le 2\) and t is odd, while \(\mathbf{u} ,\mathbf{v} \in D_{n,t-2}^*\) if \(i=3\) or t is even.)

Proof

By Definition 2.1, every vertex in \(E_1(\mathbf{u} )\) has the same entries in the last two entries, while different for each vertex in \(E_2(\mathbf{v} )\cup E_3(\mathbf{w} ).\) Therefore, \(E_1(\mathbf{u} )\) and \(E_2(\mathbf{v} )\cup E_3(\mathbf{w} )\) have empty intersection. Also, the \((t-2)\)th and last entries are identical for every vertex in \(E_3(\mathbf{w} )\), while distinct for any vertex in \(E_2(\mathbf{v} ).\) Hence, \(E_2(\mathbf{v} )\) and \(E_3(\mathbf{w} )\) have empty intersection. Then, we deal with the set \(\{1^{t-2}\alpha 1\mid \alpha \in [n]\}\) as n is even. For \(1\le i\le 3\) and \(\mathbf{u} \in D_{n,t-2}^*,\) we notice that all vertices in \(E_i(\mathbf{u} )\) do not have 1s on all entries other than the \((t-1)\)th position, and thus, \(E_i(\mathbf{u} )\cap \{1^{t-2}\alpha 1\mid \alpha \in [n]\}\) is empty. Lastly, for \(1\le i\le 3\) and \(\mathbf{u} \ne \mathbf{v} \) in their proper domain, the fact \(E_i(\mathbf{u} )\cap E_i(\mathbf{v} )=\emptyset \) can be attained directly from the definition of \(E_i\). The result follows. \(\square \)

Immediately from Lemma 2.3, we count the number of vertices in \(D_{n,t}.\)

Lemma 2.4

For positive integers \(n\ge 2\) and t,  the cardinality of \(D_{n,t}\) is

$$\begin{aligned} |D_{n,t}|=\left\lceil \frac{n^t}{n+1}\right\rceil . \end{aligned}$$

Proof

We fix n and prove the result by induction on t in 2 cases: t is odd and t is even.

When t is odd, we have \(|D_{n,1}|=|\{1\}|=1=\left\lceil n/(n+1)\right\rceil .\) Suppose that \(|D_{n,t-2}|=\lceil n^{t-2}/(n+1)\rceil \) for some odd \(t\ge 3.\) Then by Definition 2.1(i),

$$\begin{aligned} |D_{n,t}|= & {} n+(n-1)^2+n^2\cdot (|D_{n,t-2}|-1) \nonumber \\= & {} n+(n-1)^2+n^2\cdot \left( \frac{n^{t-2}+1}{n+1}-1\right) \nonumber \\= & {} \frac{n^t+1}{n+1} = \left\lceil \frac{n^t}{n+1}\right\rceil , \end{aligned}$$
(1)

where the equality in (1) can be referred to Remark 2.2(ii).

Let t be even. Then \(|D_{n,2}|=|\{\alpha 1\mid \alpha \in [n]\}|=n=\left\lceil n^2/(n+1)\right\rceil .\) Assume that \(|D_{n,t-2}|=\left\lceil n^{t-2}/(n+1)\right\rceil \) for some even \(t\ge 4.\) Then by Definition 2.1(ii),

$$\begin{aligned} |D_{n,t}|= & {} n+n^2\cdot (|D_{n,t-2}|-1) \nonumber \\= & {} n+n^2\cdot \left( \frac{n^{t-2}+n}{n+1}-1\right) \nonumber \\= & {} \frac{n^t+n}{n+1} = \left\lceil \frac{n^t}{n+1}\right\rceil , \end{aligned}$$
(2)

where the equality in (2) is referred to Remark 2.2(ii). The result follows. \(\square \)

In Lemma 2.3, we showed that all vertices are distinct in \(E_1,\) \(E_2,\) and \(E_3.\) Moreover, by observing the neighborhood, they are separated sufficiently far away. Recall that the distance between two vertices in a simple graph is the number of edges in a shortest path connecting them.

Lemma 2.5

Let \(n\ge 2\) and t be positive integers.

  1. (i)

    If t is odd, then every pair of distinct vertices in \(D_{n,t}\) have distance at least 3 in \(S(K_n,t).\)

  2. (ii)

    If t is even, then every pair of distinct vertices in \(D_{n,t}^*\) have distance at least 3 in \(S(K_n,t).\)

Proof

For a vertex \(\mathbf{v} \) in \(S(K_n,t),\) let \(N_{n,t}[\mathbf{v} ]\) denote the set containing the vertex \(\mathbf{v} \) and its neighbors in \(S(K_n,t)\). Two vertices \(\mathbf{u} \) and \(\mathbf{v} \) have distance at least 3 if and only if \(N_{n,t}[\mathbf{u} ]\) and \(N_{n,t}[\mathbf{v} ]\) have no intersection. In the following, we prove the result by induction on t as t is odd and even, respectively.

For (i), when t is odd, the result holds for \(D_{n,1}=\{1\},\) and we assume that it holds for \(D_{n,t-2}\) for some odd \(t\ge 3.\) By observing Definition 2.1, for each \(1\le i\le 3\) and \(\mathbf{u} \in D_{n,t-2},\) if \(\mathbf{x} \in E_i(\mathbf{u} )\) then the first \(t-2\) entries of a vertex in \(N_{n,t}[\mathbf{x} ]\) must be a vertex in \(N_{n,t-2}[\mathbf{u} ].\) Therefore, for two distinct vertices \(\mathbf{x} \in E_i(\mathbf{u} )\) and \(\mathbf{y} \in E_j(\mathbf{v} )\) in \(D_{n,t},\) where \(1\le i,j\le 3,\) if \(\mathbf{u} \) and \(\mathbf{v} \) are distinct vertices in \(D_{n,t-2}\) then \(N_{n,t}[\mathbf{x} ]\) and \(N_{n,t}[\mathbf{y} ]\) must have no intersection, or otherwise the first \(t-2\) entries of an element in \(N_{n,t}[\mathbf{x} ]\cap N_{n,t}[\mathbf{y} ]\) will be a vertex in \(N_{n,t-2}[\mathbf{u} ]\cap N_{n,t-2}[\mathbf{v} ]\) so that the distance of \(\mathbf{u} \) and \(\mathbf{v} \) is less than 3,  which contradicts the induction hypothesis. Now, suppose that \(\mathbf{x} \) and \(\mathbf{y} \) are two distinct vertices in \(D_{n,t}\) such that \(\mathbf{x} \in E_i(\mathbf{u} )\) and \(\mathbf{y} \in E_j(\mathbf{u} ),\) for some \(1\le i,j\le 3.\) Additionally, for a non-extreme vertex \(\mathbf{v} =v_1\ldots v_t\) in \(S(K_n,t),\) let \(\mathbf{v} ^\vdash \) denote the unique neighbor \(v_1\ldots v_{\ell -1}v_{\ell +1}v_{\ell }\ldots v_{\ell }\) of \(\mathbf{v} \) obtained by flipping the entries, where \(1\le \ell <t\) is the largest integer such that \(v_\ell \ne v_{\ell +1}.\) Note that \((\mathbf{v} ^\vdash )^\vdash =\mathbf{v} ,\) and hence \(\mathbf{x} =\mathbf{y} \) if and only if \(\mathbf{x} ^\vdash =\mathbf{y} ^\vdash .\) The discussion can be partitioned into the following cases.

Case 1. \(i=1\) and \(j=1.\)

Assume that \(\mathbf{x} =\{u_1\ldots u_{t-2}\alpha \alpha \}\) and \(\mathbf{y} =\{u_1\ldots u_{t-2}\beta \beta \}\), where \(\alpha \ne \beta .\) Then where \(\mathbf{x} ^\vdash \) exists if \(\mathbf{x} \) is not the all ones vertex. Therefore, if \(N_{n,t}[\mathbf{x} ]\cap N_{n,t}[\mathbf{y} ]\) is non-empty, then we may assume

$$\begin{aligned} \mathbf{x} ^\vdash =u_1\ldots u_{\ell -1}\alpha u_\ell \ldots u_\ell =u_1\ldots u_{t-2}\beta \lambda \in N_{n,t}[\mathbf{y} ], \end{aligned}$$
(3)

where \(\ell \le t-2\) is the largest number satisfying \(u_\ell \ne \alpha \) and \(\lambda \in [n].\) However, the \(\ell \)th entry in (3) implies \(u_\ell =\alpha ,\) which is a contradiction.

Case 2. \(i=1\) and \(j=2.\)

Assume that \(\mathbf{x} =\{u_1\ldots u_{t-2}\alpha \alpha \}\) and \(\mathbf{y} =\{u_1\ldots u_{t-3}\beta \lambda u_{t-2}\}\), where \(\beta ,\lambda \in [n]\setminus \{u_{t-2}\}.\) Since every vertex in \(N_{n,t}[\mathbf{y} ]\) is of the \((t-2)\)th entry \(\beta ,\) hence, if \(N_{n,t}[\mathbf{x} ]\) and \(N_{n,t}[\mathbf{y} ]\) has intersection then the only possibility is

$$\begin{aligned} \mathbf{x} ^\vdash =u_1\ldots u_{\ell -1}\alpha u_\ell \ldots u_\ell =u_1\ldots u_{t-3}\beta \lambda \delta \in N_{n,t}[\mathbf{y} ], \end{aligned}$$
(4)

where \(\ell \le t-2\) is the largest number satisfying \(u_\ell \ne \alpha \) and \(\delta \in [n].\) However, if \(\ell =t-2\) then a contradiction occurs because the \((t-1)\)th entry in (4) tells that \(u_{t-2}=\lambda ;\) if \(\ell <t-2\) then the \(\ell \)th entry in (4) implies \(u_\ell =\alpha ,\) which attains a contradiction also.

Case 3. \(i=2\) and \(j=2.\)

Assume that \(\mathbf{x} =\{u_1\ldots u_{t-3}\alpha \beta u_{t-2}\}\) and \(\mathbf{y} =\{u_1\ldots u_{t-3}\lambda \delta u_{t-2}\}\), where \(\alpha ,\beta ,\lambda ,\delta \in [n]\setminus \{u_{t-2}\}\) with \((\alpha ,\beta )\ne (\lambda ,\delta ).\) Notice that the \((t-3)\)th entries of every vertex in \(N_{n,t}[\mathbf{x} ]\) and \(N_{n,t}[\mathbf{y} ]\) are \(\alpha \) and \(\lambda ,\) respectively. Hence, if \(N_{n,t}[\mathbf{x} ]\cap N_{n,t}[\mathbf{y} ]\) is not empty then \(\alpha =\lambda \) so that \(\beta \ne \delta ,\) and we may assume

$$\begin{aligned} \mathbf{x} ^\vdash =u_1\ldots u_{t-3}\alpha u_{t-2}\beta =u_1\ldots u_{t-3}\lambda \delta \epsilon \in N_{n,t}[\mathbf{y} ], \end{aligned}$$
(5)

where \(\epsilon \in [n].\) However, a contradiction happens since the \((t-1)\)th entry in (5) says that \(\delta =u_{t-2}.\)

Case 4. \(i=1\) and \(j=3.\)

For the following cases involved with \(j=3,\) let \(\mathbf{u} \in D_{n,t-2}^*\) and \(h<t-2\) be the largest number satisfying \(u_h\ne u_{h+1}.\) Assume that \(\mathbf{x} =\{u_1\ldots u_{t-2}\alpha \alpha \}\) and \(\mathbf{y} =\{u_1\ldots u_{h-1}u_{h+1}u_h\ldots u_h\beta u_h\}\), where \(\beta \in [n]\setminus \{u_h\}.\) It is clear that the hth entry of each vertex in \(N_{n,t}[\mathbf{y} ]\) is \(u_{h+1}.\) Thus, if there exists an element in \(N_{n,t}[\mathbf{x} ]\cap N_{n,t}[\mathbf{y} ]\) then it is

$$\begin{aligned} \mathbf{x} ^\vdash =u_1\ldots u_{\ell -1}\alpha u_\ell \ldots u_\ell =u_1\ldots u_{h-1}u_{h+1}u_h\ldots u_h\beta \lambda \in N_{n,t}[\mathbf{y} ], \end{aligned}$$
(6)

where \(\ell \le t-2\) is the largest number satisfying \(u_\ell \ne \alpha \) and \(\lambda \in [n].\) Consequently, the only possibility is \(\ell =h\) and the last \(t-h\) entries are all \(u_h,\) which contradicts to \(\beta \ne u_h.\)

Case 5. \(i=2\) and \(j=3.\)

Assume that \(\mathbf{x} =\{u_1\ldots u_{t-3}\alpha \beta u_{t-2}\}\) and \(\mathbf{y} =\{u_1\ldots u_{h-1}u_{h+1}u_h\ldots u_h\lambda u_h\}\), where \(\alpha ,\beta \in [n]\setminus \{u_{t-2}\}\) and \(\lambda \in [n]\setminus \{u_h\}.\) From the fact that any vertex in \(N_{n,t}[\mathbf{x} ]\) has hth entry \(u_h,\) while \(u_{h+1}\) for those in \(N_{n,t}[\mathbf{y} ],\) it is obvious that \(N_{n,t}[\mathbf{x} ]\cap N_{n,t}[\mathbf{y} ]\) is the empty set.

Case 6. \(i=3\) and \(j=3.\)

Assume that \(\mathbf{x} =\{u_1\ldots u_{h-1}u_{h+1}u_h\ldots u_h\alpha u_h\}\) and \(\mathbf{y} =\{u_1\ldots u_{h-1}u_{h+1}u_h\ldots u_h\beta u_h\}\), where \(\alpha ,\beta \in [n]\setminus \{u_h\}\) with \(\alpha \ne \beta \). One can see that both of \(\mathbf{x} \) and \(\mathbf{y} \) have distinct last 2 entries, and they are different in the \((t-1)\)th entry only. Therefore, if \(N_{n,t}[\mathbf{x} ]\cap N_{n,t}[\mathbf{y} ]\) is non-empty, then we may assume

$$\begin{aligned} \mathbf{x} ^\vdash =u_1\ldots u_{h-1}u_{h+1}u_h\ldots u_h\alpha =u_1\ldots u_{h-1}u_{h+1}u_h\ldots u_h\beta \lambda \in N_{n,t}[\mathbf{y} ], \end{aligned}$$
(7)

where \(\lambda \in [n].\) However, the \((t-1)\)th entry in (7) indicates \(\beta =u_h,\) which is a contradiction.

For (ii), as t is even, we can check that the result holds for \(D_{n,2}^*=\{\alpha 1\mid \alpha \in [n]\setminus \{1\}\},\) and assume that it holds for \(D_{n,t-2}^*\) for some even \(t\ge 4.\) A similar argument can be made between \(E_1,\) \(E_2,\) and \(E_3\) as what we did for odd t,  but there is another set of vertices \(F=\{1^{t-2}\alpha 1\mid \alpha \in [n]\setminus \{1\}\}\) in \(D_{n,t}^*.\) Nevertheless, for every element \(\mathbf{x} \) in F,  the vertices in \(N_{n,t}[\mathbf{x} ]\) have only 1s in the first \(t-2\) entries, while for any \(\mathbf{y} \in E_i(\mathbf{u} )\) where \(\mathbf{u} \in D_{n,t-2}^*\) and \(i\in \{1,3\},\) the vertices in \(N_{n,t}[\mathbf{y} ]\) are not constant in the first \(t-2\) entries since \(\mathbf{u} \) is not an extreme vertex by Remark 2.2(i). Moreover, we can see that \(D_{n,t-2}\) and \(\{1^{t-3}\beta \mid \beta \in [n]\setminus \{1\}\}\) have no intersection, or otherwise \(1^{t-2}\) and \(1^{t-3}\beta \) are of distance 1 in \(S(K_n,t-2),\) which violates the induction hypothesis. Therefore, for \(\mathbf{y} \in E_{2}(\mathbf{u} )\) where \(\mathbf{u} \in D_{n,t-2}^*,\) the first \(t-2\) entries of any element from \(N_{n,t}[\mathbf{y} ]\) are not all 1s so that \(N_{n,t}[\mathbf{x} ]\cap N_{n,t}[\mathbf{y} ]=\emptyset \) for all \(\mathbf{x} \in F.\) The proof is completed. \(\square \)

We bring out the main property of the set \(D_{n,t}\) of vertices.

Theorem 2.6

For positive integers \(n\ge 2\) and t\(D_{n,t}\) forms a dominating set of \(S(K_n,t).\)

Proof

By Remark 2.2(i), each vertex in \(D_{n,t}^*\) is of degree n,  while \(1^t\) is of degree \(n-1.\) If t is odd, then from Lemma 2.5(i), \(N_{n,t}[\mathbf{v} ]\) are pairwise disjoint for all \(\mathbf{v} \in D_{n,t}.\) Therefore,

$$\begin{aligned} \left| \bigcup _\mathbf{v \in D_{n,t}}N_{n,t}[\mathbf{v} ]\right|= & {} \sum _\mathbf{v \in D_{n,t}}N_{n,t}[\mathbf{v} ] \nonumber \\= & {} (n+1)\cdot \left( \left\lceil \frac{n^t}{n+1}\right\rceil -1\right) +n\cdot 1 \nonumber \\= & {} (n+1)\cdot \left( \frac{n^t+1}{n+1}-1\right) +n = n^t, \end{aligned}$$
(8)

where (8) is from Lemma 2.4.

Next, assume that t is even. By Lemma 2.5(ii), \(N_{n,t}[\mathbf{v} ]\) are pairwise disjoint for all \(\mathbf{v} \in D_{n,t}^*.\) Furthermore, none of the vertices in \(D_{n,t}^*\) is adjacent to \(1^t\) in \(S(K_n,t),\) since by Definition 2.1(ii) the first \(t-1\) entries of each vertex in \(D_{n,t}^*\) are not all 1s. As a result,

$$\begin{aligned} \left| \bigcup _\mathbf{v \in D_{n,t}}N_{n,t}[\mathbf{v} ]\right|= & {} \left| \bigcup _\mathbf{v \in D_{n,t}^*}N_{n,t}[\mathbf{v} ]\right| +\left| N_{n,t}[1^t]\setminus \bigcup _\mathbf{v \in D_{n,t}^*}N_{n,t}[\mathbf{v} ]\right| \nonumber \\\ge & {} \left( \sum _\mathbf{v \in D_{n,t}^*}N_{n,t}[\mathbf{v} ]\right) +\left| \{1^t\}\right| \nonumber \\= & {} (n+1)\cdot \left( \left\lceil \frac{n^t}{n+1}\right\rceil -1\right) +1 \nonumber \\= & {} (n+1)\cdot \left( \frac{n^t+n}{n+1}-1\right) +1 = n^t, \end{aligned}$$
(9)

where (9) is from Lemma 2.4.

Therefore, the vertices in \(D_{n,t}\) and their neighbors include all \(n^t\) vertices in \(S(K_n,t)\). The result follows. \(\square \)

Remark 2.7

Recall that a 1-perfect code in a graph G is a vertex subset of V(G) with the property that the closed neighborhoods of its elements form a partition of V(G). In [8, Corollary 2.3], Gravier et al. found all 1-perfect codes of \(S(K_n,t)\). Therefore, when t is odd, \(D_{n,t}\) is a 1-perfect code by Lemma 2.5(i) and Theorem 2.6. However, when t is even, \(D_{n,t}\) is not a 1-perfect code since some vertices in \(D_{n,t}^*\) have distance 2 from the extreme vertex \(1^t.\)

3 Domination in \(S(K_n,t)\)

In this section, the exact values of domination numbers \(\gamma (S(K_n,t))\), Roman domination numbers \(\gamma _R(S(K_n,t))\), and double Roman domination numbers \(\gamma _{dR}(S(K_n,t))\) of the Sierpiński graphs \(S(K_n,t)\) are given.

3.1 Domination numbers

The set \(D_{n,t}\) of vertices is verified to be a dominating set for \(S(K_n,t)\) in Theorem 2.6. Its cardinality \(|D_{n,t}|\) is also obtained in Lemma 2.4, so the domination number \(\gamma (S(K_n,t))\) is attained. Additionally, it is well known that \(\gamma (S(K_n,t))\) has been found in 2002 by Klavžar et al. [13, Theorem 3.8]. Therefore, we just reprove it as follows.

Theorem 3.1

For every positive integers \(n\ge 2\) and t,  the domination number of the Sierpiński graph \(S(K_n,t)\) is

$$\begin{aligned} \gamma (S(K_n,t))=\left\lceil \frac{n^t}{n+1}\right\rceil . \end{aligned}$$

Proof

Firstly, since the maximum vertex degree in \(S(K_n,t)\) is n,  it is straightforward to see that

$$\begin{aligned} \gamma (S(K_n,t))\ge \left\lceil \frac{n^t}{n+1}\right\rceil , \end{aligned}$$

since there are \(n^t\) vertices in \(S(K_n,t).\)

Next, since the set \(D_{n,t}\) given in Definition 2.1 is shown to be a dominating set for \(S(K_n,t)\) in Theorem 2.6, we have

$$\begin{aligned} \gamma (S(K_n,t))\le |D_{n,t}|=\left\lceil \frac{n^t}{n+1}\right\rceil , \end{aligned}$$

in which the cardinality of \(D_{n,t}\) is counted in Lemma 2.4. The proof is completed. \(\square \)

3.2 Roman domination numbers

In this subsection, we extend the results and proof in Theorem 3.1 and obtain the Roman domination numbers of \(S(K_n,t).\) Furthermore, we confirm that the equalities hold in Theorem 1.2 for all nt.

Theorem 3.2

For every positive integers \(n\ge 2\) and t,  the Roman domination number of the Sierpiński graph \(S(K_n,t)\) is

$$\begin{aligned} \gamma _R(S(K_n,t))=\left\{ \begin{array}{ll} \displaystyle 2\left\lceil \frac{n^t}{n+1}\right\rceil &{}\quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,odd}}; \\ \displaystyle 2\left\lceil \frac{n^t}{n+1}\right\rceil -1 &{}\quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,even}}. \end{array}\right. \end{aligned}$$

Proof

Let \(f:V(S(K_n,t))\rightarrow \{0,1,2\}\) be a Roman dominating function on \(S(K_n,t),\) where \(V(S(K_n,t))\) is the set of vertices in \(S(K_n,t).\) Suppose that \(V_1\) and \(V_2\) are the sets of vertices in \(S(K_n,t)\) that are valued with 1 and 2 in f,  respectively. We have

$$\begin{aligned} n^t = |V(S(K_n,t))|= & {} \left| V_1\cup \bigcup _\mathbf{v \in V_2} N_{n,t}[\mathbf{v} ]\right| \nonumber \\\le & {} |V_1|+\sum _\mathbf{v \in V_2}\left| N_{n,t}[\mathbf{v} ]\right| \nonumber \\\le & {} |V_1|+(n+1)|V_2|, \end{aligned}$$
(10)

where (10) is from the fact that the maximal vertex degree in \(S(K_n,t)\) is n. Then, it comes to a linear program: finding \(\min \{|V_1|+2|V_2|\}\) provided that the nonnegative integers \(|V_1|\) and \(|V_2|\) satisfy \(n^t\le |V_1|+(n+1)|V_2|.\) Define that

$$\begin{aligned} g(|V_1|)=|V_1|+2\left\lceil \frac{n^t-|V_1|}{n+1}\right\rceil . \end{aligned}$$

It is straightforward that \(\min \{|V_1|+2|V_2|\}\) is attained by \(g(|V_1|)\) for some \(0\le |V_1|\le n^t.\) Furthermore, since

$$\begin{aligned} \left\lceil \frac{n^t-(|V_1|+2)}{n+1}\right\rceil +1= & {} \left\lceil \frac{n^t-(|V_1|+2)}{n+1}+1\right\rceil \\= & {} \left\lceil \frac{n^t-|V_1|+(n-1)}{n+1}\right\rceil \ge \left\lceil \frac{n^t-|V_1|}{n+1}\right\rceil , \end{aligned}$$

we have

$$\begin{aligned} g(|V_1|+2)\ge g(|V_1|) \end{aligned}$$

and hence the minimum of \(g(|V_1|)\) can be obtained as \(|V_1|\in \{0,1\}.\)

When t is odd, \(\left\lceil n^t/(n+1)\right\rceil =(n^t+1)/(n+1).\) Therefore,

$$\begin{aligned} g(0)=2\left\lceil n^t/(n+1)\right\rceil ,\quad g(1)=2\left\lceil n^t/(n+1)\right\rceil +1, \end{aligned}$$

and \(\min \{|V_1|+2|V_2|\}\) is attained by g(0). When t is even, \(\left\lceil n^t/(n+1)\right\rceil =(n^t+n)/(n+1).\) Therefore,

$$\begin{aligned} g(0)=2\left\lceil n^t/(n+1)\right\rceil ,\quad g(1)=2\left\lceil n^t/(n+1)\right\rceil -1, \end{aligned}$$

and \(\min \{|V_1|+2|V_2|\}\) is attained by g(1). We then have

$$\begin{aligned} \gamma _R(S(K_n,t))\ge & {} \min \{|V_1|+2|V_2|\} \nonumber \\= & {} \left\{ \begin{array}{ll} 1\cdot 0+2\cdot \frac{n^t+1}{n+1} = 2\left\lceil \frac{n^t}{n+1}\right\rceil &{} \quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,odd}}; \\ 1\cdot 1+2\cdot \frac{n^t-1}{n+1} = 2\left\lceil \frac{n^t}{n+1}\right\rceil -1 &{} \quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,even}}. \end{array}\right. \end{aligned}$$
(11)

where (11) is obtained if \((|V_1|,|V_2|)=(0,(n^t+1)/(n+1))\) with odd t, and \((|V_1|,|V_2|)=(1,(n^t-1)/(n+1))\) with even t.

On the other hand, although the upper bound has been shown in Theorem 1.2, we derive a Roman dominating function from the set \(D_{n,t}\) and reprove it. If t is odd, let

$$\begin{aligned} f(\mathbf{v} )= \left\{ \begin{array}{ll} 2 &{} \quad \text {if }{} \mathbf{v} \in D_{n,t}; \\ 0 &{} \quad \text {if }{} \mathbf{v} \not \in D_{n,t} \end{array} \right. \end{aligned}$$

which achieves a Roman domination since \(D_{n,t}\) is a dominating set of \(S(K_n,t).\) Also, f sums to \(\sum _\mathbf{v }f(\mathbf{v} )=2|D_{n,t}|=2\lceil n^t/(n+1)\rceil .\) If t is even, let

$$\begin{aligned} f(\mathbf{v} )= \left\{ \begin{array}{ll} 2 &{}\quad \text {if }{} \mathbf{v} \in D_{n,t}^*; \\ 1 &{}\quad \text {if }{} \mathbf{v} =1^t; \\ 0 &{} \quad \text {if }{} \mathbf{v} \not \in D_{n,t} \end{array} \right. \end{aligned}$$

which attains a Roman domination, since in the latter part of proof in Theorem 2.6, we mention that \(1^t\) is not a neighbor of any vertex in \(D_{n,t}\). In this case, we have \(\sum _\mathbf{v }f(\mathbf{v} )=2|D_{n,t}^*|+1=2\lceil n^t/(n+1)\rceil -1.\)

Since the lower bound and upper bound meet in the above argument, the result follows. \(\square \)

3.3 Double Roman domination numbers

In this subsection, we give the exact values of the double Roman domination numbers \(\gamma _{dR}(S(K_n,t))\) for arbitrary nt, which generalize the result [3, Theorem 3.2] stating that \(\gamma _{dR}(S(K_n,2))=3n-1.\)

The following result given in [4] will be useful.

Proposition 3.3

In a double Roman dominating function of minimal weight, no vertex needs to be assigned the value 1.

We begin finding double Roman domination numbers of \(S(K_n,t)\) in the following. The methods will be similar to those for Roman domination numbers.

Theorem 3.4

For every positive integers \(n\ge 2\) and t,  the double Roman domination number of the Sierpiński graph \(S(K_n,t)\) is

$$\begin{aligned} \gamma _{dR}(S(K_n,t))=\left\{ \begin{array}{ll} \displaystyle 3\left\lceil \frac{n^t}{n+1}\right\rceil &{} \quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,odd}}; \\ \displaystyle 3\left\lceil \frac{n^t}{n+1}\right\rceil -1 &{} \quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,even}}. \end{array}\right. \end{aligned}$$

Proof

By Proposition 3.3, we narrow our discussion by letting \(f:V(S(K_n,t))\rightarrow \{0,2,3\}\) be a double Roman dominating function, where \(V(S(K_n,t))\) is the set of vertices in \(S(K_n,t).\) Suppose that \(V_2\) and \(V_3\) are the sets of vertices in \(S(K_n,t)\) that are valued with 2 and 3, respectively. Since a vertex valued with 0 can be protected by 2 neighbors valued with 2 in f, we may assume that a vertex valued with 2 in f protects at most \(1+n/2\) vertices in \(S(K_n,t)\). Therefore, the equation (10) becomes

$$\begin{aligned} n^t = |V(S(K_n,t))| \le \left( 1+\frac{n}{2}\right) |V_2|+(n+1)|V_3|. \end{aligned}$$
(12)

A new linear program appears as follows: finding \(\min \{2|V_2|+3|V_3|\}\) provided that the nonnegative integers \(|V_2|\) and \(|V_3|\) satisfy (12).

We verify the case \(n=2\) individually. When \(n=2\) then \(S(K_n,t)\) is a path graph on \(2^t\) vertices, and (12) indicates \(n^t\le 2|V_2|+3|V_3|\). If the equality in (12) holds and a double Roman dominating function f with such \((|V_2|,|V_3|)\) exists, then every vertex in \(V_2\cup V_3\) has degree 2, so that the two extreme vertices \(1^{t}\) and \(2^{t}\) must be valued with 0 in f. Moreover, for each non-extreme vertex valued with 0, its two neighbors are valued with 0, 3 or 2, 2. It implies that the only neighbor \(1^{t-1}2\) of \(1^{t}\) is valued with 3, and thus, the vertex \(1^{t-2}21\) adjacent to \(1^{t-1}2\) is valued with 0. Next, the vertex \(1^{t-2}22\) adjacent to \(1^{t-2}21\) will be valued with 3 and hence the other neighbor of \(1^{t-2}22\) is valued with 0. By inductively discussing the labeling, the whole path will be periodically valued with the pattern 0,3,0 in f. However, the number of vertices on the path will be \(2^t=3|V_3|\), which is a contradiction. Therefore, the equality in (12) does not hold. We have

$$\begin{aligned} 2|V_2|+3|V_3|\ge n^t+1= \left\{ \begin{array}{ll} 3\left\lceil \frac{n^t}{n+1}\right\rceil &{}\quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,odd}}; \\ 3\left\lceil \frac{n^t}{n+1}\right\rceil -1 &{}\quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,even}} \end{array}\right. \end{aligned}$$

when \(n=2.\)

Assume that \(n\ge 3\). Define

$$\begin{aligned} g(|V_2|)=2|V_2|+3\left\lceil \frac{n^t-(1+n/2)|V_2|}{n+1}\right\rceil . \end{aligned}$$

Then it is clear that \(\min \{2|V_2|+3|V_3|\}\) is attained by \(g(|V_2|)\) for some \(0\le |V_2|\le \left\lceil n^t/(1+n/2)\right\rceil .\) Moreover, since

$$\begin{aligned}&\left\lceil \frac{n^t-(1+n/2)(|V_2|+3)}{n+1}\right\rceil +2 \\&\quad \qquad = \left\lceil \frac{n^t-(1+n/2)|V_2|-(3+3n/2)+2(n+1)}{n+1}\right\rceil \\&\quad = \left\lceil \frac{n^t-(1+n/2)|V_2|+(n/2-1)}{n+1}\right\rceil \ge \left\lceil \frac{n^t-(1+n/2)|V_2|}{n+1}\right\rceil , \end{aligned}$$

we have

$$\begin{aligned} g(|V_2|+3)\ge g(|V_2|), \end{aligned}$$

and thus, the minimum of \(g(|V_2|)\) can be obtained as \(|V_2|\in \{0,1,2\}.\)

When t is odd, \(\left\lceil n^t/(n+1)\right\rceil =(n^t+1)/(n+1).\) Therefore,

$$\begin{aligned} g(0)=3\left\lceil n^t/(n+1)\right\rceil ,\quad g(1)=3\left\lceil n^t/(n+1)\right\rceil +2,\quad g(2)=3\left\lceil n^t/(n+1)\right\rceil +1, \end{aligned}$$

and \(\min \{2|V_2|+3|V_3|\}\) is attained by g(0). When t is even, \(\left\lceil n^t/(n+1)\right\rceil =(n^t+n)/(n+1).\) Therefore,

$$\begin{aligned} g(0)=3\left\lceil n^t/(n+1)\right\rceil ,\quad g(1)=3\left\lceil n^t/(n+1)\right\rceil -1,\quad g(2)=3\left\lceil n^t/(n+1)\right\rceil -2, \end{aligned}$$

and \(\min \{2|V_2|+3|V_3|\}\) is attained by g(2). However, if \((|V_2|,|V_3|)=(2,(n^t-n-2)/(n+1))\) then the equality of \(n^t=(1+n/2)|V_2|+(n+1)|V_3|\) implies that the two vertices of value 2 must have the same n neighbors (that are all valued with 0), so a double Roman function f of such \((|V_2|,|V_3|)\) does not exist. Consequently, although \(\min \{2|V_2|+3|V_3|\}\) is attained by g(2) when t is even, g(1) can be considered as a lower bound of \(\gamma _{dR}(S(K_n,t)).\) We then have

$$\begin{aligned} \gamma _{dR}(S(K_n,t)) \ge \left\{ \begin{array}{ll} 2\cdot 0+3\cdot \frac{n^t+1}{n+1} = 3\left\lceil \frac{n^t}{n+1}\right\rceil &{} \quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,odd}}; \\ 2\cdot 1+3\cdot \frac{n^t-1}{n+1} = 3\left\lceil \frac{n^t}{n+1}\right\rceil -1 &{} \quad {\mathrm {if}}\,\,t\,\,{\mathrm {is\,even}} \end{array}\right. \end{aligned}$$
(13)

where (13) is obtained if \((|V_2|,|V_3|)=(0,(n^t+1)/(n+1))\) with odd t, and \((|V_2|,|V_3|)=(1,(n^t-1)/(n+1))\) with even t.

Table 1 Proposed domination in the Sierpiński graphs \(S(K_n,t)\)

On the other hand, we verify the upper bound by giving a double Roman dominating function. If t is odd let

$$\begin{aligned} f(\mathbf{v} )= \left\{ \begin{array}{ll} 3 &{} \quad \text {if }{} \mathbf{v} \in D_{n,t}; \\ 0 &{} \quad \text {if }{} \mathbf{v} \not \in D_{n,t} \end{array} \right. \end{aligned}$$

with \(\sum _\mathbf{v }f(\mathbf{v} )=3|D_{n,t}|=3\lceil n^t/(n+1)\rceil ,\) and if t is even let

$$\begin{aligned} f(\mathbf{v} )= \left\{ \begin{array}{ll} 3 &{}\quad \text {if }{} \mathbf{v} \in D_{n,t}^*; \\ 2 &{} \quad \text {if }{} \mathbf{v} =1^t; \\ 0 &{} \quad \text {if }{} \mathbf{v} \not \in D_{n,t} \end{array} \right. \end{aligned}$$

with \(\sum _\mathbf{v }f(\mathbf{v} )=3|D_{n,t}^*|+2=3\lceil n^t/(n+1)\rceil -1.\) Similar to the proof in Theorem 3.2, each of the above two cases reaches a double Roman domination in \(S(K_n,t).\)

Thus, the lower bound and upper bound meet. We have the proof. \(\square \)

4 Concluding remark

In this study, based on the properties of \(D_{n,t}\) defined in Definition 2.1, we obtain the precise values of domination numbers \(\gamma (S(K_n,t))\), Roman domination numbers \(\gamma _R(S(K_n,t))\) and double Roman domination numbers \(\gamma _{dR}(S(K_n,t))\) of Sierpiński graphs \(S(K_n,t).\) As applications, we improve Theorem 1.2 given in [15] by showing that the equality holds for any pair of n and t. Moreover, since \(\gamma _R(S(K_n,2))\) and \(\gamma _{dR}(S(K_n,2))\) have been obtained in [3], our works also extend their results to arbitrary t. To conclude this paper, one can refer to the following table.