New resolvability parameters of graphs

In this paper we introduce two concepts related to resolvability and the metric dimension of graphs. The k th dimension of a graph G is the maximum cardinality of a subset of vertices of G that is resolved by a set S of order k . Some first results are obtained. A pair of vertices u , v is totally resolved by a third vertex x if d ð u , x Þ 6¼ d ð v , x Þ : A total resolving set in G is a set S such that each pair of vertices of G is totally resolved be a vertex in S. The total metric dimension of a graph is the minimum cardinality of a total resolving set. We determine the total metric dimension of paths, cycles, and grids, and of the 3-cube, and the Petersen graph.


Introduction
In 1975 Slater [8] introduced the notion of the location number of a graph. In 1976 Harary and Melter [5] independently introduced the same notion, which they called the metric dimension of a graph. The latter terminology has become the standard in the literature, see e.g., [1][2][3][4]. Many papers have been written on the metric dimension of a connected graph since 1976. Let G be a connected graph. A vertex x is said to resolve a pair u, v of two vertices if the distances from x to u and v satisfy dðx, uÞ 6 ¼ dðx, vÞ: A set S is said to resolve a set T in G if each pair of vertices in T is resolved by some vertex x in S. If T is the vertex set V of G, then S resolves G. The metric dimension of G is the minimum cardinality of a resolving set of G.
The aim of this paper is to present two new parameters that are related to the metric dimension of a graph. The first one is the kth dimension of a connected graph. In this case we fix the order k ¼ jSj of a set S, and we seek maximal sets that are resolved by S. The lower kth dimension equals the minimum cardinality of a maximal set that is resolved by a set S of order k, and the upper kth dimension equals the maximum cardinality of set T that can be resolved by a set S of order k.
So far, in the definition of resolving a pair of vertices, a vertex u always resolves the pair u, v, since dðu, uÞ ¼ 0 < dðu, vÞ: Hence, a set S always resolves the set S. In our second new parameter, we require that the resolving vertex x is always distinct from the vertices in the pair u, v. In this case we say that x totally resolves the pair u, v. The total metric dimension of a graph G equals the minimum cardinality of a set S that totally resolves the vertex set V of G. This new concept of resolvability is similar to the notion of total domination versus domination. A big difference between the metric dimension is that the total metric dimension is not always defined, in the same way that the total domination number is not always defined.
We determine the total metric dimension of paths and cycles. We determine the total metric dimension of the 3cube Q 3 , and pose the determination of the total metric dimension of Q n , with n ! 4 as an open problem. We also determine the total metric dimension of the Petersen graph, and of the grid graphs. In all these instances the differences between the usual metric dimension and this new total metric dimension become clear.

Preliminaries
Let G ¼ ðV, EÞ be a graph of order n ¼ jVj: The open neighborhood of a vertex v 2 V is the set NðvÞ ¼ fujuv 2 Eg of vertices adjacent to v. Each vertex u 2 NðvÞ is called a neighbor of v. The closed neighborhood of a vertex v 2 V is the set N½v ¼ NðvÞ [ fvg: The open neighborhood of a set S V of vertices is NðSÞ ¼ [ v2S NðvÞ, while the closed neighborhood of a set S is the set N½S ¼ [ v2S N½v: Let d(u, v) denote the minimum length of a path (the distance), between vertices u and v. The eccentricity of a vertex x 2 V is defined as eccðxÞ ¼ maxfdðx, vÞjv 2 Vg: The diameter of G equals diamðGÞ ¼ maxfeccðvÞjv 2 Vg, and the radius of G equals radðGÞ ¼ minfeccðvÞjv 2 Vg: A set S V is a dominating set in G if N½S ¼ V, that is, every vertex w 2 V À S is adjacent to at least one vertex in S. The minimum cardinality of a dominating set in G is called the domination number of G, denoted cðGÞ: A set S V is a total dominating set if N(S) ¼ V, that is, every vertex w 2 V is adjacent to a vertex v 2 S with v 6 ¼ w: The minimum cardinality of a total dominating set in G is the total domination number, denoted c t ðGÞ: A set S V is called independent if no two vertices in S are adjacent. The vertex independence number aðGÞ equals the maximum cardinality of an independent set in G.
Let S ¼ fv 1 , v 2 , :::, v k g be an ordered set of k vertices in a connected graph G ¼ ðV, EÞ, and let w 2 V be an arbitrary vertex. The metric representation of w with respect to the set S is the (ordered) k-vector rðwjSÞ ¼ ðdðw, v 1 Þ, dðw, v 2 Þ, :::, dðw, v k ÞÞ: A set S is said to be a resolving set for G if no two vertices in V have the same metric representation, with respect to S. The minimum cardinality of a resolving set for G is called its metric dimension and is denoted dim(G).
It is worth pointing out that for any set S & V, any two vertices v i , v j 2 S have distinct metric representations with respect to S, that is, rðv i jSÞ 6 ¼ rðv j jSÞ because dðv i , v i Þ ¼ 0 6 ¼ dðv j , v i Þ > 0: And for the same reason, the metric representation of any vertex in S is different than the metric representation of any vertex in V -S. Thus, in order to determine if a set S is a resolving set, one only has to check that every pair of distinct vertices in V -S have distinct metric representations with respect to S.
An equivalent definition of the metric dimension of a graph G can be given as follows. A vertex x 2 V in a connected graph G is said to resolve two vertices u, v 2 V if dðu, xÞ 6 ¼ dðv, xÞ; we denote this x " u, v: It follows from this definition that for any vertex x 2 S, and any vertex v 2 V À fxg, x " x, v: A set S & V resolves a set T & V, denoted S " T, if for every two vertices u, v 2 T there exists a vertex x 2 S such that x " u, v: Note that according to this definition, every set S resolves itself and all subsets S 0 S: Proposition 1. For any connected graph G ¼ ðV, EÞ and any set S V, S " S: A set S & V is a resolving set for G, if S " V, that is, if for every two distinct vertices u, v 2 V, there exists a vertex x 2 S, such that x " u, v: The metric dimension dim(G) equals the minimum cardinality of a resolving set S for G. Such a minimum cardinality resolving set is called a metric basis for G. This concept was first introduced by Slater [8] in 1975, who called a resolving set a locating set, and the metric dimension of G the location number loc(G). This concept was independently introduced by Harary and Melter [5] in 1976, who used the term "metric dimension". By now there exists a considerable literature on resolvability and the metric dimension of a graph, see e.g., [2][3][4].
A resolving set S for a connected graph G is said to be minimal if no proper subset of S is a resolving set for G. Note that the property of being a resolving set is superhereditary, which means that every superset of a resolving set is also a resolving set. In addition, the property of not being a resolving set is hereditary, that is, each subset of a nonresolving set is also a non-resolving set. Hence, in order to determine if a resolving set is minimal, all you have to do is to check that S À fvg is a not resolving set, for every v 2 S: The maximum cardinality of a minimal resolving set for a connected graph G is called the upper metric dimension of G and is denoted dim þ ðGÞ: The upper metric dimension was introduced by Chartrand, Poisson, and Zhang [2] in 2000. It follows from the definitions that for any connected graph G, dimðGÞ dim þ ðGÞ: In [2] it is shown that for every positive integer k, there exists a connected graph G for which dim þ ðGÞ À dimðGÞ ! k: The authors were not able to prove the following: Conjecture [Chartrand, Poisson, Zhang]. For every pair a, b of positive integers with 2 a b, there exists a connected graph G for which dim(G) ¼ a and dim þ ðGÞ ¼ b: In the following sections we introduce several new parameters, all stemming from the concept of a resolving set and the definition of the metric dimension of a graph.

The upper and lower kth dimension of a graph
A third, and still equivalent, definition of metric dimension can be given as follows. The (metric) upper dimension Dim(x) of a vertex x 2 V equals the maximum cardinality of a set S V such that x " u, v: for any pair of distinct vertices u, v 2 S: Thus, DimðxÞ ¼ maxfjSjjS V and x " Sg: Similarly, we can define the lower dimension dim(x) of a vertex v to equal the minimum cardinality of a maximal set S such that x " u, v, for any pair of distinct vertices u, v 2 S: Proposition 2. For any vertex x in a connected graph G, dimðxÞ ¼ DimðxÞ ¼ 1 þ eccðxÞ: Proof. Let x be a vertex in G, and let S be a set of maximum cardinality such that x " S: It follows that no two vertices u, v 2 S can be at the same distance from x, else dðx, uÞ ¼ dðx, vÞ, and therefore x does not resolve S. By definition, there can be at most 1 þ eccðxÞ distinct distances from vertices in V to x. Thus, DimðxÞ 1 þ eccðxÞ: Let u be any vertex for which dðx, uÞ ¼ eccðxÞ, let x, u 1 , u 2 , :::u eccðxÞ ¼ u be a shortest path from x to u, and let S be the set of vertices on this path. Then clearly x " S, and jSj ¼ 1 þ eccðxÞ: Thus, DimðxÞ ! 1 þ eccðxÞ: Similarly, let S be a maximal set of minimum cardinality such that x " S, that is, dimðxÞ ¼ jSj: Define for x, the 1 þ eccðxÞ sets X i , where for every vertex w 2 X i , dðx, wÞ ¼ i, for 0 i eccðxÞ: By definition jS \ X i j 1, and if there exists a j such that S \ X j ¼ ;, then S is not a maximal set. Thus, jSj ¼ 1 þ eccðxÞ: w Definition 1. For any connected graph G, the upper k-th dimension Dim k ðGÞ of G equals the maximum cardinality of a set T & V such that there exists a set S of cardinality k and S " T: The lower k-th dimension dim k ðGÞ of G equals the minimum cardinality of a maximal set T & V such that there exists a set S of cardinality k and S " T: Such a set T is called a dim kset of G, while the set S is called a dim k -resolving set for T.
Notice from the definitions that if a set T is a dim k -set of G and the set S is a dim k -resolving set for T, then it must follow that S T, since if S " T then by definition S " T [ S: The following inequalities are easily established.
Proposition 3. For any connected graph G of order n, k Dim k ðGÞ Dim kþ1 ðGÞ n: 3.1. The first dimension of a graph We determine the first dimension of a connected graph in terms of its diameter and radius.

4.
For any connected graph G, Dim 1 ðGÞ ¼ 1 þ diamðGÞ: Proof. Let x be a vertex for which eccðxÞ ¼ diamðGÞ, let u d be a vertex for which dðx, u d Þ ¼ diamðGÞ, let x, u 1 , u 2 , :::u d be a shortest path of length d ¼ diamðGÞ from x to u d , and let S be the set of vertices on this path. Then, clearly x " S, and therefore, Dim 1 ðGÞ ! 1 þ diamðGÞ: To show that Dim 1 ðGÞ 1 þ diamðGÞ, let x be a vertex for which DimðxÞ ¼ Dim 1 ðGÞ, and let S(x) be a largest set, such that x " SðxÞ: Clearly no two vertices, say u and v in S(x) can be at the same distance from x, else x cannot resolve the pair u, v. There can be at most 1 þ diamðGÞ distinct distances from any vertex in V to all vertices in V. Thus, jSðxÞj 1 þ diamðGÞ: w In like manner, by selecting a vertex x such that eccðxÞ ¼ radðxÞ, one can prove the following; we omit the proof.

The second dimension of a graph
Proposition 4 asserts that the upper first dimension of a connected graph is 1 plus its diameter. This raises the following question: Question 1. Can you characterize the upper second dimension Dim 2 ðGÞ of a connected graph G?
A partial answer to this question follows from the definitions.
Proposition 6. For any graph G of order n ! 2, dim(G) ¼ 2, if and only if Dim 2 ðGÞ ¼ n.
Corollary 7. For any cycle C n , Dim 2 ðC n Þ ¼ n: Proof. It is well known that for any cycle C n , dimðC n Þ ¼ 2, since any pair of adjacent vertices in a cycle is a resolving set for C n . w It should be pointed out that in general, dim 2 ðC n Þ < Dim 2 ðC n Þ is possible. For example, we have just pointed out that Dim 2 ðC 6 Þ ¼ 6, since any pair of adjacent vertices of C 6 is a resolving set for S ¼ VðC 6 Þ: However, any set of two antipodal vertices of C 6 , that is, any two vertices u, v, for which dðu, vÞ ¼ 3 in C 6 , is a set that can only resolve four vertices, and any such set of four vertices is a maximal resolving set for such a pair u and v. This shows that dim 2 ðC 6 Þ ¼ 4 < Dim 2 ðC 6 Þ ¼ 6: Corollary 7 leads us to ask, what is dim 2 ðC n Þ? We answer this question in the next two results. Recall that an internal vertex on a path is a vertex that is not one of the ends of the path.
Proposition 8. For any cycle C 2kþ1 of odd order, Proof. Let S ¼ fu, vg be a set of two vertices in C 2kþ1 : From the proof of Corollary 7 we know that if u is adjacent to v then S " VðC 2kþ1 Þ: Next let u and v not be adjacent. Let P 1 and P 2 be the two edge-disjoint paths between u and v on the cycle C 2kþ1 : It is easy to see that S " VðP 1 Þ and S " VðP 2 Þ: Therefore, let x be an internal vertex of P 1 , and let y be an internal vertex of P 2 . We will show that S " fx, yg: We can assume, without loss of generality, that P 1 is shorter than P 2 . This implies that the distances d(u, x) and d(v, x) are the lengths of the subpaths of P 1 between the respective vertices. Suppose that dðx, uÞ ¼ dðy, uÞ: Then it follows that dðx, yÞ ¼ dðx, uÞ þ dðu, yÞ ¼ 2dðx, uÞ: Now we compare d(v, x) and d(v, y). The value of d(v, y) depends on the length of the two paths between v and y in C 2kþ1 : One of these contains both x and u. If this one is the shorter of the two, then, obviously, we have dðv, xÞ < dðv, yÞ, so dðv, xÞ 6 ¼ dðv, yÞ: If the other (v,y)-path is the shorter one, then dðv, xÞ þ dðv, yÞ ¼ 2k þ 1 À dðx, uÞ À dðu, yÞ ¼ 2k þ 1 À2dðx, uÞ, which is odd. So again we get dðv, xÞ 6 ¼ dðv, yÞ: In both cases it follows that S " fx, yg: Otherwise, we have dðu, xÞ 6 ¼ dðu, yÞ, in which case S " fx, yg trivially. w Proposition 9.
For any cycle C 2k of even order, dim 2 ðC 2k Þ ¼ k þ 1: Proof. Let S ¼ fu, vg be any two vertices on the cycle C 2k such that dðu, vÞ ¼ k, and let P 1 and P 2 be the two edge-disjoint paths between u and v on the cycle C 2k : By definition, jVðP 1 Þj ¼ jVðP 2 Þj ¼ k þ 1: It follows that S " T ¼ VðP 1 Þ: It also follows that the set T is a maximal set resolved by S of order k þ 1.
Next let S ¼ fu, vg consist of two vertices of C 2k with dðu, vÞ ¼ m < k: Let Q 1 and Q 2 be the two edge-disjoint paths between u and v on the cycle, with Q 1 of length m and Q 2 of length 2k À m ! k þ 1: It is easy to see that S " VðQ 2 Þ: So S resolves at least k þ 2 vertices.
Thus we have shown that the smallest maximal set that is resolved by two vertices is of order k þ 1. We know of course, for any graph G, that 1 þ diamðGÞ ¼ Dim 1 ðGÞ Dim 2 ðGÞ n: But, are there better bounds? For the case of trees see [7].

The computational complexity of the second dimension of a graph
Question 3. Can the second dimension of a connected graph be computed in polynomial time?
We present some observations that might be a first step in answering this question.
For any pair u, v of vertices, define Dimðu, vÞ ¼ maxfjTjjT V and fu, vg " Tg: The upper second dimension of a connected graph G is therefore Let D(G) be the n-by-n distance matrix of a connected graph G ¼ ðV, EÞ, where Dði, jÞ ¼ Dðj, iÞ ¼ dðv i , v j Þ, and consider any two vertices v i , v j 2 V: We seek to determine Dimðv i , v j Þ, that is, the maximum cardinality of a set T V such that fv i , v j g " T: Consider the ith and jth rows of the matrix D and construct the following graph Gði, jÞ ¼ ðV, Eði, jÞÞ: Two vertices v x and v y , for 1 x < y n, are adjacent in then v x and v y cannot both be in T.
Proposition 10. For any connected graph G, and any two vertices v i , v j in V, Proof. Let T V be an independent set of maximum cardinality aðGði, jÞÞ in G(i, j). Since no two vertices in T are joined by an edge in G(i, j), it follows that for every pair Conversely, let T V be a maximum cardinality set such that fv i , v j g " T: Thus, Dimðv i , v j Þ ¼ jTj: It follows that for between v x and v y in G(i, j). Thus, the set T must be an independent set in G(i, j). Therefore, by definition, Dimðv i , v j Þ ¼ jTj aðGði, jÞÞ: w Corollary 11. For any connected graph G, It is well known that the decision problem corresponding to the independence number aðGÞ of a graph is NP-complete. However, we do not know whether this decision problems remain NP-complete, when it is restricted to such graphs G(i, j). We leave this as an open problem.
We conclude this section with a simple observation on the relation between the kth upper dimensions of a graph (k ! 1) and its metric dimension.
Proposition 12. For any connected graph G of order n, dimðGÞ ¼ minfkjDim k ðGÞ ¼ ng: Proof. Let k be a smallest integer for which there exists a set S with jSj ¼ k and S " V: Then, by definition, dimðGÞ k ¼ minfkjDim k ðGÞ ¼ ng: Conversely, let S be a smallest set in G such that S " V, that is, by definition, dimðGÞ ¼ jSj: Then minfkjDim k ðGÞ ¼ ng jSj ¼ dimðGÞ:

Total metric dimension
A fourth, and still equivalent, definition of the metric dimension can be given as follows.
The external metric dimension xdim(G) equals the minimum cardinality of an external resolving set S in G; such a minimum cardinality external resolving set is called an external metric basis for G. Since every resolving set S for G is by definition an external resolving set, it follows that for any graph G, xdimðGÞ dimðGÞ: However, the following is true.
Proposition 13. For any graph G, xdimðGÞ ¼ dimðGÞ: Proof. It follows from the definitions that every resolving set S for G is automatically a resolving set for V -S. It only remains to show that the converse is true: every resolving set S for V -S is a resolving set for V, and therefore, for G. This follows from the previous observation above that any two vertices u, v 2 S have distinct metric representations with respect to S, since dðu, uÞ ¼ 0 < dðv, uÞ: Furthermore, the same statement applies to any vertex u 2 S and any vertex v 2 V À S: w The property of being a resolving set for V -S is, therefore, the same as being a resolving set for V. However, this V -S versus S difference becomes clearer if we make a minor, but significant change in the definition.
Consider the following reworded definitions of a dominating set and a total dominating set of a graph G. A set S V is a dominating set of a graph G if for every vertex v 2 V there exists a vertex u 2 S such that u dominates v, or u is adjacent to v. Notice that we assume that a vertex v dominates itself, and therefore if v 2 V is in fact a vertex v 2 S V, then we may choose vertex v 2 S so that v dominates v. But in total domination we cannot choose a vertex to dominate itself.
A set S V is a total dominating set of a graph G if the set S totally dominates the set V, that is, for every vertex v 2 V there exists a distinct vertex u 2 S such that u dominates v, that is, v is a neighbor of u. This implies that u 6 ¼ v: We can make the same distinction with regard to a vertex u resolving a pair of vertices v, w. Recall the definition, a set S is a resolving set of a graph G if, for every pair of distinct vertices v, w 2 V, there exists a vertex u 2 S, such that u resolves v, w, or u " v, w: Notice that we assume that a vertex resolves itself and any other vertex, thus, u " u, v: A total dominating version of resolving is total resolving. Definition 2. A vertex u 2 S in a connected graph G totally resolves two distinct vertices v, w 2 V, denoted u 0 v, w, if dðu, vÞ 6 ¼ dðu, wÞ and v 6 ¼ u 6 ¼ w: It no longer follows from this definition that for any vertex u 2 S, and any distinct vertex v 2 V À fug, u 0 u, v, since all three vertices must be distinct.
Definition 3. A set S V totally resolves a set T V, denoted S 0 T, if, for every two distinct vertices v, w 2 T, there exists a distinct third vertex u 2 S such that u 0 v, w: Note that according to this definition, it is not necessarily true that every set S totally resolves itself and all subsets S 0 & S: Definition 4. A set S V is a total resolving set or a TRS for G, if S 0 V, that is, if for every two distinct vertices v, w 2 V, there exists a distinct third vertex u 2 S, such that u 0 v, w: The total metric dimension dim t ðGÞ equals the minimum cardinality of a total resolving set S for G; a minimum cardinality total resolving set is called a total metric basis for G. It follows from these definitions that for any graph G of order n, dimðGÞ dim t ðGÞ: This inequality raises the following question.
Question 4. For which connected graphs G do we have dim t ðGÞ ¼ dimðGÞ?
Notice, first of all, that by definition, if S is a TRS of a graph G, then jSj ! 3: Thus, if a graph G of order n has a TRS, then 3 dim t ðGÞ n: The next lemma follows immediately from the definition, but is quite helpful in the sequel.
Lemma 14. If a connected graph G has a total resolving set S of order 3, then the distances between the three pairs in S are all different.

w
A few examples will serve to illustrate the properties of total resolving sets. Notice next that not all graphs have a TRS. These include complete graphs K n with n ! 3, and all graphs having a vertex that is adjacent to two or more leaves. This observation immediately raises the following two questions.
Question 5. Can you characterize the family of graphs having a TRS? Question 6. What is the complexity of the following decision problem? TOTAL RESOLVING SET Instance: a graph G ¼ ðV, EÞ Question: does G have a TRS?

Paths and cycles
For convenience, let us assume that the vertices of the path P n of order n are simply labeled 1, 2, 3, :::, n: Clearly, the three pairs of vertices in the path P 3 of order 3 do not have different distances. So, by Lemma 14, it does not have a TRS.
Proposition 15. For any n ! 4, dim t ðP n Þ ¼ 3: Proof. We show that the set S ¼ f1, 2, 4g is a TRS. It is easy to see that for every 2 u < v n, we have 1 0 u, v, since dð1, uÞ < dð1, vÞ: This only leaves the following vertex pairs to be totally resolved, as follows: 4 0 1, 2; 4 0 1, 3; and 2 0 1, v, for all v ! 4: w Vertex 1 resolves each pair in the path P n , so dimðP n Þ ¼ 1, for all n.
Again, for convenience, let us assume that the vertices of the cycle C n of order n are labeled in circular order 1, 2, 3, :::, n, 1: Again by Lemma 14, it is obvious that the cycle C 3 of order 3 does not have a TRS.

Proposition 16. The cycle C 4 does not have a TRS:
Proof. No pair of non-adjacent vertices can be totally resolved. Hence there is no TRS in C 4 . w Proposition 17. dim t ðC n Þ ¼ 4, for n ¼ 5 or 6.

The 3-cube Q 3
Observe that the property of being a total resolving set is superhereditary, similar to the case of resolving set, that is, every superset of a total resolving set is also a total resolving set. This implies that a total resolving set S is minimal if and only if for every vertex x 2 S, the set S À fxg is not a total resolving set. It follows therefore, that every vertex x in a minimal (total) resolving set must (totally) resolve some pair of vertices u, v that is not (totally) resolved by any other vertex in S, that is x " u, v: We speak of such a pair u, v as a private (total) resolving pair for vertex x, or a private pair, for short.
The n-cube Q n is the graph whose vertices correspond 1to-1 with all possible n-tuples of 0 s and 1 s, such that two vertices are adjacent if and only if the corresponding ntuples differ in exactly one position. It has many nice properties, amongst which are abundant symmetries and automorphisms. We will use this without mention. The 3-cube Q 3 is the well-known 3-dimensional cube having order 8. Note that the minimal resolving sets in Q 3 are the 3-sets that induce either a path of three vertices or three independent vertices. So dimðQ 3 Þ ¼ 3: Proposition 19. For the 3-cube, dim t ðQ 3 Þ ¼ 6: Proof. In Figure 1 we see the three types of sets of order 6 in Q 3 depicted as the gray vertices. In Case (A), the two vertices not in the set have distance 3. In Case (B), they have distance 1, and in Case (C), they have distance 2. In Case (C), the pair a, b is not resolved by any other gray vertex. So this set of six vertices is not a TRS.
We will show that the sets in Cases (A) and (B) are minimal total resolving sets. Since any set of 7 or 8 vertices contain a set of type (A), such sets are not minimal total resolving sets. Moreover any set of 5 vertices is contained in a set of type (A) or type (B). Thus it will follow that the sets of type (A) and (B) are precisely the minimal total resolving sets of Q 3 .
First we show that the sets are total resolving sets. Note that, since Q 3 is bipartite, any pair of vertices at odd distance is resolved by any other vertex. So one only needs to check vertices at distance 2. Note that, for any vertex u of Q 3 , there is a unique vertex u 0 at distance 3, its antipodal vertex. Clearly, u 0 totally resolves any pair containing u.
In Case (A), the antipodal vertex of a gray vertex is again a gray vertex. Any pair u, v at distance 2 contains a gray vertex, so the antipodal vertex of this gray vertex totally resolves this pair.
In Case (B), there are two different types of gray vertices: vertices of degree 2, of which the antipodal vertex is also gray, and vertices of degree 3, of which the antipodal vertex is white. Any pair u, v at distance 2 containing a gray vertex u of degree 2 is totally resolved by u 0 : So we only need to check pairs u, v at distance 2 such that u is a gray vertex of degree 3, and v is a white vertex. Now the antipodal vertex v 0 of v is a gray vertex, and totally resolves u, v.
To show that each gray vertex has a private resolving pair, we have indicated for each type of vertex u such a pair u 1 , u 2 . In Case (A), there is only one type of vertex indicated as x. In Case (B), there are two types of vertices indicated as x and y.
Thus we have shown that the sets in Cases (A) and (B) are minimal total resolving sets, which concludes the proof. w Since Q 2 ¼ C 4 , the 2-cube does not have a TRS.
Question 7. Can you determine dim t ðQ n Þ, for n > 3?

The Petersen graph
Next consider the Petersen graph P: We take the Petersen graph in its usual drawing, with an outer 5-cycle and an inner 5-cycle, and a connecting matching, see Figure 2. The Petersen graph has many symmetries and automorphisms. For instance, we may take any 5-cycle as the outer cycle, whereby the remaining five vertices form the inner cycle. We make use of this fact when we visualize the arguments in the proof below. Since the distances between two distinct vertices in the Petersen graph are either 1 or 2, a vertex x totally resolves a pair x 1 , x 2 if and only if x is adjacent to one of the two and not adjacent to the other. We use these facts below in the proof without mention. We denote the path of order n by P n .
First we observe that dimðPÞ ¼ 3: Take a P 3 on the outer cycle, say, with ends u and v, and middle vertex z. Now let S ¼ fu, v, wg, where w is a vertex on the inner cycle that is not adjacent to u, v, or z. It is easy to see that S is a resolving set. Moreover, no 2-set in P is a resolving set.
Proposition 20. For the Petersen graph P, dim t ðPÞ ¼ 5: Proof. Let S be a set of at least three vertices in P, and let P½S be the subgraph of P induced by S. A pair of independent vertices in P½S is not resolved by any other vertex in S. If P 2 is a component in P½S, then the pair of ends of this P 2 is not resolved by any other vertex in S. If P 3 is a component in P½S, then again the pair of ends of this P 3 is not resolved by any other vertex in S. If K 1, 3 is a component in P½S, then no pair of leaves of this K 1, 3 is resolved by any other vertex in S. Finally, assume that P 4 is a component in P½S: Then this P 4 is part of a 5-cycle in P: We may take this 5-cycle as the outer cycle in P, see Figure 2(A). Here we also have indicated a pair u and v that is not resolved by any other vertex of this P 4 . Thus we have shown that no 4-set in P can be a total resolving set. Hence dim t ðPÞ ! 5: To show that dim t ðPÞ ¼ 5, we have to exhibit a 5-set that is a TRS. A candidate is the 5-cycle in Figure 2(B). Note that the pair u, v that was not resolved in the case of the P 4 is now resolved by x. So it is a private pair for x. By symmetry, each vertex on the 5-cycle has a private pair.
To totally resolve a pair, we need to find a vertex that is adjacent to one, but not to the other. We list the different types of pairs that we have to check. There are four types of non-mixed pairs: two adjacent white vertices, two nonadjacent white vertices, two adjacent gray vertices, two nonadjacent gray vertices. There are three types of mixed pairs, one with the white vertex adjacent to the gray vertex, one with the white vertex adjacent to a neighbor of the gray vertex, and finally, one with the white vertex not adjacent to a neighbor of the gray vertex. In each case we easily find a totally resolving gray vertex. w In Figure 3 we depict the two other 5-sets that form a TRS in the Petersen graph: A P 4 with an independent vertex, and a P 5 . We omit the proof that these 5-sets are a TRS. By only considering the various types of pairs of vertices it is possible to check that they are indeed a TRS within reasonable time. In the case of the P 5 , it is easier to check all pairs by using a different, fairly common drawing of the Petersen graph, see Figure 3(B). It is easier to show that the three other possible 5sets do not form a TRS. In two cases a P 2 or a P 3 appears as component. In the third case, the subgraph induced by the set is connected: it is a tree on five vertices with on vertex of degree 3. The vertex of degree 3 has two leaves, which are not resolved by any other vertex of the tree.

The grids P m wP n
Let G 1 ¼ ðV 1 , E 1 Þ and G 2 ¼ ðV 2 , E 2 Þ be two graphs. The Cartesian product of these graphs is the graph G ¼ G 1 wG 2 with vertex set V 1 Â V 2 , where ðu 1 , u 2 Þðv 1 , v 2 Þ is an edge if and only if either u 1 v 1 is an edge in G 1 and u 2 ¼ v 2 or u 1 ¼ v 1 and u 2 v 2 is an edge in G 2 . The m Â n grid is the Cartesian product P m wP n of two paths of orders m and n, respectively, with m, n ! 2: Without loss of generality, we may assume that m n: Note that P 2 wP 2 ¼ C 4 , so the 2 Â 2 grid does not have a total resolving set. In this section we determine the total metric dimension of the larger grids.
First we consider the case m ¼ 2 and n ! 3: The 2 Â n grid, with n ! 3, is also known as the ladder graph or the n-ladder. It consists of two copies of the path P n on n vertices, and a matching between corresponding vertices. We draw the two n-paths horizontally from left to right: a bottom path and above it a top path, so that the matching between the two paths consists of vertical lines. See Figure 4 for an illustration. The vertices of the bottom path will be called bottom vertices, and those of the top path top vertices. The four vertices of degree 2 are the corners of the n-ladder. Now we search for total resolving sets S for the ladder graph. Since a total resolving set S is of order at least 3, we may assume, without loss of generalization, that S contains at least two bottom vertices. Let u be the left most bottom vertex in S, and let v be the right most bottom vertex in S. In Figure  4 Next we also consider v. Now v will resolve downward boxes to the left of v. It also resolves pairs containing u except for the upward box containing u. In Figure 4(B), we see all the boxes that are not resolved by the set {u, v}. The only other pair that is not yet totally resolved is the pair u, v itself.
If S contains other bottom vertices, then these lie between u, being the left most bottom vertex in S, and v, being the right most bottom vertex in S. No such vertex will resolve any of the boxes. It might resolve the pair u, v. Hence, if there are other bottom vertices in S than u and v, then jSj ! 4: In order to totally resolve the boxes, we need top vertices. Any top vertex in a box will not totally resolve that box. The top left corner will not totally resolve the upward boxes, and the top right corner will not totally resolve the downward boxes. So, if a top vertex from a box, or a top corner, is in S, then jSj ! 4: Any top vertex w between the boxes will totally resolve all boxes. It will totally resolve the pair u, v if and only if dðw, uÞ 6 ¼ dðw, vÞ: In Figure 4(B) there is no such top vertex between the boxes. So, any total resolving set S with u and v in S as depicted in Figure 4(B) is of order at least 4.
We can do better by taking u to be the left bottom corner, and v to be the right bottom corner, see Figure 5. In this case the middle top vertex between the boxes still does not resolve the pair u, v, but the other two top vertices between the boxes resolve the pair u, v. If we take one of these to be w, then the set S ¼ fu, v, wg totally resolves the ladder graph, so that the total metric dimension is 3. We can find such a top vertex w as soon as n ! 6: As long as n 5, no single top vertex will simultaneously totally resolve the upward box containing the left bottom corner u, the downward box containing the right bottom corner v and the pair u, v. So we have dim t ðP 2 wP n Þ ! 4, for 3 n 5: It is easily deduced from the above considerations that the four corners totally resolve the n-ladder, for any n ! 3: Thus we have proved the following result.
Theorem 21. For the n-ladder P 2 wP n , if n ! 6: ( Next we turn to the grids P m wP n with 3 m n: We will show that, except for a few small cases, the total metric dimension of such grids is 3. We use Figure 6 to illustrate our arguments, but they apply to all larger grids (except for the three small cases m ¼ n ¼ 3, 3 ¼ m < n ¼ 4, and 4 ¼ m < n ¼ 5, with which we deal separately).
To construct a TRS, we take the bottom left corner u and the bottom right corner v of the grid. In Figure 6 we give two instances. We see two boxes in each of these grids. We call the one containing u the u-box, and the one containing v the v-box. A u-pair is a pair in the u-box containing u, and, similarly, a v-pair is a pair in the v-box containing v. Note that v does not resolve any pair in the ubox, but u resolves the pairs of white vertices in the u-box. A similar phenomenon holds for v.
Thus the set {u, v} neither totally resolves the pair u, v, nor the u-pairs, nor the v-pairs. All other pairs, so also any pair of white vertices within a box, are totally resolved by the set {u, v}. Let w be a vertex in the top row of the grid. If w is the top left corner, then it will not resolve the pairs in the u-box. Similarly, if w is the top right corner, then it will not resolve the pairs in the v-box. If w is in the u-box, then it will not resolve the pair u, w. If w is in the v-box, then it will not resolve the pair w, v. Next we consider two cases where w is not in a box and is not a corner.
Proposition 22. Let m ! 3 and let n ! m þ 2. Then dim t (P m w P n ) ¼ 3.
Proof. This case is illustrated in Figure 6(B). Since n ! m þ 2, the neighbor w of the top left corner is to the left of the boxes. Hence w resolves all pairs in the v-box, in particular the v-pairs. The distance between w and any of the white vertices in the u-box is m -1, whereas dðw, uÞ ¼ m þ 1: So w resolves all the u-pairs as well.
Finally, we have dðw, uÞ ¼ m þ 1 and dðw, vÞ ¼ ðn À 1Þ þ m ! m þ 4: So w also resolves the pair u, v. Hence {u, v, w} is a TRS: Then dim t ðP m wP n Þ ¼ 3.  Proof. The case m ¼ n ¼ 4 is illustrated in Figure 6(A). In this case, but also in the case 5 m n m þ 1, the top vertex of the v-box is to the left of the top vertex of the u-box, and there are at least two vertices in the top row between the two boxes. At least one of these is a vertex w with dðw, uÞ 6 ¼ dðw, vÞ: So this vertex w resolves the pair u, v. Clearly such a vertex w has smaller distances to the white vertices in the ubox than to u, and also smaller distances to the white vertices in the v-box than to v. Thus the set {u, v, w} is a TRS. w The only cases, in which such a non-corner vertex w to the left from the boxes, or between the boxes with different distances to u and v, cannot be found, are when m ¼ n ¼ 3, or m ¼ 3 and n ¼ 4, or m ¼ 4 and n ¼ 5. We consider these three cases separately.
Lemma 24. dim t ðP 3 wP 3 Þ ¼ 4: Proof. Assume to the contrary that P 3 wP 3 has a total resolving set S of order 3. Then, by Lemma 14, all three distances between the pairs in S must be different. This implies that S cannot consist of only corners. Also S cannot consist of only non-corners. This is easily checked in Figure 7(A). So S contains at least one corner, without loss of generality, the left bottom corner. Moreover S contains at least one non-corner.
Suppose S contains a neighbor of u, see Figure 7(B), where two pairs are highlighted by boxes. It is straightforward to check that none of the other vertices totally resolves both boxes. So S cannot contain a neighbor of u.
Suppose S contains a middle vertex of the top row or the right most column, say the middle vertex of the top row, see Figure 7(C). To avoid a corner with a neighbor in S, the two top corners are not in S. To have different distances in S, the third vertex in S must be the central vertex of the grid. But now the pair in the box is not totally resolved by S.
Finally, there is only one possible non-corner vertex in S, viz. the central vertex. Any third vertex must now be a corner, and the middle vertex has distance two to both these corners. Again S is not a total resolving set.
Thus we have shown that no 3-set totally resolves the 3 Â 3 grid. In Figure 7(D), a 4-set S of the gray vertices is depicted, which totally resolves P 3 wP 3 : This completes the proof. Proof. Assume to the contrary that there is a total resolving set S of order 3. If S is contained in a 3 Â 3 subgrid, then, by Lemma 24, already four vertices are needed to totally resolve this subgrid. So S must contain a vertex of the left most column and a vertex of the right most column. If S is contained in a 2 Â 4 subgrid, then we get a similar contradiction by Theorem 21, which tells us that there are four vertices needed to totally resolve a 2 Â 4 grid.
So S must contain a vertex from the left most column, from the right most column, from the bottom row, and from the top row. If S does not contain a corner, then already four vertices are needed to satisfy this condition. So S contains a corner, without loss of generality the left bottom corner u. Let v be a vertex in S from the right most column. If v is the top corner on the right, then it is easily seen that no third vertex simultaneously totally resolves all remaining unresolved pairs. The same holds if v is the middle vertex in the right most corner. So v has to be the bottom corner on the right. From our arguments above, it  follows that again there is no third vertex that totally resolves the remaining unresolved pairs. Finally, the four corners of the 3 Â 4 grid totally resolve the whole grid, by which the proof is complete. w Lemma 26. dim t ðP 4 wP 5 Þ ¼ 3: Proof. We choose a vertex u and a vertex v as in Figure 8. In the figure, we see boxes indicating the pairs that are not yet totally resolved by u or v: the usual u-box containing the nonresolved u-pairs, the v-box containing the non-resolved vpairs, but also three downward boxes on the right containing non-resolved pairs. Obviously, w resolves all these pairs. So S ¼ fu, v, wg is a 3-set that totally resolves the 4 Â 5 grid. To conclude, we observe that, in all cases, the two bottom corners form a resolving set for the grid. So the metric dimension of any m Â n grid is 2, for 2 m n:

Concluding remarks
The metric dimension of a graph G of order n is defined in terms of the set of n ordered vectors, rðwjSÞ ¼ ðdðw, v 1 Þ, dðw, v 2 Þ, :::, dðw, v k ÞÞ, consisting of the distances of each vertex w 2 V to each member of an ordered set S ¼ fv 1 , v 2 , :::, v k g of k vertices in a graph G ¼ ðV, EÞ: The simple condition for a resolving set is that no two of these ordered vectors are identical. This leads one to ask, what other conditions would be reasonable to impose on this set of n vectors?
For example, what if you only considered the set of k distances, with duplications possible, rather than the ordered vector of distances, and you impose the condition that no two of these multisets of distances are identical for two different vertices?
A different type of condition is studied in [6]. Here the requirement for the vectors is that the entries in each vector rðwjSÞ are distinct. Such sets are called different-distance sets in [6]. Note that two vertices v and w now may have the same vector rðvjSÞ ¼ rðwjSÞ, as long as the entries in this vector are all distinct.
You could also consider situations in which the vectors of distances of the vertices in V -S to the vertices in S must satisfy some condition, but this condition does not apply to the vectors of the vertices in S, similar to the case of total resolving sets.
Notice that we have shown that for paths P n of order n ! 4, dim t ðP n Þ ¼ 3 and for cycles C n of order n ! 6, dim t ðC n Þ ¼ 3: This is a best or smallest possible value of dim t ðGÞ: We say that a graph G of order n is TRS-min if dim t ðGÞ ¼ 3, and is TRS-max if dim t ðGÞ ¼ n: Question 8. Can you characterize the class of TRS-min graphs?
Question 9. Can you construct a TRS-max graph?
Question 10. Can you characterize the class of TRS-max graphs?