1 Introduction and preliminaries

Almost self-centered graphs (ASC graphs for short) were introduced in Klavžar et al. (2011) as the graphs which contain exactly two non-central vertices. If the radius of an ASC graph G is r, then G is more precisely called an r-ASC graph. The introduction of these graphs was in particular motivated with network designs in which two (expensive) resources that need to be far away due to interference reasons must be installed. Numerous additional situations appear in which two specific locations are desired, for instance in trees (Huang et al. 2000; Wang et al. 2009), block graphs (Cheng et al. 2014), and interval graphs (Hong and Kang 2012). While in the first two of these papers 2-centers are studied in trees, the results could be used also in the general case. For a given graph G, one could first select a suitable subtree (spanning or otherwise), then determine a 2-center, and finally lift the obtained solution to G.

Graphs dual to the almost self-centered graphs were studied in Klavžar et al. (2014) and named almost-peripheral graphs (AP graphs for short). Very recently, a measure of non-self-centrality was introduced in Xu et al. (2016), where ASC graphs and AP graphs, along with a newly defined weakly AP graphs, play a significant role as extremal graphs in studies of this new measure.

Among other results it was proved in Klavžar et al. (2011) that for any connected graph G and any \(r\ge 2\) there exists an r-ASC graph which contains G as an induced subgraph. Consequently, the r-ASC index \(\theta _r(G)\) of G was introduced as the minimum number of vertices needed to add to G in order to obtain an r-ASC graph that contains G as an induced subgraph. It was proved that for any connected graph G we have \(\theta _2(G)\le 2\) and that \(\theta _r(G)\le 2r+1\) holds for any \(r\ge 3\). Moreover, the 2-ASC index was determined exactly for complete bipartite graphs, paths and cycles. The study of ASC graphs was continued in Balakrishnan et al. (2012) where ASC graphs were characterized among chordal graphs and among median graphs, and in Klavžar et al. (2017) where existing constructions of ASC graphs were revisited and new constructions of such graphs were developed.

We note in passing that graph eccentricity is frequently applied in chemical graph theory via the so-called eccentricity-based topological indices. Although these indices are pure graph theory concepts, they have a substantial use in theoretical chemistry, cf. Gupta and Singh (2002), Gupta et al. (2000, 2002) and Sharma et al. (1997). The eccentricity-based topological indices include eccentric distance sum (Gupta et al. 2002; Ilić et al. 2011), Zagreb eccentricity indices (Das et al. 2013), and connective eccentricity index (Xu et al. 2016; Yu and Feng 2013; Yu et al. 2014). See also Das and Nadjafi-Arani (2017), Su et al. (2015), Morgan et al. (2011), Tomescu (2008, 2010) and Wu et al. (2013) for some recent results on the general distance-based topological indices and a recent survey (Xu et al. 2014) on extremal results on general distance-based topological indices. Moreover, the applications of eccentricity to networks and location theory can be seen in Krnc and Škrekovski (2015) and Puerto et al. (2008), respectively.

This paper is organized as follows. In the rest of this section definitions and notations needed are given. In the following section we first prove that if G is a graph of order \(n\ge 1\) and \(r\ge 2\), then \(\theta _r(G)\le 2r\), thus improving the so-far best known bound \(\theta _r(G)\le 2r+1\). In the main result of the section we further strengthen the bound by proving that \(\theta _r(G) \le 2r-1\) holds if \(r\ge 3\) and G has at least two vertices. In the rest of the paper we then consider the 3-ASC index. The obtained results and (new) techniques involved indicate that to determine the 3-ASC index of a graph is generally a much more complex task than to determine its 2-ASC index. In Sect. 3, we determine the 3-ASC index of complete graphs and investigate the index on graphs of diameter 2. [See Palacios (2015) for some recent results on the Kirchhoff index of graphs with diameter 2.] We prove that if G is such a graph, then either \(\theta _3(G) = 3\) or \(\theta _3(G) = 4\). For several classes of graphs of diameter 2 the exact value is determined. In Sect. 4 we turn our attention to graphs with large diameter and determine the 3-ASC index of paths, cycles, and trees of order n and diameter \(n-2\). We conclude the paper with several open problems.

We only consider finite, undirected, simple graphs throughout this paper. The degree \(\mathrm{deg}_G(v)\) of a vertex v of a graph G is the cardinality of the neighborhood \(N_G(v)\) of v. The closed neighborhood \(N_G[v]\) of v is \(N_G(v)\cup \{v\}\). The maximum and minimum degree of G are denoted by \(\Delta (G)\) and \(\delta (G)\), respectively. A vertex of degree 1 is called a pendant vertex, the edge incident with a pendant vertex is called a pendant edge.

The distance \(d_G(u,v)\) between vertices u and v is the length (that is, the number of edges) of a shortest (uv)-path. The eccentricity \(\mathrm{ecc}_G(u)\) of a vertex u is the maximum distance from u to other vertices in G. The diameter \(\mathrm{diam}(G)\) of G is the maximum eccentricity among its vertices and the radius \(\mathrm{rad}(G)\) is the minimum eccentricity of its vertices. A vertex v is an eccentric vertex of a vertex u if \(d_G(u,v)=\mathrm{ecc}_G(u)\). The eccentric set \(\mathrm{Ecc}_G(u)\) of u is the set of all its eccentric vertices. A vertex u of G is called a central vertex if \(\mathrm{ecc}_G(u)=\mathrm{rad}(G)\) and is called a diametrical vertex if \(\mathrm{ecc}_G(u)=\mathrm{diam}(G)\). The center C(G) of G consists of all its central vertices, while the periphery P(G) of G contains all its diametrical vertices. A graph G is self-centered (SC graph for short) if \(C(G) = V(G)\); we refer to the survey on SC graphs (Buckley 1989) and to their recent application in Maddaloni and Zamfirescu (2016). If \(\mathrm{rad}(G) = r\), then we also say that G is an r-SC graph. Vertices u and v for which \(d_G(u,v)=\mathrm{diam}(G)\) holds will be referred to as a diametrical pair. Similarly, a triple of vertices that are pairwise at distance \(\mathrm{diam}(G)\) is called a diametrical triple. When no ambiguity occurs, the subscript G will be omitted in the notations from the last two paragraphs.

If G is a graph, then \(\overline{G}\) denotes the complement of G. The disjoint union of (vertex-disjoint) graphs \(G_1\) and \(G_2\) will be denoted with \(G_1\cup G_2\), while the join of \(G_1\) and \(G_2\) will be denoted by \(G_1\oplus G_2\). Recall that \(G_1\oplus G_2\) is obtained from \(G_1\cup G_2\) by adding an edge between any vertex of \(G_1\) and any vertex of \(G_2\). If \(X\subseteq V(G)\), then G[X] denotes the subgraph of G induced by X. Finally, throughout this paper we use \(P_n\), \(C_n\), and \(K_n\) to denote the path graph, the cycle graph, and the complete graph on n vertices, respectively. In addition, for any two non-adjacent vertices \(x,y\in V(G)\), we mean that an edge xy is added into G by joining x with y in G.

2 Improving upper bounds on the r-ASC index

It was proved in Klavžar et al. (2011, Corollary 4.1) that \(\theta _r(G)\le 2r+1\) holds for any graph G. In this section we first sharpen this result as follows. Interestingly, the below construction which gives a better upper bound is simpler than the construction from Klavžar et al. (2011).

Fig. 1
figure 1

Graph \(\widehat{G}_r\)

Theorem 2.1

If G is a graph of order \(n\ge 1\) and \(r\ge 2\), then \(\theta _r(G)\le 2r\).

Proof

Let \(\widehat{G}_r\) be the graph obtained from G as follows. Add three new vertices w, \(x_1\), \(y_1\), and add an edge between each of them and any vertex of G, so that in this way 3n edges are added. Further, add vertices \(x_2, \ldots , x_{r-1}\), \(y_2, \ldots , y_{r-1}\), and \(w'\). Finally, add edges \(x_1x_2, \ldots , x_{r-2}x_{r-1}\), \(y_1y_2, \ldots , y_{r-2}y_{r-1}\), \(x_{r-1}w'\), and \(y_{r-1}w'\). The construction is illustrated in Fig. 1.

It is straightforward to verify that \(d_{\widehat{G}_r}(w,w') = r+1\) and \(\mathrm{ecc}_{\widehat{G}_r}(w) = \mathrm{ecc}_{\widehat{G}_r}(w')= r+1\). If \(a\in V(G)\), then the sequence of vertices \(a,x_1,\ldots , x_{r-1}, w', y_{r-1}, \ldots , y_1, a\) induces an isometric cycle of length 2r. Using this fact if follows by a simple inspection that for any vertex \(x\in V(\widehat{G}_r)\), \(x\ne w,w'\), we have \(\mathrm{ecc}_{\widehat{G}_r}(x) = r\). We conclude that \(\widehat{G}_r\) is an r-ASC graph and consequently \(\theta _r(G)\le 2r\). \(\square \)

Next we characterize the graphs G with \(\theta _r(G)=2r\) for any \(r\ge 3\). Before doing it, we need the following result.

Lemma 2.2

Let G be a connected graph of order \(n\ge 2\) and \(r\ge 3\). Then \(\theta _r(G)\le 2r-1\).

Proof

The graph \(C_{2r}'\), which is obtained from \(C_{2r}\) by attaching a pendant vertex to it, is an r-ASC graph. It follows that \(\theta _r(K_2)\le 2r-1\). In the rest of the proof we may hence assume that \(n\ge 3\). It suffices to construct a graph H of order at most \(n+2r-1\) as an r-ASC embedding graph of G.

Now we construct a graph H with vertex set \(V(G)\cup \{x_1,\ldots ,x_{r-1},y_1,\ldots ,y_{r-1},w\}\). Set \(V_0=\{x_1,\ldots ,x_{r-1},y_1,\ldots ,y_{r-1},w\}\). We choose two arbitrary vertices x and y with \(xy\in E(G)\). In H, the adjacency relation of \(V_0\) is \(x_1-x_2-\cdots -x_{r-1}-y_{r-1}-\cdots -y_1-w\) and xy are joined with \(x_1\) and \(y_1\), respectively. Let \(N_2(x)\) and \(N_2(y)\) be the set of vertices in G at distance 2 from x and y, respectively. For any vertex \(v\in N(x)\), we join v with \(y_1\) in H. And we join v with \(x_1\) in H for any vertex \(v\in N(y){\setminus } N(x)\). Set \(V^*(G)=V(G){\setminus } \left( N(x)\cup N(y)\right) \) and note that \(x,y\notin V^*(G)\). Next we consider the positions of all vertices (if any) from \(V^*(G)\) in H. For any vertex \(v\in V^*(G)\), if \(v\in N_2(y)\), v is joined with \(y_1\) in H; if \(v\in N_2(x){\setminus } N_2(y)\), then \(vy_2\in E(H)\); while if \(z\in V^*(G) {\setminus } \left( N_2(x)\cup N_2(y)\right) \), then \(zy_1,zy_3\in E(H)\) for \(r\ge 4\) or \(zy_1,zx_2\in E(H)\) for \(r=3\).

Fig. 2
figure 2

Construction from the proof of Lemma 2.2

This construction is illustrated in Fig. 2, where a thick edge from a vertex to a thick set indicates that the vertex is adjacent to every vertex in the set. The dashed thick line from \(x_1\) indicates that \(x_1\) is adjacent to every vertex in \(N(y){\setminus } N(x)\), while the dashed line from \(y_2\) says that \(y_2\) is adjacent to every vertex in \(N_2(x){\setminus } N_2(y)\). The figure is drawn for the cases when \(r\ge 4\). If \(r=3\) then one only needs to replace the edge \(zy_3\) (that is, from a typical vertex z from \(V^*(G) {\setminus } \left( N_2(x)\cup N_2(y)\right) \) to \(y_3\) ) with the edge \(zx_2\). Note that if \(r=3\) then the vertices \(y_3\) and \(x_3\) do not exist, so that we can imagine that in the case \(r=3\) the vertex \(y_3\) is identified with \(x_2\) (and \(x_3\) with \(y_2\)) and then the edge \(zy_3\) is just the edge \(zx_2\).

Clearly, w is pendant in H with \(wy_1\in E(H)\). Moreover, \(d_H(w,x_{r-2})=r+1\). We have \(\mathrm{ecc}_H(v)=r\) for any vertex \(v\in V_0\cup \{x,y\}\) with \(v\notin \{x_{r-2},w\}\) from the fact that the set \(V_0\cup \{x,y\}\) induces an isometric subgraph \(C_{2r}'\) of H. Similarly we have \(\mathrm{ecc}_H(u)=r\) for any vertex \(u\in V(G){\setminus } \{x,y\}\). In particular, for the case \(r=3\), we have \(\mathrm{Ecc}_H(u)=\{x\}\) if \(u\in V^*(G)\); \(\mathrm{Ecc}_H(u)=\{x_2\}\) if \(u\in N(x)\cup N_2(y)\); \(\mathrm{Ecc}_H(u)=\{w,x_1\}\) if \(u\in N_2(x)\) and \(\mathrm{Ecc}_H(u)=\{w\}\) if \(u\in N(y)\). Therefore H is an r-ASC embedding graph of G, finishing the proof of this lemma. \(\square \)

We are now ready for the main result of this section which further sharpens Theorem 2.1 by proving that \(\theta _r(G) \le 2r-1\) holds if \(r\ge 3\) and G has at least two vertices.

Theorem 2.3

If G is a graph of order n and \(r\ge 3\), then \(\theta _r(G)=2r\) if and only if \(G\cong K_1\).

Proof

Note that \(C_{2r}'\) is an r-ASC graph. If \(G\cong K_1\), considering the fact that any r-ASC has order \(n\ge 2r+1\) (Klavžar et al. 2011), the result \(\theta _r(G)=2r\) holds immediately. Conversely, if G is a graph of order \(n\ge 2\), in view of Theorem 2.1, we only need to prove that \(\theta _r(G)\le 2r-1\). Equivalently, it suffices to construct a graph H of order at most \(n+2r-1\) as an r-ASC embedding graph of G. Denote by h the number of isolated vertices in G and set \(V_0=\{x_1,\ldots ,x_{r-1},y_1,\ldots ,y_{r-1},w\}\). Based on the value of h, we distinguish the following three cases.

Case 1 \(h\ge 2\).

In this case we may assume that \(x_0,y_0\) are two isolated vertices in G. In H, the adjacency relation of \(V_0\cup \{x_0,y_0\}\) is \(x_0-x_1-\cdots -x_{r-1}-y_0-y_{r-1}-\cdots -y_1-x_0\) with \(x_0w\) being a pendant edge, that is, \(V_0\cup \{x_0,y_0\}\) induces a graph \(C_{2r}'\) in H. Moreover, any other vertex v than \(x_0,y_0\) is joined with \(x_1\) and \(y_1\) in H. The construction is shown in Fig. 3, where the thick edges from \(x_1\) and \(y_1\) indicate that \(x_1\) and \(x_2\) are adjacent to all the vertices in \(V(G){\setminus } \{x_0,y_0\}\).

It can be easily checked that \(d_H(w,y_0)=r+1\) and any other vertex in H has eccentricity r. This ensures that H is an r-ASC embedding graph of G.

Fig. 3
figure 3

Case 1 from the proof of Theorem 2.3

Fig. 4
figure 4

Case 2 from the proof of Theorem 2.3

Case 2 \(h=1\).

In this case let v be an isolated vertex in G. Let the adjacency relation of \(V_0{\setminus }\{w\}\) and v in H be \(x_1-\cdots -x_{r-1}-v-y_{r-1}-\cdots -y_1\). Any vertex of G different from v is joined with \(x_1\) and \(y_1\) in H. Choosing an arbitrary but fixed vertex \(u\in V(G){\setminus }\{v\}\), we join w with u. This defines H. See Fig. 4 where this construction is shown; again thick edges from \(x_1\) and \(y_1\) indicate that \(x_1\) and \(y_1\) are adjacent to all the vertices in \(V(G){\setminus } \{v\}\).

Note that \(d_H(w,v)=r+1\) with w being pendant and any other vertex than wv has eccentricity r in H. Thus H is an r-ASC embedding graph of G as desired.

Case 3 \(h=0\).

In this case, if G is a connected graph, then we are done by Lemma 2.2. If not, by choosing any component of G, we run the same operation on each component of the graph G as that in the proof of Lemma 2.2 and join any vertex v from other component(s) with \(y_1,y_3\) for \(r\ge 4\) or with \(y_1,x_2\) for \(r=3\). In this way we obtain an r-ASC embedding graph of G, completing the proof of the theorem. \(\square \)

3 3-ASC index of graphs with diameter at most 2

In this section we first determine the 3-ASC index of graphs of diameter 1. Clearly, a graph of order \(n>1\) has diameter 1 if and only if \(G\cong K_n\). Next we prove the 3-ASC index of graphs with diameter 1. For consistency we include \(K_1\) in the following theorem.

Theorem 3.1

\(\theta _3(K_1)=6\) and if \(n\ge 2\), then \(\theta _3(K_n)=5\).

Proof

\(\theta _3(K_1)=6\) by Theorem 2.3. In the rest of the proof we assume that \(n\ge 2\).

We first show that \(\theta _3(K_n)\ge 5\). Assume that G is a graph obtained from \(K_n\) by adding at most three vertices. Then \(\mathrm{diam}(G)\le 4\). Moreover, the equality holds if and only if either \(G\cong G^{\prime }\) is formed by joining a pendant vertex of a path \(P_3\) to some but not all vertices of \(K_n\), or \(G\cong G^{\prime \prime }\) is obtained by joining a vertex of a path \(P_2\) to some but not all vertices of \(K_n\) and joining another new vertex to some other different vertices with degree \(n-1\) in it. In both cases there is at least one vertex x in G with \(\mathrm{ecc}_G(x)=2\). Thus G is not a 3-ASC graph which in turn implies that \(\theta _3(K_n)\ge 4\).

Suppose next that \(\theta _3(K_n)=4\) and let G be a 3-ASC graph obtained by adding vertices \(V_0=\{x,y,z,w\}\) to \(K_n\). If \(G[V_0]\ncong P_4\), then G contains \(G^{\prime }\) or \(G^{\prime \prime }\) as an induced graph, where \(G^{\prime }\) and \(G^{\prime \prime }\) are the graphs defined in the above paragraph. Otherwise, \(\mathrm{diam}(G)<4\), a clear contradiction. Since \(\mathrm{diam}(G) = 4\), there exists at least one vertex v in G with \(\mathrm{ecc}_G(v)=2\), but this contradicts the fact that G is a 3-ASC graph.

Hence \(G[V_0]\cong P_4\) must hold. Let the adjacency relation of \(V_0\) in G be \(w-z-y-x\) and assume without loss of generality that w has a neighbor in \(K_n\). Then x is a pendant vertex of G because otherwise any vertex of G would have eccentricity at most 3. If at least one of the vertices y and z, say y, is adjacent to one or more vertices of \(K_n\), then \(\mathrm{ecc}_G(y)=2\), which is a contradiction to the fact that G is a 3-ASC graph. Therefore, \(\mathrm{deg}_G(z) = \mathrm{deg}_G(y) = 2\). Now, if w is adjacent to all the vertices of \(K_n\), then \(\mathrm{ecc}_G(z)=2\), otherwise \(\mathrm{ecc}_G(x)=5\). Hence in both cases G is not a 3-ASC graph. We conclude that \(\theta _3(K_n)\ge 5\).

It remains to prove that \(\theta _3(K_n)\le 5\) for \(n\ge 2\). For this sake consider the graph \(G_n\) which is schematically shown in Fig. 5. In the graph \(G_n\), the vertices u and v are adjacent to all the vertices of the \(K_{n-1}\) leading to two subgraphs isomorphic to \(K_n\). The two white vertices of \(G_n\) have eccentricity 4 while all the black vertices have eccentricity 3 (hereafter the white vertices denote the diametrical vertices and black vertices denote central ones). Hence \(G_n\) is a 3-ASC graph that contains \(K_n\). \(\square \)

The graph \(G_2\) from the proof of Theorem 3.1 is of order seven which makes it a smallest 3-ASC graph. Now we turn to graphs of diameter 2 and first bound their 3-ASC index as follows.

Fig. 5
figure 5

Graph \(G_n\), \(n\ge 1\)

Fig. 6
figure 6

Graph H for \(G=K_{2,3}\)

Lemma 3.2

If G is a graph of diameter 2, then \(3\le \theta _3(G)\le 4\).

Proof

To prove the upper bound we need to construct a graph H of order \(|V(G)|+4\) as a 3-ASC embedding graph of G. Set \(V(H)=V(G)\cup \{w,x,y,z\}\) and let the adjacency relation between the new vertices be \(w-z-y-x\). Let v be a vertex in G with \(\mathrm{ecc}_G(v)=2\) and u an eccentric vertex of v in G, that is, \(d_G(v,u)=2\). Join the vertex u in G with x and join all vertices from \(V(G){\setminus } \{u,v\}\) with w. This defines H (see Fig. 6 for an example of H when \(G=K_{2,3}\)).

Note that \(\mathrm{deg}_H(y)=\mathrm{deg}_H(z)=\mathrm{deg}_H(x)=2\) and that the neighborhood of v remains unchanged in H. Then we arrive at \(d_H(v,y)=4\) from the structure of H. Moreover, any vertex \(v^{\prime }\) from \(N_G(u)\) has eccentricity 3 in H with \(\mathrm{Ecc}_H(v^{\prime })=\{y\}\). Similarly, \(\mathrm{Ecc}_H(v^{\prime })=\{x,y\}\) for any vertex \(v^{\prime }\in \mathrm{Ecc}_G(u){\setminus }\{v\}\), since both x and y have a largest distance 3 to \(v^{\prime }\) in H. It follows that \(\mathrm{ecc}_H(v^{\prime })=3\) for any vertex \(v^{\prime }\in \mathrm{Ecc}_G(u){\setminus }\{v\}\). In addition, we have \(d_H(w,x)=3=d_H(z,u)\), which implies that \(\mathrm{ecc}_H(u)=\mathrm{ecc}_H(z)=3=\mathrm{ecc}_H(w)=\mathrm{ecc}_H(x)\). Thus H is a 3-ASC embedding graph of G as desired.

Next we deal with the lower bound on \(\theta _3(G)\). Note that any graph obtained by adding one more vertex to G has diameter at most 3. Thus we have \(\theta _3(G)\ge 2\).

Assume that \(G^{\prime }\) is an embedding 3-ASC graph of G by adding two more vertices x and y. Then \(G^{\prime }\) has diameter 4. Hence the adjacency relation of xy in \(G^{\prime }\) is either \(y-x-z\) with y being pendant, \(\mathrm{deg}_{G^{\prime }}(x)\ge 2\) and \(z\in V(G)\) with \(\mathrm{ecc}_G(z)=2\), or \(x-u\) and \(y-v\) where \(d_G(u,v)=2\) with \(\mathrm{ecc}_G(u)=\mathrm{ecc}_G(v)=2\). Considering that G has diameter 2, in the latter case, there is at least one vertex w as a common neighbor of vertices u and v in G. Then we deduce that \(\mathrm{ecc}_{G^{\prime }}(z)=2\) in the former case or \(\mathrm{ecc}_{G^{\prime }}(w)=2\) in the latter case, either of which contradicts the fact that \(G^{\prime }\) is a 3-ASC graph. So \(\theta _3(G)\ge 3\), finishing the proof of this lemma. \(\square \)

It is interesting to note that if \(G=P_3\), then the graph H constructed in the proof of Lemma 3.2 is the graph of order 7 mentioned before the lemma. Since the order of a smallest 3-ASC graph is 7, it follows that \(\theta _3(P_3) = 4\). There is a unique 2-SC graph \(C_4\) of order 4 with diameter 2. By Lemma 3.2, \(\theta _3(C_4)\le 4\) and one can prove that actually \(\theta _3(C_4) = 4\) holds. Consider next \(C_5\). By Lemma 3.2, \(\theta _3(C_5)\le 4\). But, to our surprise, 4 is not the minimum number of vertices needed to be added for obtaining a 3-ASC embedding of \(C_5\). Denote by \(C_n'\) the graph which consists of the cycle \(C_n\) and an additional vertex adjacent to exactly two consecutive vertices in \(C_n\). As observed in Klavžar et al. (2011), the graph \(C_{2r+1}'\) is an r-ASC graph. Let \(H_5'\) (shown in Fig. 7) be the graph obtained from \(C_5'\) by respectively attaching a pendant vertex to the two non-adjacent vertices of degree 2 in \(C_5'\). Since \(H_5'\) is a 3-ASC graph, we conclude that \(\theta _3(C_5)=3\). This example can be generalized as follows.

Fig. 7
figure 7

Graph \(H_5'\)

Theorem 3.3

Let G be a 2-SC graph. If G contains a diametrical pair uv and vertices \(u',v'\) such that \(u'\in N_G(u){\setminus } N_G(v)\), \(v'\in N_G(v){\setminus } N_G(u)\) and \(N_G(u)\cap N_G(v)\subseteq \mathrm{Ecc}_G(u')\cap \mathrm{Ecc}_G(v')\), then \(\theta _3(G)=3\).

Proof

By Lemma 3.2 it suffices to construct a 3-ASC embedding graph of G. Let H be the graph obtained from G by adding three new vertices xyz and edges xu, yv, \(zu'\), and \(zv'\). The vertices x and y are pendant in H and hence \(d_H(x,y)=4\). Consequently, \(\mathrm{ecc}_H(u)=\mathrm{ecc}_H(v)=3\) with \(\mathrm{Ecc}_H(u)=\{y\}\) and \(\mathrm{Ecc}_H(v)=\{x\}\). Since \(N_G(u)\cap N_G(v)\subseteq Ecc_G(u')\cap Ecc_G(v')\), any vertex \(w\in N_G(u)\cap N_G(v)\) is at distance 2 from both \(u'\) and \(v'\) in G. Thus any vertex \(w\in N_G(u)\cap N_G(v)\) is an eccentric vertex of z in H with \(d_H(w,z)=3\). Then \(\mathrm{ecc}_H(z)=3\) holds. This in turn implies that \(\mathrm{ecc}_H(w)=3\) for any vertex \(w\in N_G(u)\cap N_G(v)\). Moreover, all the vertices in \(N_G(u){\setminus } N_G(v)\), including \(u'\), have eccentricity 3 in H with y as their common eccentric vertex. By symmetry, all the vertices in \(N_G(v){\setminus } N_G(u)\), including \(v'\), have eccentricity 3 in H. Finally, each vertex (if any) in \(\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)\) has eccentricity 3 in H with x and y as its eccentric vertices. We conclude that H is a 3-ASC embedding graph of G. \(\square \)

By Lemma 3.2, the 3-ASC index of a graph G of diameter 2 is either 3 or 4. In the rest of this section we make a partial corresponding classification, where we will always assume that the graph G considered is of order n and of diameter 2. We first prove:

Theorem 3.4

If G does not contain a diametrical triple and does not satisfy the assumption of Theorem 3.3, then \(\theta _3(G) = 4\).

Proof

By Lemma 3.2 it suffices to prove that \(\theta _3(G)\ne 3\). Suppose on the contrary that \(G^{*}\) is a 3-ASC embedding graph of the graph G with \(V(G^*)=V(G)\cup \{x,y,z\}\) and set \(V_0=\{x,y,z\}\).

Assume first that G has a vertex v of degree \(n-1\). Note that then there exists a vertex u with \(\mathrm{ecc}_G(u)=2\) adjacent to v in G. We now distinguish two cases.

Case 1 \(\mathrm{ecc}_{G^{*}}(v)=4\).

In this case the adjacency relation of \(V_0\) is \(x-y-z\) with one vertex, say z, being pendant. Considering that \(G^*\) has diameter 4, we infer that any vertex u with \(\mathrm{ecc}_G(u)=2\) must be adjacent to x in \(G^{*}\). But then \(\mathrm{ecc}_{G^{*}}(x)=2\), which is impossible because of the 3-ASC property of \(G^{*}\).

Case 2 \(\mathrm{ecc}_{G^{*}}(v)=3\).

In this case, clearly, we have \(\mathrm{Ecc}_{G^*}(v)\subseteq V_0\). Since \(\mathrm{ecc}_{G^*}(v)=\mathrm{ecc}_G(v)+2\), we have \(|\mathrm{Ecc}_{G^*}(v)|\le 2\). If \(|\mathrm{Ecc}_{G^*}(v)|=2\), we may assume that \(\mathrm{Ecc}_{G^*}(v)=\{y,z\}\). Then \(x\in N_{G^*}(y)\cap N_{G^*}(z)\) and there exists a vertex w with \(wx\in E(G^*)\). But now we get \(\mathrm{ecc}_{G^*}(w)=2\), which is a contradiction. When \(|\mathrm{Ecc}_{G^*}(v)|=1\), we may assume that \(\mathrm{Ecc}_{G^*}(v)=\{z\}\) and \(v-w-y-z\) is a (vz)-path of length 3. Note that \(\mathrm{ecc}_{G^{*}}(w)=3\). Now we consider the position of x in \(G^*\). If \(xv\in E(G^*)\), then \(\mathrm{ecc}_{G^{*}}(w)=2\), a contradiction again. If \(d_{G^*}(x,v)=2\), we assume that \(w^{\prime }\in N_{G^*}(x)\cap N_{G^*}(v)\). If \(ww^{\prime }\in E(G)\), we get the same result \(\mathrm{ecc}_{G^{*}}(w)=2\). We observe that x is not adjacent to any vertex from \(N_{G^*}(w)\). If not, we have \(\mathrm{ecc}_{G^{*}}(w)=2\) which is impossible. In particular, \(xy\notin E(G^*)\). Now we only need to deal with the subcase when \(d_G(w,w^{\prime })=2\). Let \(w^{\prime \prime }\) be a common neighbor of w and \(w^{\prime }\) in G. If \(xz\in E(G^*)\), then \(xw^{\prime }vwyzx\) is an induced cycle \(C_6\). Considering that G contains no diametrical triple, then \(G^*\) is a 3-SC graph. This contradicts the 3-ASC property of \(G^*\). Therefore \(xz\notin E(G^*)\). Combining \(d_{G^*}(v,z)=3\) with \(\mathrm{deg}_G(v)=n-1\), we find that z is pendant in \(G^*\). Obviously, \(\mathrm{ecc}_{G^*}(z)=\mathrm{ecc}_{G^*}(y)+1\). It follows that \(\mathrm{ecc}_{G^*}(z)=4\) from the 3-ASC property of \(G^*\). Then \(2\le d_{G^*}(y,x)\le 3\). If \(d_{G^*}(y,x)=3\), then there must be a (yx)-path, say \(y-y_1-x_1-x\), of length 3 where \(y_1,x_1\in V(G){\setminus }\{v\}\). This deduces \(\mathrm{ecc}_{G^*}(y_1)=2\), a contradiction again. While if \(d_{G^*}(y,x)=2\), there must be a neighbor \(v^{\prime }\) of v such that \(v^{\prime }\) is a common neighbor of x and y in \(G^*\). Then \(\mathrm{ecc}_{G^*}(v^{\prime })=2\). Both these possibilities are impossible from the 3-ASC property of \(G^*\).

We have thus proved that no vertex of G can be of degree \(n-1\), that is, G must be a 2-SC graph. Suppose first that the adjacency relation of \(V_0\) in \(G^*\) is \(x-y-z\). We will show that x or z must be a pendant vertex of \(G^*\). Otherwise, each vertex from \(V_0\) has degree at least 2 in \(G^*\). Let \(x'\) and \(z'\) from G be neighbors of x and z, respectively, in \(G^*\). If \(deg_{G^*}(y)>2\), then any vertex of \(G^*\) has eccentricity at most 3, a contradiction since \(G^*\) is a 3-ASC graph. Hence \(deg_{G^*}(y)=2\). Clearly \(\mathrm{ecc}_{G^*}(x)=\mathrm{ecc}_{G^*}(z)=3\), therefore there must exist \(u\in V(G)\) such that \(d_{G^*}(y,u)=4\). Now \(d_{G^*}(y,x')=d_{G^*}(y,z')=2\) and we have \(d_{G^*}(u,x')=d_{G^*}(u,z')=2\). If \(d_{G^*}(x',z')=2\), then we have a contradiction with \(x',z'\) and u being a diametrical triple of G. Hence \(d_{G^*}(x',z')=1\) or \(x'=z'\). In both cases, we have that \(\mathrm{ecc}_{G^*}(x')=\mathrm{ecc}_{G^*}(z')=2\), again a contradiction with \(G^*\) being a 3-ASC graph. Therefore both x and z cannot have a neighbor in G and suppose that z is a pendant vertex of \(G^*\) and that \(x'\) is a neighbor of x in G. Every vertex \(u\in \mathrm{Ecc}_G(x')\) must be adjacent to x or to y, since otherwise we have \(d_{G^*}(z,u)=5\) as a contradiction. But now we have \(\mathrm{ecc}_{G^*}(x)=2\) a contradiction again with \(G^*\) being a 3-ASC graph.

Suppose now that \(G^*[V_0]=P_2\cup K_1\). Without loss of generality we may assume that \(P_2=xy\). If one of x and y, say y, is a pendant vertex, then \(\mathrm{ecc}_{G^*}(y)=4\) and let \(x'\in V(G)\) be a neighbor of x in G on the diametrical path of length 4 that starts in y. Observe that \(\mathrm{ecc}_{G^*}(x')=2\), a contradiction with \(G^*\) being a 3-ASC graph. So, we may assume that x and y are not pendant and that \(x'\) and \(y'\) from G are neighbors of x and y, respectively, in \(G^*\). Every vertex from G is at distance at most 3 to each vertex of \(V_0\) and this implies that z is one endvertex of a path of length 4 and either x or y, say x, is the other. But now \(\mathrm{ecc}_{G^*}(y')=2\), the same contradiction again.

Finally, let \(V_0\) be an independent set in \(G^*\). Then \(V_0\) contains two diametrical vertices, say x and y, that is, \(d_{G^*}(x,y)=4\). Let \(x-x^{\prime }-w-y^{\prime }-y\) be a diametrical path in \(G^*\). Clearly, \(w\in N_G(x^{\prime })\cap N_G(y^{\prime })\). We now claim that \(\mathrm{ecc}_{G^*}(w)=2\). To prove it, it suffices to show that \(d_{G^*}(w,z)=2\). Otherwise, we have \(d_{G^*}(w,z)=3\). Since \(x^{\prime }\) and \(y^{\prime }\) do not lie in any diametrical triple, then there are two vertices \(x_0,y_0\in V(G)\) with \(x_0\in N_G(x^{\prime }){\setminus } N_G(y^{\prime })\), \(y_0\in N_G(y^{\prime }){\setminus } N_G(x^{\prime })\) and \(w\in \mathrm{Ecc}_G(x_0)\cap \mathrm{Ecc}_G(y_0)\) with \(zx_0,zy_0\in E(G^*)\). But now G just satisfies the assumption of Theorem 3.3, which is impossible. Therefore we get the contradiction \(\mathrm{ecc}_{G^*}(w)=2\) to the 3-ASC property of G. This completes the proof of the theorem. \(\square \)

By Theorem 3.4 it remains to consider those graphs G of diameter 2 that contain diametrical triples. We next give two sufficient conditions that guarantee that \(\theta _3(G) = 3\).

Theorem 3.5

If a graph G contains vertices u and v of a diametrical triple of G such that \(\delta \left( G[\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)]\right) = 0\), then \(\theta _3(G) = 3\).

Fig. 8
figure 8

Construction from the proof of Theorem 3.5

Proof

By Lemma 3.2 we only need to prove that \(\theta _3(G) \le 3\).

Since u and v belong to a diametrical triple, there exists a vertex \(w\in \mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)\), \(w\ne u,v\). By the theorem’s assumption we may assume that w is an isolated vertex in \(G[\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)]\). Now we construct a graph H as follows. Let \(V(H) = V(G) \cup \{x,y,z\}\) and \(E(G)\cup \{ux,vz,xy,yz\}\subseteq E(H)\). In addition, we join x to all (if any) vertices from \(\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)\) different from w. This construction is presented in Fig. 8.

Since w is an isolated vertex in \(G[\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)]\), we have \(d_G(w,w^{\prime })=2\) for any vertex \(w^{\prime }\in \left( \mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)\right) {\setminus }\{w\}\). Clearly, \(d_G(w,u)=2=d_G(w,v)\). So \(d_H(w,y)=4\). Any vertex from \(N_G(u)\cap N_G(v)\) has eccentricity 3 since y is its unique eccentric vertex with distance 3 to it in H. In addition, \(\mathrm{ecc}_H(u)=3\) from the fact that \(\mathrm{Ecc}_H(u)=\{z\}\) with \(d_H(u,z)=3\). Similarly, we also have \(\mathrm{ecc}_H(v)=3\). For any vertex \(w^{\prime }\in { \left( \mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)\right) }{\setminus }\{w\}\), considering that \(w^{\prime }x\in E(H)\), we conclude that \(\mathrm{ecc}_H(w^{\prime })=3\) since z is the only one vertex with the largest distance 3 to \(w^{\prime }\) in H. For any vertex \(v^{\prime }\in N_G(u){\setminus } N_G(v)\), we have \(\mathrm{Ecc}_H(v^{\prime })=\{y,z\}\) with \(d_H(v^{\prime },y)=3=d_H(v^{\prime },z)\) being largest. Then it follows that \(\mathrm{ecc}_H(v^{\prime })=3\). Moreover, \(\mathrm{ecc}_H(v^{\prime })=3\) with \(\mathrm{Ecc}_H(v^{\prime })=\{y,x\}\) for any vertex \(v^{\prime }\in N_G(v){\setminus } N_G(u)\) by an analogous reasoning. We conclude that H is a 3-ASC embedding graph of G. \(\square \)

Theorem 3.6

If a graph G contains vertices u and v of a diametrical triple of G such that \(G[\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)]\) contains \(P_3\) as an induced subgraph, then \(\theta _3(G) = 3\).

Fig. 9
figure 9

Construction from the proof of Theorem 3.6

Proof

Applying Lemma 3.2 again we only need to prove that \(\theta _3(G) \le 3\).

Let \(w_1w_2w_3\) be an induced path in \(G[\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)]\). We construct a graph H obtained from G by adding vertices xyz and edges \(xy, yz, ux, vz, w_3x\). Moreover, we join all vertices (if any) from \(\left( \mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)\right) {\setminus } N_G[w_1]\) with the vertex x in H. See Fig. 9 for an illustration of the construction.

Thus the neighborhood of any vertex from \(N_G[w_1]\) or not in \(\left( \mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)\right) \cup \{u,v\}\) remains unchanged in H. From the construction of H we first infer that \(d_H(w_1,y)=4\) since \(w_1w_2w_3xy\) is a shortest path between them. Any vertex from \(\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)\), except \(w_2\) and \(w_1\), has eccentricity 3 in H because z is its unique eccentric vertex and is at distance 3. Also we have \(\mathrm{ecc}_H(w_2)=3\) from the fact that \(\mathrm{Ecc}_H(w_2)=\{y,z\}\) with \(d_H(w_2,y)=3=d_H(w_2,z)\). Any vertex from \(N_G(u)\cap N_G(v)\) has eccentricity 3 in H because y is its unique eccentric vertex and is at distance 3. Furthermore, \(\mathrm{ecc}_H(w)=3\) with \(\mathrm{Ecc}_H(w)=\{y,z\}\) for any vertex \(w\in N_G(u){\setminus } N_G(v)\). By symmetry, we get \(\mathrm{ecc}_H(w)=3\) for any vertex \(w\in N_G(v){\setminus } N_G(u)\). Also we claim that \(\mathrm{ecc}_H(x)=3=\mathrm{ecc}_H(z)\) because \(w_1\in \mathrm{Ecc}_H(x)\) and \(w_2\in \mathrm{Ecc}_H(z)\), respectively, in H. Obviously we have \(\mathrm{ecc}_H(u)=3=\mathrm{ecc}_H(v)\) from \(\mathrm{Ecc}_H(u)=\{z\}\) and \(\mathrm{Ecc}_H(v)=\{x\}\), respectively. Therefore H is a 3-ASC embedding graph of G. \(\square \)

Note that the Petersen graph PG fulfills the assumption of Theorem 3.3, hence \(\theta _3(PG) = 3\). But PG does not fulfill the condition of Theorem 3.5. Further, \(\theta _3(K_{1,3})=3\) holds by Theorem 3.5. However, \(K_{1,3}\) does not fulfill the assumption of Theorem 3.3 or that of Theorem 3.6. Therefore, none of Theorems 3.33.5, and 3.6 gives a necessary condition for \(\theta _3(G)=3\).

In view of Theorems 3.5 and 3.6 one might wonder whether \(\theta _3(G) = 3\) holds as soon as G contains a diametrical triple. This is not the case as it can be verified on the graph \(K_1 \oplus 3P_2\). More generally, we have the following result.

Theorem 3.7

If for any non-adjacent vertices uv the subgraph induced by \(\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)\) is a disjoint union of complete graphs on at least two vertices such that any outer neighbor of each vertex from any of these complete subgraphs belongs to \(N_G(u)\cap N_G(v)\) and G does not satisfy the assumption of Theorem 3.3, then \(\theta _3(G)=4\).

Proof

By Lemma 3.2 it suffices to prove that \(\theta _3(G)>3\). Suppose on the contrary that \(\theta _3(G)=3\) and let H be a 3-ASC graph obtained from G by adding vertices \(V_0 = \{x,y,z\}\) and some edges (while keeping G to be induced in H). We distinguish two cases.

Case 1 No vertex from \(V_0\) is pendant in H.

We first claim that if \(H[V_0]\) is complete or disconnected, then we can find some vertex with eccentricity 2 in H, contradicting the 3-ASC property of H.

Suppose first that \(H[V_0]\) is complete. Then considering that H has exactly two diametrical vertices with eccentricity 4, we observe that one vertex, say x, from \(V_0\) has eccentricity 4 in H. Let \(w\in V(G)\) be the other diametrical vertex in H. Then there is a vertex \(w^{\prime }\in V(G)\) with \(d_H(w^{\prime },x)=d_H(w^{\prime },w)=2\). It follows that \(\mathrm{ecc}_H(w^{\prime })=2\).

Assume next that \(H[V_0]\) is disconnected. Then \(H[V_0]\cong K_1\bigcup P_2\) or consists of three isolated vertices. In the former case, we can assume that x is isolated in \(H[V_0]\). Then \(2\le \min \{d_H(x,y),d_H(x,z)\}\le 3\) since H is a 3-ASC graph. Without loss of generality assume that \(\min \{d_H(x,y),d_H(x,z)\}=d_H(x,y)\). If \(d_H(x,y)=2\), then there is a vertex \(w\in V(G)\) as a common neighbor of x and y in H. Thus we get \(\mathrm{ecc}_H(w)=2\). When \(d_H(x,y)=3\), we assume that \(xx^{\prime },yy^{\prime }\in E(H)\) where \(x^{\prime },y^{\prime }\in V(G)\). Then \(d_G(x^{\prime },y^{\prime })=1\) and \(\mathrm{ecc}_H(y^{\prime })=2\). In the latter case, we conclude that there is a diametrical vertex in \(V_0\) of H, say \(\mathrm{ecc}_H(x)=4\). Then the other diametrical vertex of H must be also in \(V_0\). Otherwise, assume that \(w\in V(G)\) has eccentricity 4 in H. Then the distance from w to any neighbor of x in G is 3, which is impossible because G has diameter 2. Assume that \(\mathrm{ecc}_H(y)=4\). Let \(z^{\prime }\) be an arbitrary neighbor of z in H and \(x^{\prime }\), \(y^{\prime }\) the arbitrary neighbors of x and y, respectively, in H. First we claim that neither of x and y belongs to \(\mathrm{Ecc}_H(z)\). If not, without loss of generality let \(x\in \mathrm{Ecc}_H(z)\). Considering that \(\mathrm{ecc}_H(z^{\prime })=3\), we have \(d_H(z^{\prime },x)=3\). Then \(d_H(z,x)=4\), which is a clear contradiction. Thus we have \(d_H(x,z)=2=d_H(y,z)\) from \(\mathrm{ecc}_H(z)=3\). Now we conclude that \(zx^{\prime },zy^{\prime }\in E(H)\). It follows that \(\mathrm{ecc}_H(w)=2\) for any vertex \(w\in N_G(x^{\prime })\bigcap N_G(y^{\prime })\). This proves the claim.

So we are left with the situation when \(H[V_0]\cong P_3\). Assume that the adjacency relation of \(V_0\) in H is \(x-y-z\). By the case assumption, there exists edges \(xu,zv\in E(H)\). Note first that \(u\ne v\), for otherwise we would have \(\mathrm{ecc}_H(u)=2\). The same conclusion holds if \(d_H(u,v)=1\).

Hence \(d_H(u,v)=2\) must hold. By the theorem’s assumption, \(\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)\) induces a disjoint union of complete graphs \(K_{n_k}\), \(n_k\ge 2\). Note first that w is not adjacent to any vertex from \(V_0\) for any vertex \(w\in N_G(u)\cap N_G(v)\), for otherwise \(\mathrm{ecc}_H(w)=2\) would hold. Recall that G has diameter 2. If there is at least one vertex in each \(K_{n_k}\) adjacent to some vertex from \(V_0\), then the distance is at most 3 from any vertex from \(G[\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)]\) to any vertex in \(V_0\) of H. Thus any vertex in H has eccentricity at most 3, a contradiction to the fact that H is a 3-ASC graph. Hence there must be some complete component \(K_{n_i}\), from \(G[\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v)]\), such that none of vertices of \(K_{n_i}\) is adjacent to any vertex from \(V_0\) in H. Let \(w_1, w_2\) be arbitrary vertices of \(K_{n_i}\). Recalling that any vertex from \(V_0\) is not adjacent to any vertex from \(N_G(u)\cap N_G(v)\) in H, from the theorem’s condition that any outer neighbor of any vertex of these complete subgraphs belongs to \(N_G(u)\cap N_G(v)\), we find that \(d_H(w_1,y) = d_H(w_2,y)= 4\). We conclude that H is not a 3-ASC graph.

Case 2 \(V_0\) contains at least one pendant vertex of H.

Denote by h the number of pendant vertices from \(V_0\) in H. If \(h=1\), we may assume that \(\mathrm{deg}_H(z)=1\). Considering that H is 3-ASC graph, we observe that \(\mathrm{ecc}_H(z)=4\). Assume that \(z-z^{\prime }-w_0-w^{\prime }-w\) is a diametrical path in H. Then \(d_H(z^{\prime },w)=3\), which implies that at most one vertex from \(\{w^{\prime },z\}\) belongs to V(G). If \(w_0\in V(G)\), we claim that \(\mathrm{ecc}_H(w_0)=2\) as a contradiction. In fact, clearly, \(\mathrm{ecc}_H(w_0)=2\) if \(\{z,w^{\prime }\}\subseteq V_0\). When \(|\{z^{\prime },w\}\cap V_0|=1\), without loss of generality, assume that \(z^{\prime }=y\in V_0\). Now it suffices to prove that \(d_H(w_0,x)=2\). Otherwise, we have \(d_H(w_0,x)=3\), that is, there exists a vertex \(x^{\prime }\in \mathrm{Ecc}_G(w_0)\) such that \(xx^{\prime }\in E(H)\). Note that \(\mathrm{ecc}_H(x)=3\). Then \(d_H(x,z)\in \{2,3\}\). If \(d_H(x,z)=2\), then \(xz^{\prime }\in E(H)\), which implies \(d_H(w_0,x)=2\), contradicting the fact that \(d_H(w_0,x)=3\). Thus \(d_H(x,z)=3\) holds. We get \(d_H(x^{\prime },z^{\prime })=3\), i.e., \(d_H(x^{\prime },z)=4\) as another contradiction. While \(w_0\notin V(G)\), without loss of generality, we may assume that \(w_0=x\). Next we divide into the following two subcases. For \(z^{\prime }\in V(G)\), recalling that \(z^{\prime },w\) cannot belong to V(G) simultaneously, we have \(w\notin V(G)\), i.e., \(w=y\). In this subcase, we claim that \(z^{\prime }\) and \(w^{\prime }\) forms a diametrical pair in G. Let \(w^{*}\in N_G(w^{\prime })\cap N_G(z^{\prime })\). Then the distance from \(w^*\) to any vertex in \(V_0\) is at most 2 in H. Recalling that G has diameter 2. Then \(\mathrm{ecc}_H(w^{*})=2\), which is also impossible. If \(z^{\prime }\notin V(G)\), then \(z^{\prime }=y\). So the adjacency relation of \(V_0\) in H is \(x-y-z\) with z being pendant. If \(\mathrm{deg}_G(w^{\prime })=n-1\), then \(\mathrm{ecc}_H(x)=2\) clearly. If \(\mathrm{ecc}_G(w^{\prime })=2\), we consider the vertices from \(\mathrm{Ecc}_G(w^{\prime })\). Now we conclude that \(w_1\) is adjacent to x or y in H for any vertex \(w_1\in \mathrm{Ecc}_G(w^{\prime })\). Otherwise, \(d_H(w_1,z)> 4\), contradicting to the 3-ASC property of H. Therefore, we get \(\mathrm{ecc}_H(x)=2\), a clear contradiction comes again.

If \(h=2\), without loss of generality, we assume that xy are both pendant in H. Clearly, \(\mathrm{eec}_H(x)=4=\mathrm{eec}_H(y)\). Let \(xx^{\prime },yy^{\prime }\in E(H)\). Since H is 3-ASC graph, there is a diametrical path \(x-x^{\prime }-w-y^{\prime }-y\) with \(w\in V(G)\cup \{z\}\). Note that \(d_G(x^{\prime },y^{\prime })=2\). Without loss of generality, assume that \(w\in V(G)\). Since G does not satisfy the assumption of Theorem 3.3, we have \(d_H(w,z)\le 2\) (if G satisfies the condition of Theorem 3.3 and \(z\in N_2(x^\prime )\cap N_2(y^{\prime })\) in H, then \(d_H(w,z)=3\) holds possibly), which implies that \(\mathrm{ecc}_H(w)=2\) as an obvious contradiction. If \(h=3\), then each of xy and z has eccentricity 4 in H (if one of them has eccentricity 3, then its unique neighbor has eccentricity 2, a contradiction), contradicting the definition of 3-ASC graph. \(\square \)

Consider the graph G shown in Fig. 10. It is of diameter 2 and fulfils the first condition of Theorem 3.7. For the selected vertices u and v we have \(\mathrm{Ecc}_G(u)\cap \mathrm{Ecc}_G(v) = \{x,y\}\). Note that each of these vertices has an outer neighbor that does not belong to \(N_G(u)\cap N_G(v)\). Hence the second condition of the theorem is not fulfilled. In the figure an embedding of G into a 3-ASC graph is also shown, therefore \(\theta _3(G) = 3\). In summary, the technical condition about the outer neighbors from Theorem 3.7 cannot be avoided.

Fig. 10
figure 10

Graph G with \(\theta _3(G) = 3\)

Recall that the well-known cocktail party graph CP(n) is a complete graph on 2n vertices with a 1-factor removed. By Theorem 3.4, \(\theta _3(CP(n))=4\) but CP(n) does not fulfill the condition of Theorem 3.7. In addition, from Theorem 3.7 we get that \(\theta _3(K_1\oplus tP_2)=4\) holds for any \(t\ge 3\), but \(K_1\oplus tP_2\), \(t\ge 3\), does not fulfill the condition of Theorem 3.4. Therefore, Theorems 3.4 and 3.7 give sufficient but not necessary conditions for G having \(\theta _3(G)=4\).

4 3-ASC index of some graphs with large diameter

In this section we will determine the 3-ASC index of paths of order \(n\ge 1\), cycles of order \(n\ge 3\), and trees of order \(n\ge 10\) and diameter \(n-2\).

4.1 Paths

In this subsection we will always assume that \(V(P_n)=\{v_1,\ldots ,v_{n}\}\) and \(E(P_n)=\{v_iv_{i+1}:\ i=1,\ldots , n-1\}\). We will also use the graph \(C_{2k}^{*}\), \(k\ge 2\), which is obtained from \(C_{2k}\) by attaching a pendant vertex to one of its vertices. As observed in Klavžar et al. (2011), the graph \(C_{2r}^{*}\) is an r-ASC graph. First we deal with the cases when n is small.

The cases \(n=1\) and \(n=2\) are covered by Theorem 3.1. We have already observed that a smallest 3-ASC graph is of order 7. Since each of the paths \(P_3\), \(P_4\), \(P_5\), and \(P_6\) is an induced subgraph of \(C_6^*\), it follows that \(\theta _3(P_3)=4\), \(\theta _3(P_4)=3\), \(\theta _3(P_5)=2\), and \(\theta _3(P_6)=1\). For \(n=7\) and \(n=8\), consider the graphs \(H_1\) and \(H_2\) from Fig. 11. By a straightforward checking we find that both \(H_1\) and \(H_2\) are 3-ASC graphs. Therefore \(\theta _3(P_7)=\theta _3(P_8)=1\).

Fig. 11
figure 11

The graphs \(H_1\) and \(H_2\)

Fig. 12
figure 12

Embedding of \(P_9\) into a 3-ASC graph of order 11

In the rest we may thus assume that \(n\ge 9\) and first prove:

Lemma 4.1

If \(n\ge 9\), then \(\theta _3(P_n)\le 2\).

Proof

For \(n=9\) the assertion follows from the embedding presented in Fig. 12.

For \(n\ge 10\) we construct a graph \(G_n\) schematically shown in Fig. 13, where all the vertices \(v_{10},\ldots , v_{n}\) are adjacent to both x and y.

It is straightforward to check that \(G_n\) is a 3-ASC embedding graph of \(P_n\). \(\square \)

Lemma 4.2

If \(n\ge 9\), then \(\theta _3(P_n)\ge 2\).

Proof

Since paths \(P_n\) are not 3-ASC graphs we have \(\theta _3(P_n)> 0\) for all \(n\ge 9\). In the following we prove that \(\theta _3(P_n)>1\) for \(n\ge 9\). Assume on the contrary that there exists a 3-ASC graph G with \(V(G)=V(P_n)\cup \{x\}\) that contains \(P_n\) as an induced subgraph.

First assume that x is a diametrical vertex in G and let \(v_i\) be its diametrical pair, so that \(d_G(x,v_i)=4\). If \(i=1\), then clearly \(xv_1, xv_2, xv_3\notin E(G)\) and \(xv_4\in E(G)\). Since \(P_n\) is an induced subgraph of G, we conclude that \(d_G(v_1,v_j)\ge 4\) for \(j\ge 5\), which contradicts the fact that G is a 3-ASC graph. Similarly we get a contradiction if \(i = 2\). By symmetry, \(i\ne n-1\) and \(i\ne n\). Finally, if \(2<i< n-2\), then x is not adjacent to any vertex of \(v_{i-2}\), \(v_{i-1}\), \(v_{i+1}\) and \(v_{i+2}\). Thus \(d_G(v_{i-2},v_{i+2})=4\), another contradiction.

Fig. 13
figure 13

Graphs \(G_n\)

It follows that the two diametrical vertices of G are on \(P_n\), say \(v_i\) and \(v_j\), where \(i<j\). Then \(d_G(v_i,v_j)=4\). Clearly, \(xv_i\) and \(xv_j\) cannot belong to E(G) simultaneously. We distinguish the following two cases.

Case 1 Either \(xv_i\in E(G)\) or \(xv_j\in E(G)\).

We may without loss of generality assume that \(xv_i\in E(G)\). If \(i>1\), then \(d_G(v_{i-1}, v_j)\ge 4\), which implies that G has as least three diametrical vertices. Hence \(i=1\) must hold. Since \(xv_1\in E(G)\) and \(d_G(v_1,v_j)=4\), neither of \(v_{j}\) and \(v_{j-1}\) is adjacent to x in G. If \(j<n\), then the same conclusion holds also for \(v_{j+1}\). In any case, \(d_G(v_{j-4},v_j) = 4\). This is only possible if \(j-4 = i = 1\), that is, if \(j=5\). As already argued above, \(xv_4, xv_5, xv_6\notin E(G)\), for otherwise \(d_G(v_1,v_5)\le 3\) would hold. But then it follows that \(d_G(v_9, v_5) = 4\), so we would again have at least three diametrical vertices. Case 1 hence cannot happen.

Case 2 Neither of \(v_i\) and \(v_j\) is adjacent to x in G.

Suppose first that \(i\ge 2\) and \(j\le n-1\). Then x must be adjacent to each vertex from \(V_1=\{v_{k}:\ 1\le k<i\}\) because \(d_G(v_k,v_j)\ge 4\) holds if \(v_kx\notin E(G)\). Analogously, x must be adjacent to each vertex from \(V_2=\{v_t:\ j<t\le n\}\). Since \(d_G(v_i,v_j)=4\) we clearly have that \(j-i\ge 4\). If \(j-i=4\), then \(xv_{i+2}\notin E(G)\), for otherwise \(\mathrm{ecc}_G(x)=2\). Considering that \(d_G(v_{i+3},v_k)\le 3\) for any vertex \(v_k\in V_1\), we have \(xv_{i+3}\in E(G)\). By symmetry, we get \(xv_{i+1}\in E(G)\). Hence \(\mathrm{ecc}_G(x)=2\) holds again, a contradiction. If \(j-i>4\), then from \(\mathrm{ecc}_G(x)=3\) we find out that there are three consecutive vertices \(v_s,v_{s+1},v_{s+2}\) where \(i\le s<s+2\le j\) such that each of them has degree 2 in G. But now there must be a vertex \(v_p\in V_1\cup V_2\) such that \(d_G(v_{s+1},v_{p})=4\).

Let next \(i=1\) and \(j<n\). Then x must be adjacent to all vertices \(v_t\), \(t>j\), because otherwise \(d_G(v_t,v_1)\ge 4\) would hold for such a vertex \(v_t\). Assume that \(xv_2\notin E(G)\). Then \(j=5\) because otherwise \(d_G(v_2,v_{j}) > 3\). But then \(d_G(v_1,v_{6}) > 3\), a contradiction. Hence necessary \(xv_2\in E(G)\). As above we now find consecutive vertices \(v_s,v_{s+1},v_{s+2}\) such that none of them is adjacent to x in G where \(3\le s<s+2\le j\), for otherwise \(\mathrm{ecc}_G(x)=2\). But then \(d_G(v_{s+1},v_{1}) > 3\) for \(s>3\), or \(d_G(v_{s+1},v_p)>3\) where \(p>j\) for \(s=3\), another contradiction.

The case when \(i> 1\) and \(j=n\) is symmetric to the last case. Hence we are left with the situation when \(i=1\) and \(j=n\). If \(xv_2\notin E(G)\), then we have \(d_G(v_1,v_{n-1}) > 3\). So \(xv_2\in E(G)\) and by a parallel argument also \(xv_{n-1}\in E(G)\). Now, as above, we have a triple of vertices \(v_s,v_{s+1},v_{s+2}\) none of which is adjacent to x in G. But then \(d_G(v_{s+1},v_1) > 3\) or \(d_G(v_{s+1},v_n) > 3\), a final contradiction. \(\square \)

Combining Lemmas 4.1 and 4.2 with the arguments given before then we have the following result.

Theorem 4.3

The 3-ASC index of paths is:

$$\begin{aligned} \theta _3(P_n)=\left\{ \begin{array}{ll} 7-n, &{}\quad 1\le n\le 5; \\ 1,&{}\quad 6\le n \le 8; \\ 2,&{}\quad n\ge 9. \end{array} \right. \end{aligned}$$

4.2 Cycles

Next we determine the 3-ASC index of cycles. The triangle \(C_3\) is a complete graph, so \(\theta _3(C_3)=5\) by Theorem 3.1. We have already observed that \(\theta _3(C_4)=4\) and \(\theta _3(C_5)=3\). Recall that \(C_6^*\) (the graph obtained by attaching a pendant vertex to one of the vertices of \(C_6\)) is a 3-ASC graph, hence \(\theta _3(C_6)=1\). Recall further that \(C_{2r+1}'\) is the graph which consists of a cycle \(C_{2r+1}\) and a vertex adjacent to exactly two consecutive vertices in \(C_{2r+1}\) and that \(C_{2r+1}'\) is an r-ASC graph. Thus \(C_7'\) is 3-ASC graph and \(\theta _3(C_7)=1\) holds accordingly. Let in addition \(C_8''\) be the graph obtained by joining five consecutive vertices of \(C_8\) with a new vertex. It can be easily checked that \(C_8''\) is a 3-ASC graph and thus \(\theta _3(C_8)=1\). The result for all cycles reads as follows.

Theorem 4.4

The 3-ASC index of cycles is:

$$\begin{aligned} \theta _3(C_n)=\left\{ \begin{array}{ll} 8-n, &{}\quad 3\le n \le 5; \\ 1,&{}\quad 6\le n \le 8; \\ 2,&{}\quad n\ge 9. \end{array} \right. \end{aligned}$$

Proof

The result for \(n\le 8\) has been established above, hence in the following we will assume that \(n\ge 9\). Let \(V(C_n)=\{v_1,\ldots ,v_n\}\), \(E(C_n)=\{v_iv_{i+1}{ :}\ i=1,\ldots ,n-1\}\cup \{v_nv_1\}\), and for a positive integer k, \(1\le k\le n\), we set \(|k|_{n}=\min \{k,n-k\}\).

We first prove that \(\theta _3(C_n)\le 2\). For \(n=9\) consider the graph G shown in Fig. 14. It can be routinely checked that G is a 3-ASC graph (recall that two vertices filled white are diametrical vertices as mentioned before).

When \(n\ge 10\), we construct the graph \(H_n\) as shown in Fig. 15. In \(H_n\) both x and y are adjacent to any vertex from \(\{v_k:\ 10\le k\le n\}\). The graph \(H_n\) is a 3-ASC embedding graph of \(C_n\), completing the proof of upper bound on \(\theta _3(C_n)\).

To complete the proof we need to show that \(\theta _3(C_n)\ge 2\). As \(C_n\), \(n\ge 9\), is not a 3-ASC graph, we only need to prove that \(\theta _3(C_n)> 1\). Suppose on the contrary that a graph G with vertex set \(V(C_n)\cup \{x\}\) is a 3-ASC embedding graph of \(C_n\).

If \(\mathrm{ecc}_G(x)=4\), then there exists an induced internal \((v_i,v_j)\)-path P (that is, a path whose internal vertices are of degree 2) of length 6 in G such that \(xv_i,xv_j\in E(G)\) and \(d_G(x,v_{t})=4\) where \(v_t\in V(P)\) with \(|t-i|_n=|t-j|_n=3\). Thus we conclude that \(d_G(v_{t},v_s)\ge 4\) for \(v_s\in V(C_n){\setminus } V(P)\). This is an apparent contradiction to the 3-ASC property of G. If \(\mathrm{ecc}_G(x)=3\), then, considering a vertex being at distance 3 from x, we infer that there is an induced internal \((v_i,v_j)\)-path P with \(|j-i|_n=4\) or 5 and \(v_k\in V(P)\) such that both \(v_i\) and \(v_j\) are adjacent to x in G and that neither of \(v_i\) and \(v_j\) is adjacent to \(v_k\). Now we consider the eccentricity of \(v_k\) in G. If \(\mathrm{ecc}_G(v_k)=3\), then any vertex from \(V(C_n){\setminus } V(P)\) is adjacent to \(v_i\) or \(v_j\). However, this is impossible when \(n\ge 9\). Then we get \(\mathrm{ecc}_G(v_k)=4\). Without loss of generality, assume that \(i<j\) and \(v_i\) has a neighbor \(v_{i-1}\in V(C_n){\setminus } V(P)\) and \(v_j\) has a neighbor \(v_{j+1}\in V(C_n){\setminus } V(P)\). Let \(V_0=V(C_n){\setminus } \left( V(P)\cup \{v_{i-1},v_{j+1}\}\right) \). Since \(n\ge 9\), we have \(|V_0|\ge 2\) for \(|j-i|_n=4\) or \(|V_0|\ge 1\) for \(|j-i|_n=5\). Therefore any vertex in \(V_0\) must have eccentricity at least 4 in G. Moreover, when \(|j-i|_n=5\), \(v_{i-1}\) or \(v_{j+1}\) has eccentricity 4 in G. This contradicts the fact that G is a 3-ASC graph and we are done. \(\square \)

Fig. 14
figure 14

The graph G

Fig. 15
figure 15

The graph \(H_n\)

4.3 Trees of order n and diameter \(n-2\)

Now we turn to \(\theta _3(T)\) for trees T of order n and diameter \(n-2\). Any such tree can be obtained by attaching a pendant vertex to any non-pendant vertex of the path \(P_{n-1}\). Throughout this subsection let \(V(T)=\{v_1,\ldots ,v_n\}\) and \(E(T)=\{v_iv_{i+1}:\ i=1,\ldots ,n-2\}\cup \{v_kv_n\}\), where k is a fixed integer from \(\{2,\ldots , n-2\}\).

Lemma 4.5

If T is a tree of order \(n\ge 10\) and diameter \(n-2\), then \(\theta _3(T)\le 2\).

Proof

Based on the value of k introduced above we distinguish two cases.

Case 1 \(k=5\).

Let G be the graph obtained from \(T\cup P_2\), where \(P_2=xy\), by adding edges \(xv_i\), \(i\in \{1,2\}\cup \{7,\ldots , n-1\}\) and \(yv_j\), \(j\in \{1,4\}\cup \{10,\ldots , n-1,n\}\). Then it is straightforward to verify that G is a 3-ASC embedding graph of T where \(v_5,v_9\) are two diametrical vertices in G.

Case 2 \(k\ne 5\).

In this case we can construct a similar graph H as in Case 1, but now one more edge \(xv_n\) is added to H (except that \(yv_n\notin E(G)\) for \(k=6\) otherwise \(\mathrm{ecc}_G(y)=2\)). It is not difficult to check that H is a 3-ASC embedding graph of T with \(v_5,v_9\) being its unique diametrical vertices. \(\square \)

Lemma 4.6

If T is a tree of order \(n\ge 10\) and diameter \(n-2\), then \(\theta _3(T)\ge 2\).

Proof

Since T is clearly not a 3-ASC graph, it suffices to prove that \(\theta _3(T)>1\). Suppose on the contrary that there exists a 3-ASC embedding graph G of T with \(V(G)=V(T)\cup \{x\}\). We distinguish the following two cases.

Case 1 \(xv_n\notin E(G)\).

In this case \(v_n\) is pendant in G with \(v_kv_n\in E(G)\). Note that G is a 3-ASC graph. Then \(\mathrm{ecc}_G(v_n)=4\) and \(\mathrm{ecc}_G(v_k)=3\).

Suppose first that \(xv_k\in E(G)\). Let \(v_i\) be the vertex with \(d(v_n,v_i)=4\). Clearly, \(d_T(v_k,v_i)\ge 3\) and \(xv_i\notin E(G)\). If \(v_j\in V(T){\setminus } \{v_n,v_i\}\), then \(d_G(v_n,v_j)\le 3\) and \(d_G(v_i,v_j)\le 3\) and consequently \(d_G(v_k,v_j)\le 2\). Obviously, any vertex \(v_j\) \((j\ne n, i)\) with \(d_T(v_j,v_k)\ge 3\) must be adjacent to x in G. If \(d_T(v_i,v_k)>3\), then we get \(\mathrm{ecc}_G(x)=2\), which is impossible because of the 3-ASC property of G. Hence \(d_T(v_k,v_i)=3\) and without loss of generality we may assume that \(k<i\). First we claim that \(xv_s\in E(G)\) for any vertex \(v_s\) with \(s<k\). Otherwise, we have \(d_G(v_s,v_i)=4\). Then \(\mathrm{ecc}_G(v_s)\ge 4\), contradicting to the 3-ASC property of G. Since \(\mathrm{ecc}_G(x)=3\), any vertex in the \((v_i,v_k)\)-path except \(v_k\) has degree 2 in G. Then any vertex \(v_p\) with \(d_T(v_p,v_{k+2})>3\) has the property that \(d_G(v_{k+2},v_p)=4\). Clearly, \(\mathrm{ecc}_G(v_{k+2})\) and \(\mathrm{ecc}_G(v_p)\) are at least 4, contradicting the 3-ASC property of G, again.

Now we consider the subcase when \(xv_k\notin E(G)\). From \(\mathrm{ecc}_G(v_n)=4\), we find that there is at most one vertex \(v_p\) with \(d_G(v_n,v_p)=4\) and \(d_G(v_n,v_j)\le 3\) for any vertex \(v_j\) with \(j\ne p\). Considering that \(v_n\) is pendant in G, all vertices except \(v_p\) in T are at distance at most 2 from \(v_k\) in G. But, combining the fact that \(xv_k\notin E(G)\), we have \(d_G(v_j,v_k)\ge 3\) for any vertex \(v_j\) with \(d_T(v_j,v_k)\ge 3\) with \(j\ne p\). A contradiction occurs.

Case 2 \(xv_n\in E(G)\).

In this case we first assume that \(\mathrm{ecc}_G(v_n)=4\). Then \(\mathrm{ecc}_G(v_k)=3\) and there exists a vertex \(v_i\) with \(d_G(v_n,v_i)=4\), i.e., \(d_G(v_k,v_i)=3\) and \(d_G(x,v_i)=3\). If \(i=1\), we find that \(d_G(v_i,v_j)\ge 4\) for any vertex \(v_j\) with \(k+1\le j\le n-1\), which is impossible since G is a 3-ASC graph. By symmetry, \(i\ne n-1\). It follows that \(v_i\) has two neighbors \(v_{i-1}\) and \(v_{i+1}\) in T. Moreover, neither of \(v_{i-1}\) and \(v_{i+1}\) is adjacent to x in G.

Now we further consider the position of the vertex \(v_i\) in T. Clearly, \(d_G(v_i,v_k)=3\le d_T(v_i,v_k)\). If \(d_T(v_k,v_i)>3\), then, from \(d_G(x,v_i)=3\), we get \(d_G(v_i,v_k)\ge 4\), which is a clear contradiction. Thus \(d_T(v_k,v_i)=3\). If \(xv_k\notin E(G)\), then, assuming without loss of generality that \(k<i\), we find that \(d_G(v_k,v_{i+1})=4\), contradicting the 3-ASC property of G. Next we deal with the subcase when \(xv_k\in E(G)\). Note that \(n\ge 10\). There is at least one vertex \(v_j\) in T such that \(d_T(v_i,v_j)\ge 4\). Then in this subcase we have \(d_G(v_i,v_j)\ge 4\) whenever \(v_jx\in E(G)\) or not. A contradiction comes again.

We have thus proved that \(\mathrm{ecc}_G(v_n)=3\) must hold. Next we distinguish the following two subcases.

Subcase 2.1 \(xv_k\notin E(G)\).

In this subcase, we first prove \(\mathrm{ecc}_G(x)=3\). If not, then we have \(\mathrm{ecc}_G(x)=4\). Then x must lie on an induced cycle \(C_8\) of G where \(v_i\in V(C_8)\) with \(d_G(x,v_i)=4\), or on an induced \((x,v_i)\)-path with \(d_G(x,v_i)=4\) and \(v_i\) being pendant in G. In the former case, we can find at least one vertex \(v_j\in V(C_8)\) such that \(d_G(v_n,v_j)\ge 4\). This is a clear contradiction. In the latter case, we claim that \(v_i\) is the other diametrical vertex in G, that is, \(d_G(v_i,v_s)\le 3\) for any vertex \(v_s\) with \(1\le s\le n\). But this cannot be obeyed for any vertex \(v_s\) with \(d_T(v_s,v_i)>3\) for \(n\ge 10\).

Next we claim that \(\mathrm{ecc}_G(v_k)=3\) and assume that on the contrary \(\mathrm{ecc}_G(v_k)=4\). Then there is exactly one vertex, say \(v_i\), with \(d_G(v_i,v_k)=4\). Without loss of generality, assume that \(i>k\). Evidently, we have \(d_T(v_i,v_k)\ge 4\) and \(xv_i\notin E(G)\). Considering that \(\mathrm{ecc}_G(v_n)=\mathrm{ecc}_G(x)=3\), from the structure of G, we observe that \(d_G(x,v_i)=2\). From the fact that \(d_G(v_i,v_j)\le 3\) and \(d_G(v_k,v_j)\le 3\) for any vertex \(v_j\in V(T){\setminus }\{v_i,v_k\}\), we find that any vertex \(v_j\) with \(j\in \{m:\ m\le k-1,\ \text{ or }~ m\ge i+1\}\) must be adjacent to x in G.

If \(d_T(v_i,v_k)=4\), then \(i=k+4\). Clearly, \(xv_{k+2}\notin E(G)\). If not, we have \(\mathrm{ecc}_G(x)=2\), which is impossible. Since \(d_G(v_n,v_{k+3})\le 3\), we get \(xv_{k+3}\in E(G)\) from the fact that neither of \(v_{k+2}\) and \(v_{k+4}\) is adjacent to x in G. Moreover, we have \(xv_{k+1}\notin E(G)\). Otherwise, we get \(\mathrm{ecc}_G(x)=2\), which is impossible. Then \(v_{k+1}\) is just the eccentric vertex of x in G. Thus there must be a vertex \(v_j\) \((j\ne k+3,k+4)\) with \(d_T(v_k,v_j)\ge 3\) such that \(d_G(v_{k+1},v_j)=4\), a contradiction.

If \(d_T(v_i,v_k)>4\), we have \(xv_j\in E(G)\) for any vertex \(v_j\) with \(k+3<j<i\), since \(d_G(v_k,v_j)\le 3\). Moreover, neither of \(v_{k+1}\) and \(v_{k+2}\) is adjacent to x in G, for otherwise \(\mathrm{ecc}_G(x)=2\) would hold. But then \(d_G(v_i,v_{k+1})\ge 4\), a contradiction.

We have thus proved that \(\mathrm{ecc}_G(x)=\mathrm{ecc}_G(v_k)=3\). From \(\mathrm{ecc}_G(v_k)=3\) we find that \(xv_j\in E(G)\) for any vertex \(v_j\) with \(d_T(v_j,v_k)\ge 4\). Because \(\mathrm{ecc}_G(x)=3\), we infer that there exist three consecutive vertices, say \(v_{p-1},v_p,v_{p+1}\), such that they are at distance at most 3 to \(v_k\) and that none of them is adjacent to x in G. It implies that \(d_G(x,v_p)=3\). Since \(n\ge 10\), there are at least two vertices \(v_j\) with \(d_G(v_j,v_p)=4\), contradicting to the 3-ASC property of G.

Subcase 2.2 \(xv_k\in E(G)\).

In this subcase we first assume that \(\mathrm{ecc}_G(x)=3\). Then there exists a vertex \(v_i\) with \(d_G(x,v_i)=3\). We may again assume without loss of generality that \(i>k\). If \(v_i\) is pendant in G, then there are at least two vertices at distance at least 4 from \(v_i\) in G, contradicting to the 3-ASC property of G. If \(v_i\) is non-pendant in G, then there are three consecutive vertices \(v_{i-1}\), \(v_i\), \(v_{i+1}\), such that none of them is adjacent to x in G and \(d_G(x,v_i)=3\) with \(d_T(v_i,v_k)\ge 2\). If \(d_T(v_k,v_i)\ge 3\), we find that \(d_G(v_n,v_i)=4\), which is impossible because of \(\mathrm{ecc}_G(v_n)=3\). While \(d_T(v_i,v_k)=2\), for \(n\ge 10\), there exist at least two vertices \(v_p\) with \(d_T(v_i,v_p)\ge 4\) such that \(d_G(v_i,v_p)\ge 4\). This contradicts the 3-ASC property of G. So it follows that \(\mathrm{ecc}_G(x)=4\).

If \(\mathrm{ecc}_G(x)=4\), then there is a vertex \(v_p\) with \(d_G(x,v_p)=4\). Obviously, \(d_T(v_k,v_p)\ge 3\). Considering that \(v_n,v_k,x\) form a triangle in G, we get \(d_G(v_n,v_p)\ge 4\), the final contradiction. \(\square \)

Therefore Lemmas 4.5 and 4.6 immediately imply:

Theorem 4.7

If T is a tree of order \(n\ge 10\) and diameter \(n-2\), then \(\theta _3(T)=2\).

In Theorem 4.7 we did not consider trees of small order. Note that \(K_{1,3}\) is the unique tree of the smallest order of interest (that is, of order 4). For \(n=5\) there is also a unique tree of interest, while for \(n=6\) there are two non-isomorphic trees of diameter 4. Any of these trees is an induced subgraph of \(C_6^*\) which is in turn a smallest 3-ASC graph, hence we have the 3-ASC index for \(4\le n\le 6\). However, for \(7\le n\le 9\) the variety of the trees of interest becomes larger, hence the determination of the 3-ASC index for all of them would be too extensive to be done here.

5 Three open problems

We conclude the paper with three open problems. First, in view of Theorems 2.1 and 2.3 we pose the following very ambitious task:

Problem 5.1

For any given integer \(k\in [1, 5]\) characterize the graphs with \(\theta _3(G) = k\).

Next, in view of Lemma 3.2 and Theorems 3.33.7, it is natural to pose:

Problem 5.2

Characterize the graphs of diameter 2 with the 3-ASC index equal to 3 (equivalently, with the 3-ASC index equal to 4).

A classical result from random graph theory asserts that almost any graph has diameter 2, cf. Diestel (2006, p. 312, Exercise 7). Since by Lemma 3.2 the 3-ASC index of such a graph is either 3 or 4, our third problem reads as follows.

Problem 5.3

Is it true that the 3-ASC index of almost every graphs is 3 (resp. 4)?