1 Introduction

Vertex visibility in networks is a topic that has motivated a significant number of investigations in the last few years. These investigations have been taken into account from two different points of view. On the one hand, the research has been conducted in practical problems appearing in the area of computer science, through the study of some robot navigation models, mainly focused on the visibility required for some robots to move around a network in order to avoid collisions. For some examples of researches on this topic, we suggest for instance [1, 2, 6]. On the other hand, a theoretical point of view has been considered, where the investigation mainly concentrates the attention into finding combinatorial properties of “visible” sets in networks. The first ideas on this direction were presented in [7], where the concept of mutual-visibility number in graphs was introduced. This latter style of theoretical study was extended in [4, 5].

Let \(G = (V(G), E(G))\) be a connected and undirected graph, \(X\subseteq V(G)\), and \(x,y\in X\). If there exists a shortest xy-path (also called geodesic) whose internal vertices are all not in X, then x and y are X-visible. The set X is a mutual-visibility set of G, if every two vertices x and y of X are X-visible. The cardinality of the largest mutual-visibility set of G is the mutual-visibility number of G denoted by \(\mu (G)\).

The topic of mutual-visibility in graphs is closely related to the general position problem in graphs, which was formally, independently, and recently defined in [11, 18], although its notion is already known from previous investigations, like for instance [13], where the concept was considered only for hypercubes. A general position set in a graph G can be understood as a mutual-visibility set in G in which any two vertices of such set are “visible” not only through at least one shortest path but through every possible shortest path between the two vertices. The general position problem has been intensively studied in the last 5 years, and by now there are many ongoing investigations on this topic and its variations. For some significant cases, we suggest some of the most recent ones [8, 10, 12, 14, 15, 17].

In order to give more insight into the mutual-visibility number of strong product graphs, Cicerone et al. [5] introduced the notion of total mutual-visibility as a natural extension of the mutual-visibility, which can also be seen in a computer setting navigation model, where not only the robots are required to be “visible” with respect to themselves, but also the remaining nodes of the networks have a similar property among them, and with respect to the navigating robots. This setting is clearly more restrictive, but it surprisingly turns to become very useful while considering some networks having some Cartesian properties in the vertex set, namely that ones of product-like structures, when a product is understood in the sense of the four classical graph products as defined in the book [9].

As it happens, the concept of total mutual-visibility might be also of independent interest, as already pointed out in [5], since the visibility is extended to all vertices in the graph, not only for the vertices from mutual-visibility set. This is clearly a property of independent interest, and its study is worthy of being continued. This was indeed already done in [16], and it is our goal to continue finding more contributions on this regard. Moreover, the NP-completeness of the decision problem concerning finding \(\mu _t(G)\) was recently proved in [3]. Formally, \(X\subseteq V(G)\) is a total mutual-visibility set of G, if every two vertices x and y of G are X-visible. A largest total mutual-visibility set of G is a \(\mu _t(G)\)-set; its cardinality is the total mutual-visibility number of G denoted by \(\mu _t(G)\).

We now give some basic terminology and basic definitions that shall be used through our whole exposition. Clearly, we continue considering here only connected and undirected graphs. Given a graph G and two vertices \(x,y\in V(G)\), the distance \(d_G(x,y)\) between x and y in G is the length of a shortest xy-path. The diameter \(\textrm{diam}(G)\) of G is the largest distance between pairs of vertices of G. The subgraph of G induced by \(S\subseteq V(G)\) will be denoted by G[S], and the complement of a graph G is \({\overline{G}}\). A subgraph H of G is convex if for each two vertices \(x,y\in V(H)\), all shortest xy-paths in G lie completely in H. As usual, the domination number of G is denoted by \(\gamma (G)\), which is the cardinality of a smallest set such that any vertex not in the set is adjacent to at least one vertex of such set. By \(n_1(G)\), we denote the number of vertices of degree one in G, also known as the number of leaves of G, when G is a tree. We next continue with some extra information (basic results) that we would need for our purposes.

We first recall that there exist graphs where \(X=\varnothing \) is the only \(\mu _t(G)\)-set, like the case of cycles of order at least 5, and graphs where \(X=V(G)\) is the only \(\mu _t(G)\)-set, like the case of complete graphs. Thus, for any graph G, \(0 \le \mu _t(G)\le {\textrm{n}(G)}\), where \({\textrm{n}(G)}\) denotes the order of G. Also, the following observation from [16] is of interest.

Proposition 1.1

[16] If \(X\subseteq V(G)\) is a total mutual-visibility set of a graph G and \(Y\subseteq X\), then Y is also a total mutual-visibility set of G.

To close this section, we present the plan of our article. In Sect. 2, several bounds for \(\mu _t(G)\) in terms of the diameter, order, and/or connected domination number of G are given. We also show characterizations of the graphs achieving the limit values of some of these bounds and present some consequences that give the exact value of \(\mu _t(G)\) when G is a join or a corona graph. Section 3 is dedicated to consider those vertices of a graph G that either belong to every total mutual-visibility set of G or do not belong to any of such sets. In Sect. 4, we consider the lexicographic product of graphs G and H and compute the exact value of its total mutual-visibility number in terms of the orders of G and H and the total mutual-visibility number of G. In Sect. 5, we give some bounds and closed formulae for the total mutual-visibility number of Cartesian product graphs. We determine such value for some specific families of graphs that are generalizing some other results recently presented in [16]. Finally, in the concluding section some open problems and directions for further investigation are indicated.

2 General Bounds and Consequences

Our first contribution describes a relationship between the total mutual-visibility number and the diameter of a graph.

Proposition 2.1

For any connected graph G,

$$\begin{aligned} 0\le \mu _t(G)\le \textrm{n}(G)-\textrm{diam}(G)+1. \end{aligned}$$

Proof

By definition of total mutual-visibility number, \(\mu _t(G)\ge 0\). Now, let X be a \(\mu _t(G)\)-set. If \(u,v\in V(G)\) are two diametral vertices, then there exists a diametral path \(u=x_0,\ldots , x_k=v\) such that \(\{x_{1},\ldots , x_{k-1}\}\cap X=\varnothing \). Therefore, \(\mu _t(G)=|X|\le \textrm{n}(G)-(k-1)=\textrm{n}(G)-\textrm{diam}(G)+1.\) \(\square \)

All graphs with \(\mu _t(G)=0\) were characterized in [16]. Next we consider the case of graphs with \(\mu _t(G)= \textrm{n}(G)-\textrm{diam}(G)+1.\)

Proposition 2.2

Given a connected graph G of order \(\textrm{n}(G)\ge 2\), the following statements are equivalent.

  1. (i)

    \(\mu _t(G)= \textrm{n}(G)-\textrm{diam}(G)+1.\)

  2. (ii)

    There exists a diametral path \(x_0,\ldots , x_k\) such that for every pair uv of vertices of G there exists a shortest path \(u=y_0,\ldots , y_{k'}=v\) such that \(\{y_1,\ldots , y_{k'-1}\}\subseteq \{x_1,\ldots ,x_{k-1}\}\).

Proof

First, we assume that (i) holds. Let X be a \(\mu _t(G)\)-set. Let \(x,y\in V(G)\) be two diametral vertices. Since x and y are X-visible, there exists a path P between x and y whose set Y of internal vertices satisfies \(X\cap Y=\varnothing \). Hence, \(Y\subseteq V(G){\setminus } X\), and so from (i) we deduce that

$$\begin{aligned} \textrm{diam}(G)-1=|Y|\le |V(G){\setminus } X|=\textrm{diam}(G)-1. \end{aligned}$$

Therefore, \(X=V(G){\setminus } Y\), which implies that P satisfies (ii).

Conversely, if W is the set of internal vertices of a diametral path P satisfying (ii), then \(V(G){\setminus } W\) is a total mutual-visibility set, which implies that \(\textrm{n}(G)-\textrm{diam}(G)-1=|V(G){\setminus } W|\le \mu _t(G)\). In such a case, by Proposition 2.1 we deduce that (i) holds. \(\square \)

From Proposition 2.2, we deduce the following result which characterizes the graphs with large values of total mutual-visibility number.

Corollary 2.3

Given a graph G, the following statements hold.

  1. (i)

    \(\mu _t(G) = \textrm{n}(G)\) if and only if G is a complete graph.

  2. (ii)

    \(\mu _t(G) = \textrm{n}(G)-1\) if and only if G is a non-complete graph with \(\gamma (G)=1\).

Now, we establish an interesting connection between the total mutual-visibility number and the connected domination number, denoted by \(\gamma _c(G)\), which represents the minimum cardinality among all dominating sets of G whose induced subgraphs are connected. A smallest connected dominating set of G is a \(\gamma _c(G)\)-set.

Theorem 2.4

For any connected non-complete graph G,

$$\begin{aligned} \mu _t(G)\le \textrm{n}(G)-\gamma _c(G). \end{aligned}$$

Proof

Let X be a \(\mu _t(G)\)-set and \(X'=V(G){\setminus } X\). Since G is a non-complete graph, by Proposition 2.1 and Corollary 2.3, we deduce that \(X'\ne \varnothing \). If there exists \(x\in X\) such that \(N(x)\cap X'=\varnothing \), then for every \(x'\in X'\) we have that x and \(x'\) are not X-visible, which is a contradiction. Hence, \(X'\) is a dominating set. Now, if \(x'\) and \(x''\) are vertices of two different components of the subgraph of G induced by \(X'\), then \(x'\) and \(x''\) are not X-visible, which is a contradiction again. Thus, \(X'\) is a connected dominating set of G. Therefore, \(\textrm{n}(G)=|X|+|X'|\ge \mu _t(G)+\gamma _c(G)\), as required. \(\square \)

It is easy to construct examples of graphs achieving the bound above. In particular, as we will show in Theorem 2.9, the bound is achieved for connected corona graphs.

Corollary 2.5

Let G be a non-complete graph. If \(\mu _t(G)= \textrm{n}(G)-\textrm{diam}(G)+1\), then \(\gamma _c(G)=\textrm{diam}(G)-1\).

Proof

Since any path between two diametral vertices has \(\textrm{diam}(G) - 1\) internal vertices, it is clear that \(\gamma _c(G)\ge \textrm{diam}(G) - 1\). Hence, if \(\mu _t(G)= \textrm{n}(G)-\textrm{diam}(G)+1\), then by Theorem 2.4 we have

$$\begin{aligned} \textrm{n}(G)-\textrm{diam}(G)+1=\mu _t(G)\le \textrm{n}(G)-\gamma _c(G) \le \textrm{n}(G)-\textrm{diam}(G)+1, \end{aligned}$$

which implies that \(\gamma _c(G)=\textrm{diam}(G) - 1\). \(\square \)

The converse of Corollary 2.5 does not hold. For instance, if G is the graph shown in Fig. 1, then \(\gamma _c(G)=5=\textrm{diam}(G)-1\), while \(\mu _t(G)=2<7=\textrm{n}(G)-\textrm{diam}(G)+1\).

Fig. 1
figure 1

\(\{u_1,\ldots , u_5\}\) is a \(\gamma _c(G)\)-set

Notice that since \(\gamma _c(G)\ge \textrm{diam}(G) - 1\), the upper bound of Proposition 2.4 is always better than the one of Proposition 2.1. However, finding the connected domination number of a graph cannot be usually efficiently made, while the diameter can be easily known, thus justifying the inclusion of Proposition 2.1 in our exposition.

Proposition 2.6

Given a connected non-complete graph G, the following statements are equivalent.

  1. (i)

    \(\mu _t(G)= \textrm{n}(G)-\gamma _c(G).\)

  2. (ii)

    There exists a \(\gamma _c(G)\)-set S such that for every pair uv of vertices of G there exists a shortest path \(u=y_0,\ldots , y_{k'}=v\) such that \(\{y_1,\ldots , y_{k'-1}\}\subseteq S\).

Proof

First, we assume that (i) holds. Let X be a \(\mu _t(G)\)-set and \(X'=V(G){\setminus } X\). As we have shown in the proof of Theorem 2.4, \(X'\) is a connected dominating set, and so from (i) we deduce that

$$\begin{aligned} \gamma _c(G)\le |X'|= |V(G){\setminus } X|=\textrm{n}(G)-\mu _t(G) =\gamma _c(G). \end{aligned}$$

Therefore, \(X'\) is a \(\gamma _c(G)\)-set which satisfies (ii).

Conversely, if S is a \(\gamma _c(G)\)-set satisfying (ii), then \(V(G){\setminus } S\) is a total mutual-visible set, which implies that \(\textrm{n}(G)-\gamma _c(G)=|V(G){\setminus } S|\le \mu _t(G).\) In such a case, by Theorem 2.4 we deduce that (i) holds. \(\square \)

Notice that from Proposition 2.6 we deduce the following result which was recently obtained in [16].

Corollary 2.7

[16] For any tree T, \(\mu _t(T)=n_1(T)\).

Next we will apply Proposition 2.6 to the cases of join and corona graphs. The join graph \(G+H\) is defined as the graph obtained from the disjoint union of a copy of G and a copy of H by adding an edge between each vertex of G and each vertex of H.

Corollary 2.8

Let G and H be two non-simultaneously complete graphs.

  1. (i)

    If \(\gamma (G)=1\), then \(\mu _t(G+H)= \textrm{n}(G)+\textrm{n}(H)-1.\)

  2. (ii)

    If \(\gamma (G)\ne 1\) and \(\gamma (H)\ne 1\), then \(\mu _t(G + H)= \textrm{n}(G)+\textrm{n}(H)-2.\)

Proof

Since every universal vertex of G is a universal vertex of \(G+H\), from Proposition 2.6 or from Corollary 2.3, we deduce (i).

Now, if \(\gamma (G)\ne 1\) and \(\gamma (H)\ne 1\), then \(\gamma _c(G+H)=2\) and we only need to observe that for any vertex \(g\in V(G)\) and any vertex \(h\in V(H)\), the set \(\{g,h\}\) is a connected dominating set of \(G+H\) which satisfies Proposition 2.6 (ii). \(\square \)

Let G and H be graphs where \(V(G) = \{u_1, \ldots ,u_{\textrm{n}(G)}\}\). The corona product \(G\odot H\) is defined as the graph obtained from the disjoint union of a copy of G and \(\textrm{n}(G)\) copies of H, denoted by \(H_i\), \(i\in \{1,2,\ldots ,\textrm{n}(G)\}\). The product \(G\odot H\) is then constructed by making \(u_i\) adjacent to every vertex in \(H_i\) for each \(i\in \{1,2,\ldots ,\textrm{n}(G)\}\). Notice that the corona product \(K_1\odot H\) is isomorphic to the join graph \(K_1+H\).

Corollary 2.9

For any connected graph G and any graph H,

$$\begin{aligned} \mu _t(G\odot H)= \textrm{n}(G)\textrm{n}(H). \end{aligned}$$

Proof

We only need to observe that V(G) is a \(\gamma _c(G\odot H)\)-set which satisfies Proposition 2.6 (ii). \(\square \)

3 Compulsory Vertices and Forbidden Vertices in Any \(\mu _t(G)\)-Set

In order to give some additional results on the total mutual-visibility number of a graph, we need to introduce the following notation. Given a graph G, we define the set \({\mathcal {F}}(G)\subseteq V(G)\) as the set of forbidden vertices in any \(\mu _t(G)\)-set, i.e., the set of vertices not belonging to any \(\mu _t(G)\)-set.

We also define \({\mathcal {C}}(G) \) as the set of compulsory vertices in any \(\mu _t(G)\)-set, i.e., the set of vertices belonging to every \(\mu _t(G)\)-set.

If X is a \(\mu _t(G)\)-set, then by definition of \({\mathcal {C}}(G)\) and \({\mathcal {F}}(G)\) we have that \({\mathcal {C}}(G)\subseteq X\subseteq V(G){\setminus } {\mathcal {F}}(G)\). Therefore, the following proposition follows.

Proposition 3.1

If G is a connected graph, then \(|{\mathcal {C}}(G)| \le \mu _t(G)\le \textrm{n}(G)-|{\mathcal {F}}(G)|\).

Although the following statement is also immediate, it is very useful.

Proposition 3.2

Given a graph G, the following statements are equivalent.

  1. (i)

    \(\mu _t(G)=|{\mathcal {C}}(G)|\).

  2. (ii)

    \(\mu _t(G)= \textrm{n}(G)-|{\mathcal {F}}(G)|\).

  3. (iii)

    \(|{\mathcal {C}}(G)|+|{\mathcal {F}}(G)|=\textrm{n}(G)\).

Proof

If (i) \(\Leftrightarrow \) (ii) holds, then the other equivalences are deduced by Proposition 3.1. Therefore, we will limit ourselves to prove the equivalence (i) \(\Leftrightarrow \) (ii).

Let X be a \(\mu _t(G)\)-set. Since \({\mathcal {C}}(G)\subseteq X\), if \(\mu _t(G)=|{\mathcal {C}}(G)|\), then \({\mathcal {C}}(G)\) is the only \(\mu _t(G)\)-set. In such a case, \(V(G){\setminus } {\mathcal {C}}(G)={\mathcal {F}}(G)\), and so \(|{\mathcal {F}}(G)|= \textrm{n}(G)-\mu _t(G)\), as required.

Conversely, if \(\mu _t(G)= \textrm{n}(G)-|{\mathcal {F}}(G)|\), then \(V(G){\setminus } {\mathcal {F}}(G)\) is the only \(\mu _t(G)\)-set, and this implies that \(V(G){\setminus } {\mathcal {F}}(G)={\mathcal {C}}(G)\). Therefore, \(\mu _t(G)=\textrm{n}(G)-|{\mathcal {F}}(G)|=|{\mathcal {C}}(G)|\). \(\square \)

Figure 2 shows an example of graph which illustrates Proposition 3.2.

Fig. 2
figure 2

\({\mathcal {C}}(G)=\{a,d,g,i\}\) is the only \(\mu _t(G)\)-set

A vertex of a graph is a simplicial if the subgraph induced by its neighbors is a complete graph. Let \({\mathcal {S}}(G)\) be the set of simplicial vertices in G. Observe that \({\mathcal {S}}(G)\subseteq {\mathcal {C}}(G)\), since any simplicial vertex x is not in any shortest path between any two vertices of G different from x. Let \({\mathcal {P}}(G)\) be the subset of V(G) such that \(v\in {\mathcal {P}}(G)\) if and only if there exist two vertices \(u,w\in V(G)\) such that \(N_G[u]\cap N_G[w]=\{v\}\), i.e., \(v\in {\mathcal {P}}(G)\) if and only if v is the middle vertex of a convex \(P_3\) in G. Obviously, \({\mathcal {P}}(G)\subseteq {\mathcal {F}}(G)\).

Notice that the problem of deciding if a vertex belongs to \({\mathcal {S}}(G)\), or to \({\mathcal {P}}(G)\), is algorithmically simple. Therefore, the following result is an important tool to estimate the value of \(\mu _t(G)\).

Proposition 3.3

Given a connected graph G, the following statements hold.

  1. (i)

    \(\mu _t(G) \ge |{\mathcal {S}}(G)|\).

  2. (ii)

    If \(\mu _t(G) = |{\mathcal {S}}(G)|\), then \(\mu _t(G) = \textrm{n}(G)-|{\mathcal {P}}(G)|\).

  3. (ii)

    [16] \(\mu _t(G) \le \textrm{n}(G)-|{\mathcal {P}}(G)| \).

  4. (iv)

    If \(\mu _t(G) = \textrm{n}(G)-|{\mathcal {P}}(G)| \), then \(\mu _t(G) = |{\mathcal {C}}(G)|\).

Proof

From Propositions 3.1 and 3.2, we deduce (i), (iii), and (iv). We proceed to prove (ii). Since \({\mathcal {S}}(G)\subseteq {\mathcal {C}}(G)\), if \(\mu _t(G)=|{\mathcal {S}}(G)|\), then the set \({\mathcal {S}}(G)\) of simplicial vertices is the only \(\mu _t(G)\)-set. If there exists a vertex \(x\in V(G){\setminus } ({\mathcal {S}}(G)\cup {\mathcal {P}}(G))\), then for every pair of non-adjacent vertices \(y,z\in N_G(x)\), there exists \(w\in V(G){\setminus } {\mathcal {S}}(G)\) such that \(y,z\in N_G(w)\), and so \({\mathcal {S}}(G)\cup \{x\}\) is a total mutual-visibility set, which is a contradiction. Therefore, \(V(G)={\mathcal {S}}(G)\cup {\mathcal {P}}(G)\), as required. \(\square \)

The graph G shown in Fig. 1 is also an example, which illustrates Proposition 3.3 (ii). The set \({\mathcal {S}}(G)\) is formed by the bold vertices, and \({\mathcal {P}}(G)\) by the white ones. Moreover, as previously mentioned, \(\mu _t(G)=2\).

As we can expect, the converse of Proposition 3.3 (ii) does not hold. For instance, if G is the graph shown in Fig. 2, then \({\mathcal {S}}(G)=\{a,g\}\subseteq \{a,d,g,i\}={\mathcal {C}}(G)\) and \({\mathcal {P}}(G)=V(G){\setminus } {\mathcal {C}}(G)\). Therefore, \(\mu _t(G) = \textrm{n}(G)-|{\mathcal {P}}(G)|=|{\mathcal {C}}(G)|=4>2=|{\mathcal {S}}(G)|.\)

Notice also that the converse of Proposition 3.3 (iv) does not hold. For instance, if G is the graph shown in Fig. 3, then \({\mathcal {P}}(G)=\{b,c,e,f,h,j\}\subseteq \{b,c,e,f,h,j,k\}={\mathcal {F}}(G)\). In this case, \(\mu _t(G) = |{\mathcal {C}}(G)|=\textrm{n}(G)-|{\mathcal {F}}(G)|=6<7=\textrm{n}(G)-|{\mathcal {P}}(G)|.\)

Fig. 3
figure 3

\({\mathcal {C}}(G)=\{a,d,g,i,l,m\}\) is the only \(\mu _t(G)\)-set

Since the vertex set of any non-complete block graph G can be partitioned as \(V(G)= {\mathcal {P}}(G)\cup {\mathcal {S}}(G)\), we deduce the following result, which is already known. In [5], it was established that if G is a block graph, then \(\mu (G) = \mu _t(G)\), while in [7] \(\mu (G)\) was shown.

Corollary 3.4

If G is a block graph, then \(\mu _t(G) = |{\mathcal {S}}(G)|=\textrm{n}(G)-|{\mathcal {P}}(G)|\).

4 The Case of Lexicographic Product Graphs

The lexicographic product \(G\circ H\) of two graphs G and H is a graph with vertex set \(V(G\circ H)=V(G)\times V(H)\). Two vertices (xy) and \((x',y')\) are adjacent if \(xx'\in E(G)\) or (\(x=x'\) and \(yy'\in E(H\))). The lexicographic product is a kind of generalization of join because \(K_2\circ G\cong G + G\) for any graph G. If \(S\subseteq V(G\circ H)\), then the projection \(S_G\) of S on G is the set \(\{g\in V(G): (g,h)\in S \text { for some } h\in V(H)\}\). The projection \(S_H\) of S on H is defined analogously.

Since the concept of total mutual-visibility is defined for connected graphs, we should remember that a lexicographic product \(G\circ H\) is connected if and only if G is connected. Moreover, the relation between distances in a lexicographic product graph and in its factors can be presented as follows.

Remark 4.1

[9] If G is a connected non-trivial graph, then the distance between two vertices (gh) and \((g',h')\) of \(G\circ H\) is given by:

$$\begin{aligned} d_{G\circ H}((g,h),(g',h'))=\left\{ \begin{array}{ll} d_G(g,g') &{}\quad \text{ if }\quad g\ne g', \\ \min \{d_H(h,h'),2\} &{}\quad \text{ if }\quad g=g'. \end{array} \right. \end{aligned}$$

Figure 4 illustrates two examples of lexicographic products and at the same time emphasizes the fact that the lexicographic product is not commutative. For more on the product graphs, see [9].

Fig. 4
figure 4

Lexicographic products \(K_{1,3}\circ P_3\) and \(P_3\circ K_{1,3}\)

Lemma 4.2

Let G be a graph with \(\gamma (G)\ge 2\) and let H be a graph. If X is a \(\mu _t(G\circ H)\)-set, then \(|\{u\}\times V(H)\cap X|\ge \textrm{n}(H)-1\) for every vertex \(u\in V(G)\).

Proof

Let \(u\in V(G)\). By the maximality of the cardinality of X, if there exist two different vertices \(v, v'\in V(H)\) such that \((u,v),(u,v')\notin X\), then \(\{u'\}\times V(H)\subseteq X\) for every \(u'\in N_G(u)\). Now, since \(\gamma (G)\ge 2\), there exists \(w\in V(G){\setminus } N_G[u]\), and so two vertices (uv) and (wv) are not X-visible, which is a contradiction. Therefore, the result follows. \(\square \)

Lemma 4.3

Let G be a graph with \(\gamma (G)\ge 2\). For any \(\mu _t(G)\)-set X and any vertex \(v\in V(G)\), \(N_G(v)\cap (V(G){\setminus } X)\ne \varnothing \).

Proof

Suppose that there exits a \(\mu _t(G)\)-set X, and a vertex \(v\in V(G)\), such that \(N_G(v)\subseteq X\). Since \(\gamma (G)\ge 2\), there exists \(u\in V(G){\setminus } N_G[v]\). Hence, u and v are not X-visible, which is a contradiction. \(\square \)

Theorem 4.4

Let G be a connected graph with \(\gamma (G)\ge 2\). For any graph H,

$$\begin{aligned} \mu _t(G\circ H) = \textrm{n}(G)(\textrm{n}(H)-1) + \mu _t(G). \end{aligned}$$

Proof

Let S be a \(\mu _t(G)\)-set and let \(v\in V(H)\). We proceed to show that \(X = S\times V(H) \cup (V(G){\setminus } S)\times (V(H){\setminus } \{v\})\) is a total mutual-visibility set. We differentiate two cases for \((u,v),(u',v')\in V(G\circ H)\).

Case 1: \(u=u'\). By Lemma 4.3, there exists a vertex \(w\in N_G(u)\cap (V(G){\setminus } S)\). Thus, the vertices (uv) and \((u',v')\) are X-visible.

Case 2: \(u\ne u'\). Let \(u=u_0,u_1,\ldots , u_k=u'\) be a shortest path in G such that \(\{u_1,\ldots ,u_{k-1}\}\cap S =\varnothing \). Since \((u,v)=(u_0,v),(u_1,v),\ldots ,(u_k,v)=(u',v')\) is a shortest path in \(G\circ H\) and \(\{u_1,\ldots , u_{k-1}\}\times \{v\}\cap X = \varnothing \), the vertices (uv) and \((u',v')\) are X-visible.

Therefore, X is a total mutual-visibility set, and so

$$\begin{aligned} \mu _t(G\circ H)\ge |X| = \textrm{n}(G)(\textrm{n}(H)-1) + \mu _t(G). \end{aligned}$$

Let W be a \(\mu _t(G\circ H)\)-set and \(W'=V(G\circ H){\setminus } W\). Let \(W'_G\) be the projection of \(W'\) in G. We proceed to show that \(W_G=V(G){\setminus } W'_G\) is a total mutual-visibility set of G. For every pair of different vertices \(x,x'\in V(G)\) and \(y\in V(H)\), there exists a shortest path \((x,y)=(x_0,y_0),\ldots , (x_k,y_k)=(x',y)\) such that \((x_1,y_1),\ldots , (x_{k-1},y_{k-1})\notin W\). Thus, \(x=x_0,\ldots , x_k=x'\) is a shortest path in G and \(x_1,\ldots , x_{k-1}\notin W_G\). Hence, the pair of vertices x and \(x'\) are \(W_G\)-visible and so \(|W_G|\le \mu _t(G)\). Therefore, by Lemma 4.2 we have that

$$\begin{aligned} \mu _t(G\circ H)&=|W| \\&=|W_G|\cdot \textrm{n}(H)+|W'_G|(\textrm{n}(H)-1) \\&=\textrm{n}(G)(\textrm{n}(H)-1)+|W_G| \\&\le \textrm{n}(G)(\textrm{n}(H)-1) + \mu _t(G), \end{aligned}$$

as required. \(\square \)

Theorem 4.5

Let G be a graph with \(\gamma (G)=1\).

  1. (i)

    If H is a non-complete graph with \(\gamma (H)=1\), then

    $$\begin{aligned} \mu _t(G\circ H)= \textrm{n}(G)\textrm{n}(H)-1. \end{aligned}$$
  2. (ii)

    If H is a graph with \(\gamma (H)\ge 2\), then

    $$\begin{aligned} \mu _t(G\circ H)= \textrm{n}(G)\textrm{n}(H)-2. \end{aligned}$$

Proof

Let u be a universal vertex of G. If v is a universal vertex of H, then (uv) is a universal vertex of \(G\circ H\), and so by Corollary 2.3 we conclude that (i) follows.

In order to prove (ii), we take an arbitrary vertex \(u'\in V(G){\setminus } \{u\}\) and an arbitrary vertex \(v\in V(H)\), and since u is a universal vertex of G, it is readily seen that \( X=V(G\circ H){\setminus } \{(u,v),(u',v)\}\) is a total mutual-visibility set of \(G\circ H\). Hence, \(\mu _t(G\circ H)\ge |X| = \textrm{n}(G)\textrm{n}(H)-2\). Now, if \(\gamma (H)\ge 2\), then \(\gamma (G\circ H)\ge 2\), and as a result, Corollary 2.3 leads to \(\mu _t(G\circ H) \le \textrm{n}(G)\textrm{n}(H)-2\), which completes the proof of (ii). \(\square \)

5 The Case of Cartesian Product Graphs

Let G and H be two graphs. The Cartesian product of G and H is the graph \(G\Box H\) with \(V(G\Box H)=V(G)\times V(H)\), where two vertices (xy) and \((x',y')\) are adjacent if and only if either \(x=x'\) and \(yy'\in E(H)\), or \(xx'\in E(G)\) and \(y=y'\). A Cartesian product graph is connected if and only if both of its factors are connected. The distance between (xy) and \((x',y')\) in \(G\Box H\) is given by:

$$\begin{aligned} d_{G\Box H}((x,y),(x',y'))=d_G(x,x')+d_H(y,y'). \end{aligned}$$

Figure 5 shows two examples of Cartesian products. For more information on structure and properties of the Cartesian product of graphs, we refer the reader to [9].

Fig. 5
figure 5

Cartesian products \(C_5\Box K_2\) and \(K_{1,3}\Box P_3\)

We recall that the general position and the mutual-visibility problems were investigated recently, for instance, in [8, 12, 17] and [4], respectively. Moreover, Tian and Klavžar [16] most recently studied the total mutual-visibility number of Cartesian product graphs. In the referred work, the authors gave general bounds on the total mutual-visibility number of Cartesian product graphs, and they also obtain closed formulas on this novel parameter for specific families of Cartesian product graphs. To continue our exposition, we mention these bounds. For this sake, we need to introduce the following concept defined in [16]. An independent total mutual-visibility set of a graph G is a set of vertices in G that is both an independent set and a total mutual-visibility set of G. The cardinality of a largest independent total mutual-visibility set is the independent total mutual-visibility number of G, denoted by \(\mu _{it}(G)\).

Theorem 5.1

[16] If G and H are graphs with \({\textrm{n}(G)}\ge 2\), \({\textrm{n}(H)}\ge 2\), \(\mu _{it}(G)\ge 1\), and \(\mu _{it}(H)\ge 1\), then

$$\begin{aligned} \max \{\mu _{it}(H) \mu _t(G), \mu _{it}(G) \mu _t(H)\}\le \mu _t(G\Box H)\le \min \{{\textrm{n}(G)} \mu _t(H), {\textrm{n}(H)} \mu _t(G)\}. \end{aligned}$$

In order to present a result which improves the upper bound mentioned above, we need to state the following lemma.

Lemma 5.2

For any connected graph G of order at least two,

$$\begin{aligned} {\mathcal {P}}(G)\times V(H)\subseteq {\mathcal {P}}(G\Box H). \end{aligned}$$

Proof

If \(x\in {\mathcal {P}}(G)\), then there exist two vertices \(g,g'\in V(G){\setminus } \{x\}\) such that \(N_G[g]\cap N_G[g']=\{x\}\). Hence, for any vertex \(y\in V(H)\),

$$\begin{aligned} \{(x,y)\}&=N_G[g]\cap N_G[g']\times \{y\} \\ {}&=(N_G[g]\times \{y\}\cup \{g\}\times N_H[y])\cap (N_G[g']\times \{y\}\cup \{g'\}\times N_H[y])\\&=N_{G\Box H}[(g,y)]\cap N_{G\Box H}[(g',y)]. \end{aligned}$$

Hence, \((x,y)\in {\mathcal {P}}(G\Box H)\), which implies that \({\mathcal {P}}(G)\times V(H)\subseteq {\mathcal {P}}(G\Box H)\). \(\square \)

Theorem 5.3

For any connected graphs G and H,

$$\begin{aligned} \mu _t(G\Box H)\le \min \{(\textrm{n}(G)-|{\mathcal {P}}(G)|)\mu _t(H),(\textrm{n}(H)-|{\mathcal {P}}(H)|)\mu _t(G)\}. \end{aligned}$$

Proof

Let X be a \(\mu _t(G\Box H)\)-set. By Lemma 5.2, we deduce that, \(({\mathcal {P}}(G)\times V(H))\cap X = \varnothing \). Hence,

$$\begin{aligned} \mu _t(G\Box H)&= |X| = \sum _{u\in {\mathcal {P}}(G)} |(\{u\}\times V(H))\cap X| + \sum _{u\notin {\mathcal {P}}(G)} |(\{u\}\times V(H))\cap X| \\&\le 0 + (\textrm{n}(G)-|{\mathcal {P}}(G)|)\mu _t(H). \end{aligned}$$

Analogously we can prove that \(\mu _t(G\Box H) \le (\textrm{n}(H)-|{\mathcal {P}}(H)|)\mu _t(G)\). Therefore, the result follows. \(\square \)

By Theorem 5.3 and Proposition 3.3 (ii), we deduce the following bound.

Theorem 5.4

Let G and H be two connected graphs. If \(\mu _t(G) = |{\mathcal {S}}(G)|\) or \(\mu _t(H) = |{\mathcal {S}}(H)|\), then \(\mu _t(G\Box H)\le \mu _t(G)\mu _t(H).\)

As we will show below, the bound above is tight.

Theorem 5.5

[16] If T is tree with \({\textrm{n}(T)}\ge 3\) and H is a graph with \({\textrm{n}(H)}\ge 2\), then \(\mu _t(T\Box H)= \mu _t(T)\mu _t(H)\).

We next show a result which includes Theorem 5.5 as a particular case. Notice that for any tree T the only \(\mu _t(T)\)-set is the set of leaves (simplicial vertices) and clearly it is an independent set. Moreover, there exist numerous examples of graphs, where \(\mu _t(G) = |{\mathcal {S}}(G)|\) and \({\mathcal {S}}(G)\) is an independent set, and among them we have, for instance, the corona products \(G\cong G^*\odot \overline{K_n}\), for any graph \(G^*\), and any graph \(G'\) obtained as follows. We begin with a Hamiltonian graph \(H^*\) with Hamiltonian cycle \(v_0v_1\ldots v_{{\textrm{n}(H^*)}-1}v_0\) and \({\textrm{n}(H^*)}\) vertices \(u_0,u_1,\ldots u_{{\textrm{n}(H^*)}-1}\). Then, to form \(G'\) we join each vertex \(u_i\) with \(v_i\) and \(v_{i+1}\), for \(i\in \{0,1,\ldots ,{\textrm{n}(H^*)}-1\}\) (where the operations with the subscripts i are expressed modulo \({\textrm{n}(H^*)}\)). Notice that every vertex of \(H^*\) belongs to \({\mathcal {P}}(G')\).

Theorem 5.6

If \({\mathcal {S}}(G)\) is an independent set of G and \(\mu _t(G) = |{\mathcal {S}}(G)|\), then

$$\begin{aligned} \mu _t(G\Box H) = \mu _t(G)\mu _t(H). \end{aligned}$$

Proof

The result is obtained by combining the upper bound given by Theorem 5.4 and the lower bound given by Theorem 5.1. \(\square \)

Corollary 5.7

If \(T_{1},\ldots ,T_{k}\) is a family of trees of order at least three, then

$$\begin{aligned} \mu _t(T_1\Box \cdots \Box T_k)=\prod _{i=1}^k\textrm{n}_1(T_i). \end{aligned}$$

We will now establish the following lemma, which will be one of our tools.

Lemma 5.8

Let \(x,x'\) be two adjacent vertices of a graph G, and let \(y,y'\) be two adjacent vertices of a graph H. If X is a \(\mu _t(G\Box H)\)-set and \((x,y)\in X\), then \((x',y')\not \in X\).

Proof

Suppose that \((x,y),(x',y')\in X\). Since the only shortest paths between \((x',y)\) and \((x,y')\) are \((x',y),(x',y'),(x,y')\) and \((x',y),(x,y),(x,y')\), the vertices (xy) and \((x',y')\) are not X-visible, which is a contradiction. \(\square \)

The set \({\mathcal {S}}(G)\) of simplicial vertices of a graph G can be partitioned into true twin equivalence classes where two vertices \(g,g'\in {\mathcal {S}}(G)\) belong to the same class if and only if they are true twins, i.e., whenever \(N_G[g]=N_G[g']\).

Theorem 5.9

Let G be a graph and let \(\{C_1,\ldots , C_k\}\) be a partition of \({\mathcal {S}}(G)\) into true twin equivalence classes. If \(\mu _t(G)=|{\mathcal {S}}(G)|\), then for any integer \(n\ge 2\)

$$\begin{aligned} \mu _t(G\Box K_n)=\sum _{i=1}^k \max \{|C_i|,n\}. \end{aligned}$$

Proof

Let \(v\in V(K_n)\) be a fixed vertex of \(K_n\), and let \(u_i\in C_i\) be a representative vertex of the class \(C_i\). We define the following set.

$$\begin{aligned} X=\left( \bigcup _{n\ge |C_i|}\{u_i\}\times V(K_n)\right) \bigcup \left( \bigcup _{n< |C_i|}C_i \times \{v\}\right) . \end{aligned}$$

We proceed to show that X is a total mutual-visibility set of \(G\Box K_n\). To this end, we differentiate the following cases for two vertices \((g,h),(g',h')\in V(G)\times V(K_n)\).

Case 1. \(g,g'\in C_i\) for some class \(C_i\). Since the subgraph of G induced by \(C_i\) is complete, the subgraph of \(G\Box H\) induced by \(C_i\times V(K_n)\) is the Cartesian product of two complete graphs, and by the construction of X the subgraph induced by \(X_i=X\cap (C_i\times V(K_n))\) is also complete. Hence, it is readily seen that (gh) and \((g',h')\) are \(X_i\)-visible, and so they are X-visible.

Case 2. \(g\not \in C_i\) for every class \( C_i\). Let \(g=g_0,\ldots , g_l=g'\) and \(h=h_0,\ldots , h_r=h'\) be two shortest paths. If \(g=g'\), then the shortest path \((g,h)=(g,h_0),\ldots , (g,h_r)=(g',h')\) does not have vertices in X. Now, assume \(g\ne g'\). Notice that \({\mathcal {S}}(G)\) is a \(\mu _t(G)\)-set and, by Proposition 3.3 (ii), \({\mathcal {P}}(G)=V(G){\setminus } {\mathcal {S}}(G)\). Hence, the path \(g=g_0,\ldots , g_l=g'\) is \({\mathcal {S}}(G)\)-visible, and by the construction of X, the path

$$\begin{aligned} (g,h)=(g,h_0),\ldots , (g,h_{r-1}),(g,h'),(g_1,h')\ldots , (g_l,h')=(g',h') \end{aligned}$$

is X-visible.

According to the two cases above, X is a total mutual-visibility set of \(G\Box K_n\), which implies that

$$\begin{aligned} \mu _t(G\Box K_n)\ge |X|=\displaystyle \sum _{i=1}^k \max \{|C_i|,n\}. \end{aligned}$$

Now, let W be a \(\mu _t(G\Box K_n)\)-set. As mentioned above, \(V(G) = {\mathcal {S}}(G)\cup {\mathcal {P}}(G)\) and, by Lemma 5.2, we know that \({\mathcal {P}}(G)\times V(K_n)\subseteq {\mathcal {P}}(G\Box K_n) \), which implies that \(W\cap ({\mathcal {P}}(G)\times V(K_n))=\varnothing \). On the other side, since the subgraph of G induced by any class \(C_i\) is complete, by Lemma 5.8 we can conclude that for any pair of different vertices \(x,x'\in C_i\) and any pair of different vertices \(y,y'\in V(K_n)\) we have that \(|W\cap \{(x,y),(x',y')\}|\le 1\) and \(|W\cap \{(x,y'),(x',y)\}|\le 1\). Hence, \(|W\cap C_i\times V(K_n)|\le \max \{|C_i|,n\}\) for every class \(C_i\). Thus,

$$\begin{aligned} \mu _t(G\Box K_n)=\sum _{i=1}^k |W\cap ( C_i\times V(K_n))|\le \displaystyle \sum _{i=1}^k \max \{|C_i|,n\}. \end{aligned}$$

Therefore, the result follows. \(\square \)

From Theorem 5.9, we derive the following result, which was recently obtained in [16].

Corollary 5.10

[16] If \(m,n\ge 2\) are integers, then \(\mu _t(K_m\Box K_n)=\max \{m,n\}\).

Based on the corollary above, one might think that the total mutual-visibility number of the Cartesian product of at least three complete graphs \(K_{n_1}\), \(K_{n_2}\), \(\ldots \), \(K_{n_k}\) (\(k\ge 3\)) equals \(\max \{n_1,n_2,\ldots , n_k\}\). However, this seems to be far from the reality. To see this, we consider the example \(K_3\Box K_3\Box K_2\). Figure 6 shows a total mutual-visibility set (in bold) of \(K_3\Box K_3\Box K_2\) of cardinality \(4>\max \{3,3,2\}\). This situation allows to think that finding \(\mu _t(K_{n_1}\Box K_{n_2}\Box \cdots \Box K_{n_k})\) (in particular for Hamming graphs) is a challenging problem.

Fig. 6
figure 6

\(K_3\Box K_3\Box K_2\) with total mutual-visibility set of cardinality 4 in bold

If \(v\in V(K_2)\) and X is a \(\mu _t(G)\)-set, then \(X\times \{v\}\) is a total mutual-visibility set of \(G\Box K_2\). Hence, the lower bound \( \mu _t(G\Box K_2)\ge \mu _t(G)\) follows. Therefore, from Theorem 5.1 we derive the following remark.

Remark 5.11

For any connected graph G,

$$\begin{aligned} \max \{2\mu _{it}(G),\mu _t(G)\}\le \mu _t(G\Box K_2)\le 2\mu _t(G). \end{aligned}$$

Furthermore, if \(\mu _t(G)=\mu _{it}(G)\), then \(\mu _t(G\Box K_2)= 2\mu _t(G)\).

From this remark, we derive some open problems stated below.

6 Concluding Remarks

In this article, we have considered the total mutual-visibility number of graphs, by giving some tight bounds and closed formulae for this parameter. We have emphasized the investigation for the case of lexicographic and Cartesian product of graphs. Next, we propose some specific problems and possible research lines that can be taken as starting point for further researching on this topic.

  • Investigate the behavior of the total mutual-visibility number for the case of strong product graphs, direct product graphs, generalized Sierpiński graphs and Hamming graphs (with emphasis on hypercubes).

  • Investigate how \(\mu _t(G)\) is related to parameters other than \(\textrm{diam}(G)\) and \(\gamma _c(G)\).

  • Characterize the vertices of a graph belonging to \({\mathcal {C}}(G){\setminus } {\mathcal {S}}(G)\) and derive consequences of these characterizations.

  • Characterize the vertices of a graph belonging to \({\mathcal {F}}(G){\setminus } {\mathcal {P}}(G)\) and derive consequences of these characterizations.

  • For connected graphs, whose complement is connected, study the existence of Nordhaus–Gaddum-type relations.

  • Characterize the graphs G with \(\mu _t(G\Box K_2)=\mu _t(G).\)

  • Characterize the graphs G with \(\mu _t(G\Box K_2)=2\mu _{it}(G).\)

  • Characterize the graphs G with \(\mu _t(G\Box K_2)=2\mu _{t}(G).\)