The k -Metric Dimension of a Unicyclic Graph

: Given a connected graph G = ( V ( G ) , E ( G )) , a set S ⊆ V ( G ) is said to be a k -metric generator for G if any pair of different vertices in V ( G ) is distinguished by at least k elements of S . A metric generator of minimum cardinality among all k -metric generators is called a k -metric basis and its cardinality is the k -metric dimension of G . We initially present a linear programming problem that describes the problem of ﬁnding the k -metric dimension and a k -metric basis of a graph G . Then we conducted a study on the k-metric dimension of a unicyclic graph.


Introduction
Given a graph G = (V(G), E(G)), we say that a vertex v ∈ V(G) distinguishes two different vertices x, y ∈ V(G), if d G (v, x) = d G (v, y), where d G (a, b) denotes the length of a shortest a − b path. A set S ⊆ V(G) is said to be a k-metric generator for G if and only if for any pair of different vertices u, v ∈ V(G), there exist at least k vertices w 1 , w 2 , . . . w k ∈ S such that d(u, w i ) = d(v, w i ), for all i ∈ {1, . . . k}.
In other words, a set S ⊆ V(G) is a k-metric generator for G if and only if for any pair of vertices of G there exist at least k vertices in S that distinguish it. The k-metric dimension of G, denoted by dim k (G), is the minimum cardinality among all k-metric generator for G. Any k-metric generator with cardinality dim k (G) is called a k-metric basis of G.
These concepts were introduced, in the context of graph theory, by Estrada-Moreno et al. in [1], as a generalization of the well-known concept of metric dimension in graphs. In particular, for k = 1 is when these concepts correspond to the original theory of metric dimension introduced independently by Harary and Melter in [2] and Slater in [3]. However, the particular case of k = 2 had also been previously defined in [4]. Recent studies on the k-metric dimension of a graph can be consulted in [1,[5][6][7][8][9]. Independently of the aforementioned articles, k-metric dimension was studied in [10][11][12] with a computer science oriented approach. More recently, based on the generalization given for k-metric dimension, k-partition dimension was introduced in [13] as a generalization of partition dimension previously defined in [14].
The theory of the metric dimension of a space general metric space was introduced in 1953 in [15] and it was not until 20 years later that it attracted attention in the context of graph theory. Recently, the theory of metric dimension was developed further for general metric spaces in [16]. However, it was also generalized for the k-metric dimension in the context of general metric spaces in [17]. Again, in the context of graph theory, the concept of k-metric dimension was generalized for a more general metric than the standard distance in graphs in [18]. A particular case of this general metric, known as the adjacency distance, had already been studied previously in [19].
Metric generators for a graph, for the particular case of k = 1, were shown to have a high number of applications in real life. In particular, in those problems that can be represented as graphs and it is also necessary that each vertex be uniquely identified with respect to the rest of the vertices of the graph. Example of this kind of applications is the navigation of robots in networks [20]. However, it was shown in [1] that the metric generators, in their primary version, have a weakness for the case where some of the sensors located in the network, used to guide the robots, fail. Therefore, in order to guarantee that the robots are not lost within the network when one of their sensors fails, it is necessary to place the sensors on vertices that belong to k-metric generators, for some k > 1. The higher the value of k, the more security we provide to the network, but we may also incur additional costs. The k-metric generators, for k ≥ 3, have also been shown to have application in theory of error correcting codes which was presented in [21]. As k-metric generators are studied in depth, new applications of this concept of graph theory may emerge.
The problem of finding the k-metric dimension and a k-metric basis for a graph can be given in terms of an integer programming problem. Let G be a connected graph with Given a binary variable x i for 1 ≤ i ≤ n, we define the objective function F by The integer programming problem would then be minimizing F subject to the follow- Please note that the set S = {v i : x i = 1}, for any given assignment A to the n binary variables x i , is a k-metric generator for G if and only if the n 2 constraints are satisfied by A. Since |S| = F and F is minimum, we conclude that S is also k-metric basis of G and F is the k-metric dimension. The previous integer programming problem has been proven to be NP-hard in [9,22]. Even for a more general metric than standard distance in graphs, it has been proven in [18] that the problem is also NP-hard, for any odd k. Therefore, it would be convenient in order to solve the problem either to use approximate methods, such as heuristics or metaheuristics, or to determine closed formulae, or bounds, for the k-metric dimension of certain families of graphs. In this article, we work on the second of the research lines. However, presenting the original problem in terms of an integer programming problem can motivate researchers in the area of operations research to work on the first of the research lines in order to solve this problem mainly in graphs with a complex structure.
We present now some additional terminology and notation. If two vertices u, v are adjacent in G = (V(G), E(G)), then we write u ∼ v or we say that uv ∈ E(G). Given Two vertices x, y are twin if they are false twin vertices or true twin vertices. In this work, the remainder definitions will be introduced whenever a concept is needed.
A unicyclic graph is a connected graph containing exactly one cycle. This article is dedicated to the study of the k-metric dimension of unicyclic graphs. The paper is organised in the following way: Section 2 is devoted to the study of the values of k for which there is a k-metric basis for some unicyclic graphs while in Section 3, we obtain closed formulae for the k-metric dimension of some unicyclic graphs.

k-Metric Dimensional Graphs
In this section, we tackle the problem of finding the largest integer k such that there exists a k-metric generator for some unicyclic graphs. We say that a graph G is k-metric dimensional if k is the largest integer such that there exists a k-metric basis of G. Notice that if G is a k-metric dimensional graph, then for each positive integer r ≤ k, there exists at least one r-metric basis of G.
Next, we give a characterization of k-metric dimensional graphs. To do so, we need some additional terminology. Given two vertices x, y ∈ V(G), we say that the set of distinctive vertices of x, y is |D(x, y)|.
In particular, the case of cycles was analysed in the following result.

Proposition 1 ([1]
). Let C n be a cycle graph of order n. If n is odd, then C n is (n − 1)-metric dimensional and if n is even, then C n is (n − 2)-metric dimensional.
Although it has been shown in [9] that min x,y∈V(G) |D(x, y)| can be computed in polynomial time for any graph, it is sometimes interesting to consider this value for some particular cases of graphs.

k-Metric Dimensional Unicyclic Graphs
From now on, we consider some notations for a unicyclic graph G. Let C be the cycle of G, that is, the subgraph of G induced by the vertices that form the single cycle of G.
Let V(C) = {v 0 , v 1 , . . . , v s−1 } be the vertex set of C. In this context, we shall assume that v i ∼ v i+1 for every i ∈ {0, 1, . . . , s − 1}, where the subscripts are taken modulo s. Given v i ∈ V(C), we define T i (V i , E i ) as the tree rooted in v i , obtained by removing from G the two neighbours of v i belonging to C. Please note that a rooted tree, such as the one defined, may be trivial. A unicyclic graph G is said to be type 1 if the following conditions are satisfied: We said that G is type 2 if G is not a cycle and it is not type 1. In Figure 1, we show an example of each type of unicyclic graph. Let G be a unicyclic graph of type 1 with odd cycle C. We define the following and t i be the order of the tree T i rooted in v i ∈ U.
Let j be an integer such that 0 ≤ j ≤ min s − 1 2 , t i − 1 . We define the following sets for every v i ∈ V(C): From the previous sets we define the parameters Finally, we define Proposition 2. Any unicyclic graph of type 1 with odd cycle is η o -metric dimensional.
Proof. Let G be a unicyclic graph of type 1 with odd cycle and order n.
In this context, the subscripts that refer to the vertices of cycle C, as well as their respective rooted paths, will be taken modulo s. We now consider four cases: Recall that diameter of odd cycle C is s−1 2 . We consider two subcases for v i , u j,l : In this case d(u i,l , v l ) = i and d(u j,m , v m ) = j. Without loss of generality we assume that i ≥ j. We analyse the next subcases: We next discuss the case when G is a unicyclic graph of type 1 such that whose cycle C is even. To this end, we will introduce some parameters as we did with the case where C was odd: Please note that in this case v i and v i+ s Proposition 3. Any unicyclic graph of type 1 with even cycle is η e -metric dimensional.
Proof. Let G be a unicyclic graph of type 1 with even cycle and order n. Given v l ∈ U we consider V(T l ) = {u 0,l , . . . , u t l −1,l }, where v l = u 0,l and u i,l ∼ u i+1,l for 0 ≤ i ≤ t l − 2. We now consider three cases: . This case is analogous to Case 1 of Proposition 2.
Given v l ∈ U we consider two subcases for the pairs of the form v i , u j,l : Please note that i ∈ {l + t, l − t}. If j > t, then v i , u j,l are distinguished by elements of V(G) with at most the exception u j−t 2 ,l when t + j ≡ 0(2). Thus, if j > t, then either |D( In this case d(u i,l , v l ) = i and d(u j,m , v m ) = j. Without loss of generality we assume that i ≥ j. We analyse the next subcases: If i > d(v l , v m ) + j, then any vertex in V(G) distinguishes u i,l , u j,m with at most one exception given when d(

The k-Metric Dimension of Unicyclic Graphs
To begin this section, we present some results and definitions that were given previously in [1]. Later, in Section 3, we give some closed formulae for the unicyclic graphs that fulfil certain properties.
From the fact that every pair of vertices x, y is distinguished only by the elements of D(x, y), we deduce the following Lemma given in [1].
Next we give an important bound given in [1].
Now we introduce some definitions that will be useful to us to prove our next results. A vertex of degree at least three in a graph G will be called a major vertex of G. Any end-vertex (a vertex of degree one) u of G is said to be a terminal vertex of a major vertex v of G if d G (u, v) < d G (u, w) for every other major vertex w of G. The terminal degree ter(v) of a major vertex v is the number of terminal vertices of v. A major vertex v of G is an exterior major vertex of G if its terminal degree is positive. Let M(G) be the set of exterior major vertices of G whose terminal degree is greater than one.
Given w ∈ M(G) and a terminal vertex u j of w, we denote by P(u j , w) the shortest path that starts at u j and ends at w. Let l(u j , w) be the length of P(u j , w). Now, given w ∈ M(G) and the set of terminal vertices W = {u 1 , u 2 , . . . , u k } of w, we define l(w) = min u j ∈U {l(u j , w)}. Please note that by definition of exterior major vertex, P(u j , w, u r ) is obtained by concatenating the paths P(u j , w) and P(u r , w), where w is the only vertex of degree greater than two lying on these paths. Now we present a lower bound for the r-metric dimension of any k-metric dimensional graph. To do so, we first define the following function for any exterior major vertex w ∈ M(G) and any 1 ≤ r ≤ k.
In order to clarify the previous formula for the vertices that belong to the set M(G), we will use the graph G given in Figure 2. In this case, w 1 , w 2 are the only exterior major vertices with terminal degree at least two, and as a consequence, M(G) = {w 1 , w 2 }. In both cases these vertices have terminal degree 2, l(w 1 ) = 2 and l(w 2 ) = 1. Hence, The tightness of the previous bound is shown in [1] for the case of the tree different from path. We present, in Theorem 6, that this bound is reached for some unicyclic graphs.
Closed Formulae for the k-Metric Dimension of Some Unicyclic Graphs Proposition 4. Let C n be cycle graph of order n.

(i)
If n is even, then (ii) If n is odd, then • dim k (C n ) = k + 1 for every 1 ≤ k ≤ n − 1.
Proof. By Proposition 1, we have that if n is odd C n is (n − 1)-metric dimensional, otherwise C n is (n − 2)-metric dimensional. Thus, if n is odd, then dim k (C n ) exists for 1 ≤ k ≤ n − 1 and, if n is even, then dim k (C n ) exists for 1 ≤ k ≤ n − 2. On the other hand, by Theorem 2, we have that dim k (C n ) ≥ k + 1. We now consider two cases for computing dim k (C n ): Case 1. n is odd. For any pair of vertices u, v ∈ V(C n ) there exist only one vertex w ∈ V(C n ) such that w does not distinguish u and v. Hence, for every S ⊆ V(C n ) such that |S| = k + 1 and every pair u, v ∈ V(C n ) there exists at least k element of S which distinguish u, v. Thus, S is a k-metric generator for C n and, consequently, dim k (C n ) ≤ |S| = k + 1. Therefore, dim k (C n ) = k + 1. Case 2.
n is even. In this case, C n is 2-antipodal (The diameter of G = (V, E) is defined as We say that u and v are antipodal vertices or mutually antipodal if d G (u, v) = D(G). We recall that G = (V, E) is 2-antipodal if for each vertex x ∈ V there exists exactly one vertex y ∈ V such that d G (x, y) = D(G)). For any pair of vertices u, v ∈ V(C n ), such that d(u, v) = 2l, we can take a vertex x such that d(u, where x and y are antipodal vertices. On the other hand, if d(u, v) is odd, then D(u, v) = V(C n ). Now, we analyse two subcases: Since k < n 2 = D(C n ) there are no two antipodal vertices on P.
Thus, for any pair of vertices u, v ∈ V(C n ) there exists at most only one vertex w ∈ P such that w does not distinguish u and v. Therefore, P is k-metric generator for C n and, consequently, dim k (C n ) ≤ |P| = k + 1. Therefore, dim k (C n ) = k + 1.
that |S| = k + 1, there exist at least two antipodal vertices w 1 , w 2 , which leads there exist at least two vertices u, v which are not distinguish by w 1 , w 2 . Hence, if |S| = k + 1, then |S ∩ D(u, v)| < k, and as consequence, dim k (C n ) ≥ k + 2. On the other hand, since each pair of vertices of V(C n ) is distinguished by V(C n ) with at most the exception of two vertices, every S ⊆ V(C n ) such that |S | = k + 2, is a k-metric generator for C n . Therefore, dim k (C n ) ≤ |S | = k + 2, which implies dim k (C n ) = k + 2.
From now on, we assume that k ≥ 3. Keep the following facts in mind Let S be a k-metric basis of G. First, suppose that k is odd.
, then as we need to take at least k − 1 2 vertices of V(T 0 ) − {u 0 } for distinguishing at least k times the pairs v 1 , u 1 and v s−1 , u 1 , we conclude that dim(G) = , then at least I have to choose the r − 1 vertices in V(T 0 ) − {u 0 }, and at least k − 2r vertices of (D(v 1 , ) to distinguish at least k times the pairs v 1 , u 1 and v s−1 , u 1 , and consequently, dim(G) = |S | ≥ |R| + (r − 1) + (k − 2r) = 2k − r − 1. Now, suppose k is even. By an analysis analogous to the previous one, and considering |R ∩ D(v 1 , We now define the following sets for each case considered in our result: For k odd and r ≥ k − 3 2 , we consider (c) For k even and r ≥ k 2 , we consider (d) For k even and r < k 2 , we consider S 2 .
We claim, in the cases (a)-(d), that the respective sets previously defined are k-metric generator for G. In this context, we will consider S ∈ {S 1 , S 2 , S 3 } and we only make distinctions where necessary. We now analyse three cases: u i , u j ∈ V(T 0 ). These vertices are distinguished by the elements of V(G) with at most one exception. Assume that i < j. v i ∈ V(C) and u j ∈ V(T 0 ). Recall that diameter of cycle C is s−1 2 . We consider two subcases for the pairs of the form v i , u j : t=1 {v −t } and D(v s−1 , u 1 ) ⊆ D(v −j , u j ) for any j. Since |D(v 1 , u 1 ) ∩ S| ≥ k and |D(v s−1 , u 1 ) ∩ S| ≥ k, we conclude, each pair is distinguished by k elements of S.
In this case 1 ≤ t ≤ s−1 2 , i ∈ {−t, t} and 1 ≤ j ≤ r − 1. If we suppose j > t, then v i , u j are distinguished by elements of V(G) with at most one exception. This exception happens when t + j ≡ 0(2), where we have In any case v i , u j are distinguished by at least k elements of S.
Therefore, S, in each case, is a k-metric generator for G, and as a consequence, dim(G) ≤ |S|.
Theorem 5. Let G be a unicyclic graph of type 1 whose cycle C is of even order s. If there exists only one vertex v ∈ V(C) such that deg(v) = 3 whose rooted tree T is the order r, then for any k ∈ {1, 2, . . . , min{s − 2, if s ≥ 6, k is even and r ≥ k 2 , 2k − r otherwise.
From now on, we consider s ≥ 6 or k = 2. Keep the following facts in mind , then as we need to take at least k + 1 2 vertices of (V(T 0 ) − {u 0 }) ∪ {v s 2 } for distinguishing at least k times the pairs v 1 , u 1 and v s−1 , u 1 , we conclude that dim(G) = |S | ≥ |R| + k + 1 2 = 3k + 1 2 . If r < k + 1 2 , then at least I have to choose the r vertices ) to distinguish at least k times the pairs v 1 , u 1 and v s−1 , u 1 , and consequently, dim(G) = |S | ≥ |R| + r + (k − 2r) = 2k − r. Now, suppose k is even. By an analysis analogous to the previous one, and considering |R ∩ D(v 1 , if r ≥ k 2 , then dim(G) = |S | ≥ 3k 2 , otherwise dim(G) = |S | ≥ 2k − r. We now define the following sets for each case considered in our result: For k odd and r ≥ k +
(d) For k even and r < k 2 , we consider S 2 .
We claim, in the cases (a)-(d), that the respective sets previously defined are k-metric generator for G. In this context, we will consider S ∈ {S 1 , S 2 , S 3 } and we only make distinctions where necessary. We now analyse three cases:    {v −t } and D(v s−1 , u 1 ) ⊆ D(v −j , u j ) for any j. Since |D(v 1 , u 1 ) ∩ S| ≥ k and |D(v s−1 , u 1 ) ∩ S| ≥ k, we conclude, each pair is distinguished by k elements of S. Therefore, S, in each case, is a k-metric generator for G, and as a consequence, dim(G) ≤ |S|. Therefore, dim r (G) ≤ |S| = ∑ w∈M(G) I r (w), and the result follows.

Conclusions and Open Problems
This article is a contribution to the theory k-metric dimension in graph. In particular, we study this invariant for unicyclic graph. In our study, we obtain closed formulae to determine the largest value of k for which there is a k-metric generator of a unicyclic graph of type 1. Finally, we give closed formulae for k-metric dimension of unicycle graphs of type 1 with a single vertex of degree three and for unicycle graphs of type 2 with at least three transcendental vertices and that satisfy a specific property for those vertices of the cycle with degree 3 and whose rooted tree is a path. Some open problems have emerged from the study carried out. For instance, we highlight the following.

(a)
It would be interesting to characterize all graphs that satisfy the formula given in Theorem 6. For instance, the graph in Figure 2 satisfies this formula, however it does not satisfy the premises given in Theorem 6.
We gave a closed formula for the k-metric dimension of a particular family of unicyclic graphs of type 1. Therefore, it would be convenient to see if it is possible to obtain closed formulae or to be able to bound the k-metric dimension of the rest of the unicyclic graphs of type 1. (c) Since the optimization problem of finding k-metric dimension is NP-hard, it would be interesting to devise polynomial-time algorithm for families of unicyclic graphs or to develop heuristics that allow estimating as accurately as possible this parameter for these families.
Funding: This research received no external funding.
Institutional Review Board Statement: Not applicable.

Informed Consent Statement: Not applicable.
Data Availability Statement: Not applicable.

Conflicts of Interest:
The author declares no conflict of interest.