Characterization of Vertex Graphs with Metric Dimension
Abstract
For an ordered set of vertices and a vertex in a connected graph , the ordered vector is called the (metric) representation of with respect to , where is the distance between the vertices and . The set is called a resolving set for if distinct vertices of have distinct representations with respect to . The minimum cardinality of a resolving set for is its metric dimension. In this paper, we characterize all graphs of order with metric dimension .
Keywords: Resolving set, Basis, Metric dimension, Locating set.
1 Introduction
Throughout this paper is a finite, simple, and connected graph of order . The distance between two vertices and , denoted by , is the length of a shortest path between and in . We write it simply when no confusion can arise. Also, the diameter of , , is denoted by . The vertices of a connected graph can be represented by different ways, for example, the vectors which theirs components are the distances between the vertex and the vertices in a given subset of vertices.
For an ordered set and a vertex of , the vector
is called the (metric) representation of with respect to . The set is called a resolving set (locating set) for if distinct vertices have different representations. In this case we say the set resolves . Elements in a resolving set are called landmarks. A resolving set for with minimum cardinality is called a basis of , and its cardinality is the metric dimension of , denoted by .
The concept of (metric) representation is introduced by
Slater [11] (see [8]). For more results in
this concept see [1, 2, 4, 5, 7, 13].
It is obvious that for every graph of order , . Yushmanov [14] improved this bound to .
Khuller et al. [10] and Chartrand et al. [6]
independently proved that if and only
if is a path. Also, all graphs with metric dimension two are
characterized by Sudhakara and Hemanth Kumar [12].
Chartrand et al. [6] proved that the
only graph of order , , with metric dimension
is the complete graph . They also provided a
characterization of graphs of order and
metric dimension . In [3] the problem of
characterization of all graphs of order with metric dimension
is proposed. In this paper, we answer to this question and
provide a characterization of graphs with metric dimension .
First in next section, we present some definitions and known
results which are necessary to prove our main theorem.
2 Preliminaries
In this section, we present some definitions and known results which are necessary to prove our main theorem. The notations and denote the adjacency and noneadjacency between vertices and , respectively. An edge with end vertices and is denoted by . A path of order , , and a cycle of order , , are denoted by and , respectively.
We say an ordered set
resolves a set of vertices in , if the
representations of vertices in are distinct with respect to
. When , we say that the vertex resolves . To
see that whether a given set is a resolving set for , it is
sufficient to look at the representations of vertices in
, because
is the only vertex of for which .
In [6] all graphs of order with metric dimension are characterized as follows.
Theorem A
. [6] Let be a graph of order . Then if and only if , or .
For each vertex , let . Two distinct vertices are twins if . It is called that if and only if or are twins. In [9], it is proved that the relation is an equivalent relation. The equivalence class of the vertex is denoted by . The twin graph of , denoted by , is the graph with vertex set , where if and only if . It is easy to prove that are adjacent in if and only if all vertices of are adjacent to all vertices of , hence the definition of is well defined. For each subset , let denote the set . Also, by , we mean the set . For each , it is immediate that if . Furthermore, we define

,

,

,

.
We say a set of vertices is homogeneous if the induced subgraph by in , , is a complete or an empty subgraph of . In this terminology, it is proved in [9] that each vertex of is a homogeneous subset of .
Observation 1
. [9] If the vertices are twins in a graph and resolves , then or is in . Moreover, if and , Then also resolves .
Proposition 1
. [9] Let be a graph. Then Moreover, if are not twin vertices of , then .
As in [9], we say that is of type:

(1) if ,

(K) if and ,

(N) if and .
A vertex of is of type (1K) if it is of type (1) or (K). A vertex is of type (1N) if it is of type (1) or (N). A vertex is of type (KN) if it is of type (K) or (N). We denote by the number of vertices of of type (K) or (N). It is obvious that is uniquely determined by , and the type and cardinality of each vertex of .
Hernando et al. [9] characterized all graphs of order , diameter and metric dimension by the following theorem.
Theorem B
. [9] Let be a graph of order and diameter . Let be the twin graph of . Then if and only if is one of the following graphs:

1. and one of the following cases holds
(a) ;
(b) , the two vertices of not of type (1) are adjacent, and if one is a leaf of type (K), then the other is also of type (K);
(c) , the two vertices of not of type (1) are at distance and both are of type (N); or
(d) and there is a vertex of type (KN) adjacent to two vertices of type (N). 
2. (the path with one extra vertex adjacent to ) for some integer , the degree vertex of is of any type, each neighbor of is of type (1N), and every other vertex is of type (1).

3. (the path with one extra vertex adjacent to and ) for some integer , the three vertices in the cycle are of type (1K), and every other vertex is of type (1).
To prove our main theorem, we need the following propositions.
Proposition 2
. Let be a subgraph of a graph . If and for all pairs of vertices in , then .
Proof.
Let be a basis of . Since for all pairs of vertices in , as a subset of resolves all vertices of . Hence, is a resolving set for where, . Therefore, the metric dimension of is at most .
Corollary 1
. If is an induced subgraph of a graph , where , and for some positive integer , then .
Corollary 2
. Let be an induced subgraph of a graph , and be an induced subgraph of a graph , where , , and for some positive integer . Then .
Proof.
Let , for some positive integer . By Corollary 1, we have and . Therefore, .
Proposition 3
. Let be a graph and be the twin graph of . If for some positive integer , then .
Proof.
Let be a basis of and . We choose a vertex from each and let . Since is a basis of , for each pair of vertices , there exist a vertex such that . Note that neither nor is twin with , for each . Therefore, by Proposition 1, we have and . Hence, , which implies that the set resolves . Therefore, is a resolving set for of cardinality , thus .
Proposition 4
. Let be a graph and be the twin graph of . Then .
Proof.
If resolves , then Observation 1 shows that contains at least vertices from each . Hence, .
3 Main Results
Let be a connected graph of order and metric dimension . Since , it follows that . If , then , contrary to . If , then in Theorem B, let , which obtains a characterization of graphs with , where , (Note that in this case the interval is empty, hence, Case 2 dose not occur). Therefore, it is enough to consider the case . The following theorem is our main result, which is a characterization of all graphs with metric dimension and diameter .
Theorem 1
. Let be a graph of order and diameter and be the twin graph of . Then if and only if satisfies in one of the following structures:

: and has at most one vertex of type (1K);

: and one of the following cases holds:
(a) The degree vertex is of type (N) and one of the leaves is of type (K) and the other is of any type;
(b) One of the leaves is of type (K), the other is of type (KN) and the degree vertex is of any type; 
: is the paw (a triangle with a pendant edge), and the degree vertex is of any type, one of the degree vertices is of type (N), the other is of type (1K), the leaf is of type (1N). Moreover, a degree vertex of type (K) yields the leaf and the degree vertex are not of type (N);

: , and each vertex is of type (1);

: is with a chord, and the adjacent degree vertices are of type (1) and the other vertices are of type (1K);

: is a with two adjacent chords. The degree vertex is of any type, the others are of type (1K). Furthermore, two nonadjacent vertices are not of type (K), and two adjacent vertices are not of different types (K) and (N);

: is a kite with a pendant edge adjacent to a degree vertex, and the leaf is of type (1), the degree and degree vertices are of type (1K), one of the degree vertices is of type (K) and the other is of type (1).

: is the kite, and one of the degree vertices is of type (K) the other is of type (1), one of the degree vertices is of type (N), and the other is of type (1K);

: , and two adjacent vertices are of type (K) and others are of type (1);

: , and two degree adjacent vertices are of type (K), degree vertex is of type (1K), and others are of type (1).
In Figure 1 the scheme of the above structures are shown.
3.1 Proof of Necessity
Throughout this section, is a graph of order , diameter , metric dimension , and is the twin graph of . Note that, Proposition 1 implies that . Through a sequence of lemmas and propositions, we show that has one of the structures to .
Proposition 5
. If , then satisfies in structure .
Proof.
Let be two vertices of of type (1K). Since is a complete graph, every pair of vertices and of are twins, thus . Hence, has at most one vertex of type (1K). If vertices , and of (except possibly ) are of type (N), then we choose an arbitrary vertex , for each , , and , for each , . Let . It follows that
Hence, the set is a resolving set for and . This contradicts our assumption, . Therefore, has at most three vertices. Assume for some integer . If , then or . If , then or . Since , the above cases are impossible. Consequently , which is the desired conclusion.
The remainder of this section will be devoted to the case . It is clear that in this case, there exists a vertex such that and .
Lemma 1
. If and , then , where , , and . Moreover, if is of type (1K), then , , and .
Proof.
It is clear that a vertex in is not twin with any vertex of . Therefore, all twins of vertices in are in the set and all twins of vertices in are in . This gives , for . Hence, , when . Note that all twins of vertices in are in , because each member of is adjacent to and has at least one neighbor in while the vertices in have not such neighbors. Thus . By the same reason, all twins of vertices in are in . Consequently, .
Now let is of type (1K). Therefore, can only be twin with the vertices of . Hence, . It is clear that . If there exist a vertex , then , because . Since , all neighbors of each vertex are in the set , this contradicts the fact that . Therefore, and consequently, .
Lemma 2
. For each , where , at least one of the sets and is homogeneous.
Proof.
Let . On the contrary, suppose that both and are not homogeneous. Therefore, there exist vertices , and in , and vertices , and in such that and , . If , then the representations of and with respect to are as follows
where is or . These four representations are distinct, hence, is a resolving set for . Thus , which is a contradiction. Therefore, at least one of the sets or is homogeneous.
By Lemma 2, to
complete the proof of necessity, we need to consider the following
two cases.
Case 1. There exist a vertex such
that and is
homogeneous.
By the assumption of Case 1, the
following results are obtained.
Fact 1
. .
Proof.
Since every vertex of has a neighbor in and is homogeneous, for distinct vertices , the sets and are distinct nonempty sets. Therefore, the set resolves the vertices of in . Moreover, since every vertex of has a neighbor in and has not such a neighbor, if we compute the representations of the vertices in with respect to , then the representation of each vertex in has a coordinate 1 while all coordinates of are 2. Therefore, resolves the set consequently, is a resolving set for . Thus . On the other hand, by Propositions 3, we have . Therefore, , which yields .
Lemma 3
. If is not homogeneous, then and are empty sets.
Proof.
Note that , otherwise . Since is not homogeneous, there exist vertices and in such that and . Now if , then let , and . Thus, , , and , and so . This contradiction implies .
If , then and hence, by Lemma 1, is of type (N). Therefore, there exist two adjacent vertices , otherwise is homogeneous. Since , there exist a vertex such that . Now let , and . Thus, we have
Therefore, is a resolving set for , with cardinality , which contradicts our assumption . Consequently .
Fact 2
. .
Proof.
If is homogeneous, then since every vertex of has a neighbor in and is homogeneous, for distinct vertices , the sets and are distinct nonempty sets. Therefore, for each pair of vertices there exist a vertex such that resolves and in . Hence, resolves all vertices of the set . This implies that is a resolving set for , which yields . On the other hand, by Propositions 3, we have . Thus, .
Now let is not homogeneous. By Fact 1, . Thus, we consider two cases, and . In the case , let , , and for each , , and . Since is not homogeneous, there exists a vertex such that both and are nonempty sets. Let and . Note that , and resolves and . Hence, if is not homogeneous, then there exist vertices such that and . Thus, resolves the , this contradiction yields is homogeneous. By a similar reason is also homogeneous. Note that all different neighbors of vertices in are in the set , because is homogeneous and its vertices share their neighbors in . Similarly every different neighbor of vertices in are in , hence, and resolves each other. Now let . If each vertex of has a noneneighbor vertex in , then the representation of each vertex of with respect to has a coordinate , all coordinates of is , and is entirely . Consequently, resolves . Thus, implies that . Moreover, if there exist a vertex such that is adjacent to all vertices of , then has at most two vertices. Otherwise, there are two distinct vertices such that they are different from , and and are not entirely , and so resolves four vertices , and , contrary to . Hence, . Furthermore, yields that there exist a vertex such that is adjacent to all vertices of . On a similar way , moreover, only if there exist a vertex such that is noneadjacent to all vertices of . Thus, at most one of the sets and can have two vertices, because it is impossible that there exist a pair of vertices such that is adjacent to all vertices of and is noneadjacent to all vertices of . Consequently . We claim that is impossible.
If ,
then one of the two blow cases can be happened.
1. and . Let ,
, , and