Graphs with the edge metric dimension smaller than the metric dimension
††footnotetext: [email protected], [email protected], [email protected], [email protected], and
[email protected]
Abstract
Given a connected graph , the metric (resp. edge metric) dimension of is the cardinality of the smallest ordered set of vertices that uniquely identifies every pair of distinct vertices (resp. edges) of by means of distance vectors to such a set. In this work, we settle three open problems on (edge) metric dimension of graphs. Specifically, we show that for every with , there is , such that for every there exists a graph of order with metric dimension and edge metric dimension , which among other consequences, shows the existence of infinitely many graph whose edge metric dimension is strictly smaller than its metric dimension. In addition, we also prove that it is not possible to bound the edge metric dimension of a graph by some constant factor of the metric dimension of .
Keywords: Edge metric dimension; metric dimension; unicyclic graphs.
AMS Subject Classification numbers: 05C12; 05C76
1 Introduction
Metric dimension is nowadays a well studied topic in graph theory and combinatorics, as well as in some computer science applications, and the theory involving it is indeed full of interesting results and open questions. One recent issue that has attracted the attention of several researchers concerns a variant of the standard metric dimension, in which it is required to uniquely recognize the edges of a graph, instead of its vertices, and by using vertices as the recognizing elements. This variant was introduced in [6], and since its appearance, a significant number of works have been published. In this sense, we mention the most recent ones [3, 4, 9, 12, 13, 14]. Specifically, the edge metric dimension is studied in several situations as follows: [3] is dedicated to study several generalized Petersen graphs; in [4], a number of results about pattern avoidance in graphs with bounded edge metric dimension are given; [9] centers the attention on some product graphs (corona, join and lexicographic); [12] studies some convex polytopes and related graphs; in [13], a characterization of graphs with the largest possible edge metric dimension (order minus one) is given; and finally, in [14] the Cartesian product of any graph with a path is studied, as well as, it is proved to be not possible to bound the metric dimension of a graph by some constant factor of the edge metric dimension of . We should also remark some results from the seminal article [6]. There was proved for instance that computing the edge metric dimension of graphs is NP-hard, that can be approximated within a constant factor, and that becomes polynomial for the case of trees. Further, some bounds and closed formulas for several classes of graphs including trees, grid graphs and wheels (among others), were also deduced in [6].
We recall that the parameter edge metric dimension (from [6]) studied here is not the same as that one defined in [8], where the authors studied the metric dimension of the line graph of a graph (namely edges uniquely recognizing edges), and called such parameter as edge metric dimension, although it was further renamed as the edge version of metric dimension in [7].
In the next we recall the necessary terminology and notation. We consider only simple and connected graphs. Let be a graph and let be its vertices. By (or by when no confusion is likely) we denote the distance from to in . Let be a vertex of . We say that identifies (resolves or determines) a pair of vertices , if , An ordered set of vertices is a metric generator for if every two vertices are identified by a vertex of . The metric dimension of is then the cardinality of the smallest metric generator for . Such cardinality is denoted by and a metric generator of cardinality is known as a metric basis. It is necessary to remark that the concepts above were first defined in [1] for a more general setting of metric spaces. The concepts were again independently rediscovered for the case of graphs in [5] and [11], where metric generators were called resolving sets and locating sets, respectively. Also, in [11], the metric dimension was called locating number. The terminology of metric generators was first used in [10].
Let be a graph and let be an ordered set of vertices of . For every we can consider the vector of distances from to the vertices in . If is a metric generator, then all such vectors are pairwise different. The vector is known as the metric representation of with respect to .
The concept of edge metric dimension was first described in [6], as a way to uniquely recognize the edges of a given graph . A vertex distinguishes two edges if , where . A set of vertices is an edge metric generator for , if any two edges of are distinguished by a vertex of . The edge metric dimension of is the cardinality of the smallest edge metric generator for , and is denoted by . An edge metric generator of cardinality is known as an edge metric basis. The edge metric representation is defined analogously as in the case of the metric dimension.
2 Edge metric dimension versus metric dimension
One would expect that and are related. The search for a relationship between these two invariants (in a shape of a bound for instance) was of interest in the seminal article [6], as well as in the subsequent works on the topic (see also for instance [14]). In this sense, in [6], several families of graphs for which , or , or were presented. For the last case, only one construction was given, namely the Cartesian product of two cycles . It was shown in [6] that . In consequence, it was claimed in [6] that the metric dimension and the edge metric dimension of graphs seemed to be not comparable in general. This example above and the other results from [6] allowed the authors of that article to point out the following questions.
-
(i)
For which integers , with , can be constructed a graph of order with and ?
-
(ii)
Is it possible that or would be bounded from above by some constant factor of or , respectively?
-
(iii)
Can you construct some other families of graphs for which ?
Note that the question (i) is precisely the realization of graphs with prescribed values on its order, metric dimension and edge metric dimension, while the question (ii) is equivalent to ask whether the ratios and are bounded from above. The third question can be settled as a consequence of the other two. Realization results concerning the case in which were already studied in [6], although not completed. With respect to the ratios, it was proved in [14] that is not bounded from above. The other possibility has never been studied till now.
In this work we deal with these three problems mentioned above. That is, our results complete the unboundedness results given in [14], while studying the ratio , and thus, the problem in (ii) is now completely settled. We also give positive answer to (iii), and moreover, we present an almost complete answer to (i), since we show that for every with , there is , such that for every there exists an outerplanar graph (a cactus graph indeed), of order with and . This result is in a sense best possible, because if , then is a path of length at least , and consequently as well. We remark that a similar result for was proved in [6], where was shown to be at most . So, our result complements the former one and a weaker version of this former result (with a weaker bound for ) can be proved also using a variant of our construction.
As a consequence of our results it is clear the existence of infinite families of graphs for which the differences and are arbitrarily large. Proving that the difference is arbitrarily large was already presented in [6]. However, the other difference was only proved to be at most 1 in [6], and there was no more knowledge on this issue. Clearly, the unboundedness of the ratio gives as a consequence that can as large as possible.
While graphs for which are very common, and they are present in several investigations already published, the opposed version seemed to be more elusive till now. We have first observed that is the unique connected simple graph whose edge metric dimension is . Since , is the smallest graph which has the edge metric dimension smaller than the metric dimension. For non-trivial examples one needs to consider graphs of order at least 10. By exhaustive computer search we found that the smallest possible graphs (different from ) satisfying the inequality , are the five graphs on vertices depicted in Figure 4. Moreover, we have found 61 such graphs of order 11.

The main contributions of our work are as follows.
Theorem 1.
Let and . Then there is an integer such that for every there exists a graph on vertices with and .
Theorem 2.
The ratio is not bounded from above.
Proof.
By Theorem 1, for arbitrarily large , it is always possible to find a graph such that and . As such, can be made arbitrarily large. ∎
Notice that by using a similar argument as the one in the proof above, although it is already known from [14], we can also prove that the ratio is not bounded from above.
3 Proof of Theorem 1
In order prove the main result of this work, we shall construct infinite families of graphs for which as well as other ones where . To this end, we need first some preliminary results. We first describe two graphs that will be used in this purpose. Take a cycle on vertices, where . We denote the vertices of consecutively by . Further, take a path on vertices denoted consecutively by , where , and join to by the edge . Then take vertices and and connect them by edges to and , respectively. Finally, take vertices , where , and join them by edges to the vertex . We denote the resulting graph by . A fairly representative example of a graph as described above in drawn in Figure 2.

In connection with the graphs , we shall need a graph denoted by that is obtained from by removing the vertices of the set and the edges incident with them. Thus, is a proper subgraph of .
3.1 Preliminaries of the proof
We now prove several auxiliary results about the graph . We remark that we shall be using the graphs in most of the described situations.
Observation 3.
Let , and . Then and .
Proof.
Let be a metric basis of . If does not contain a vertex of the subgraph , then . Thus, contains at least one vertex of . Moreover, if does not contain two pendant vertices and attached to , then . Thus, contains at least pendant vertices attached to , and so, in conclusion we get .
Now let be an edge metric basis. Here the situation is analogous since if does not contain a vertex of , and if and are pendant vertices attached to and not in . ∎
Lemma 4.
Let , and . Then and .
Proof.
Let , where and . Observe that since and . Moreover, if is odd and otherwise. Obviously, contains vertices. And since , we have . Denote .
First we show that is a metric generator of . Since , there is a vertex of outside the subgraph . This vertex distinguishes those vertices of which are at different distances from , but not those which are at the same distance from . According to the distance from , the vertices of are partitioned into nontrivial sets , , , etc. Some of these sets are probably smaller since they do not need to contain vertices of both and , and could be even.
Let . For every , denote . Then the vertices in the first set of the partition have and . Since , these pairs are different. Further, the pairs for vertices in the second set of the partition are , , , , and they are pairwise distinct too. Since the distances to vertices of decrease while the distances to vertices of increase, it is obvious that the pair distinguishes the vertices in the sets of the partition. Hence, identifies the vertices of .
Since a pendant vertex in is identified trivially, it remains to check the vertices and . Obviously, is the only vertex at distance from the pendant vertices in and at distance from . On the other hand, is the only vertex at distance from the pendant vertices in . Thus, is a metric generator of .
Now we show that is an edge metric generator of . We proceed analogously as in the case for the metric generator. According to the distance from , the vertices of outside partition the edges of into sets , , , etc. Again, some of these sets are probably smaller since they do not need to contain the edges of both and , and may be odd. For every , denote . Then the pairs for edges in the first set of the partition are and . Further, the pairs for edges in the second set of the partition are , , , and they are pairwise distinct too. Since the distances to edges of decrease while the distances to edges of increase, it is obvious that the pair distinguishes the edges in the sets of the partition. Hence, identifies the edges of .
Since a pendant edge is identified trivially if , it remains to check the edges and . Obviously, is the only edge at distance from the pendant vertices in and at distance from . On the other hand, is the only edge at distance from the pendant vertices in and at distance from . Therefore, is a metric generator of and the proof is completed. ∎
The next two propositions show that and depend on the parity of .
Lemma 5.
Let , and . Then if is odd, and if is even.
Proof.
First assume that is odd. Analogously as in the proof of Lemma 4, let , and . Since is odd, . As shown in Observation 3, every metric basis of contains a vertex outside . By using the distances, this vertex partitions into nontrivial sets , , , etc. For every , we denote . Then the values of for the vertices in are and , and they are different. The values of for vertices in are , , and , and they are different too. The set contains vertices with values of being , and , etc. Hence, to identify the vertices of it suffices (and is necessary by the proof of Observation 3) that a metric generator of will contain only one vertex of , namely . Hence, is a metric generator of , see the proof of Lemma 4. By Observation 3, we then get .
We now assume is even and proceed analogously as above. Vertices outside partition into nontrivial sets , , , etc. We denote this partition by . (Though it is not obvious, this partition is slightly different from the partition for the case when is odd.) We show that there is not a unique vertex in which distinguishes all the vertices inside the sets of . Let . By symmetry, it suffices to distinguish four cases:
Case 1: . Then and .
Case 2: . Then and .
Case 3: . (This set is empty if .) Then again .
Case 4: . Then and .
Since the other possibilities are symmetric, every metric basis of contains at least two vertices of . And since every metric basis of contains at least pendant vertices attached to , we have . Thus, by Lemma 4, . ∎
We now consider the counterpart of Lemma 5 for the edge metric dimension case.
Lemma 6.
Let , and . Then if is odd, and if is even.
Proof.
First assume that is odd. Since , every edge metric basis contains a vertex outside of , and by using distances, this vertex partitions into sets , , , etc. We show that there is no vertex in which distinguishes edges inside these sets. Let . By symmetry, it suffices to distinguish the following four situations.
Case 1: . Then and .
Case 2: . Then and .
Case 3: . (This set is empty if .) Then again .
Case 4: . Then and .
Since the other possibilities are symmetric, every edge metric basis of contains at least two vertices of . And since also every edge metric basis of contains at least pendant vertices attached to , we have . By Lemma 4, we then have .
Now assume that is even. Analogously to the proof of Lemma 4, let , and . Since is even, . The vertices of an edge metric basis outside partition the edges of into sets , , , etc. For every , let us denote . Then the values of for the edges in are and and they are different. The values of for edges in are , , and and they are different too. The values of for edges in are , and , etc. Hence, in order to identify the edges of , it suffices (and it is indeed necessary by the proof of Observation 3) that an edge metric generator will contain only one vertex of , namely . Hence, the set is an edge metric generator of , see the proof of Lemma 4. Therefore, by Observation 3, we get . ∎
3.2 Core of the proof
To obtain the required graphs we are searching for, we will connect several copies of the graph by adding a few edges. To this end, we need the following powerful tool.
Lemma 7.
Let and be two graphs which are not paths, such that for any , the graph contains a metric basis and an edge metric basis satisfying the following conditions.
-
(1)
There is .
-
(2)
There are such that for every .
Let be a graph obtained by adding the edge to the disjoint union of the graphs and . Then, and . Moreover, is a metric basis of and is an edge metric basis of .
Proof.
First observe that for every , the set identifies the vertices of . Analogously, if , then the set identifies the vertices of . Since and are not paths, and . Hence, the set identifies the vertices of and it also identifies the vertices of . Thus, to conclude that is a metric generator, we just may need to consider a pair of vertices with and .
By (2), for every . Hence, for , we have , while for it follows . Thus, clearly . Since , we conclude that identifies all the vertices of , and so it is a metric generator for .
Now suppose that is a metric generator for such that . Then either or . In the first case identifies which contradicts , while in the second case identifies which contradicts . Consequently, such a set does not exist, and we obtain that is a metric basis for , which means .
The situation for the edge metric basis is analogous. The only difference comes by noticing that we may need to consider the edge metric representation of the edge , that is , but this is unique in . Observe that if and , then and for every and . ∎
3.3 Conclusion of the proof
For some positive integer , we consider graphs given as follows. Let , and let , with , and . To distinguish vertices in distinct copies of , if is a vertex in , , then we denote it by . Let . Then is a graph obtained from the disjoint union by adding the edges , , …, . See Figure 3 for an example.

Obviously, is a connected graph, and if , then is just . We next give some results concerning the metric and edge metric dimensions of such graphs.
Lemma 8.
Let , , and . Then the following holds.
-
(1)
If is odd, then and .
-
(2)
If is even, then and .
Proof.
We only prove the result for the case when is odd, since the proof for the case when is even is in fact the same.
Let . As shown in the proof of Lemma 5, and is a metric basis of . By Lemma 6, and is an edge metric basis of . We first consider the graphs and , in concordance with the construction of . Now, for , denote the metric basis and an edge metric basis in by and , respectively. Then and , and moreover, for every . Hence, the graphs and satisfy the assumptions of Lemma 7. Thus, has metric dimension and edge metric dimension . Moreover, is a metric basis of and is an edge metric basis of , for which .
Since and satisfy the assumptions of Lemma 7, we can then proceed with and instead of and , and continue with this process until we reach the largest value of . This concludes the proof. ∎
By using the exposition of results above, we are then able to complete the proof of Theorem 1. That is, if , then and , by Lemma 8. Hence, if , then for every the graph has the required properties.
On the other hand, if , then and , by Lemma 8. Hence, if , then for every the graph has the required properties.
4 Further work
The graphs from Figure 2, together with the graphs defined above, for even, allow to think that characterizing the whole class of graphs for which is a highly challenging problem, since the structures that such graphs can have is rather wide. In this concern, observe also for instance the graphs of Figure 4, which have order 11, and other examples are the already mentioned torus graphs .

Notwithstanding, one could think into characterizing some special families of graphs achieving this property. Thus, some open problems that would be of interest from our point of view are the following ones.
-
•
Characterize the class of unicyclic graphs for which .
-
•
Characterize all the graphs (or maybe only the unicyclic ones) for which .
-
•
Characterize all the graphs for which ( and ) or ( and ).
-
•
Find some necessary and/or sufficient conditions for a connected graph to satisfy that .
Acknowledgements. The authors acknowledge partial support by Slovak research grants VEGA 1/0142/17, VEGA 1/0238/19, APVV–15–0220, APVV–17–0428, Slovenian research agency ARRS program P1–0383 and project J1-1692.
References
- [1] L. M. Blumenthal, Theory and applications of distance geometry, Oxford University Press, Oxford (1953).
- [2] J. Caceres, C. Hernando, M. Mora, I. M. Pelayo, M. L. Puertas, C. Seara, and D. R. Wood, On the metric dimension of Cartesian products of graphs, SIAM J. Discrete Math. 21 (2) (2007) 423–441.
- [3] V. Filipović, A. Kartelj, and J. Kratica, Edge metric dimension of some generalized Petersen graphs, Results Math. 74 (4) (2019) article # 182.
- [4] J. Geneson, Metric dimension and pattern avoidance in graphs, Discrete Appl. Math. (2020). In press. DOI: 10.1016/j.dam.2020.03.001
- [5] F. Harary and R. A. Melter, On the metric dimension of a graph, Ars Combin. 2 (1976) 191–195.
- [6] A. Kelenc, N. Tratnik, and I. G. Yero, Uniquely identifying the edges of a graph: the edge metric dimension, Discrete Appl. Math. 251 (2018) 204–220.
- [7] J. B. Liu, Z. Zahid, R. Nasir, and W. Nazeer, Edge version of metric dimension and doubly resolving sets of the necklace graph, Mathematics 6 (11) (2018) article # 243.
- [8] R. Nasir, S. Zafar, and Z. Zahid, Edge metric dimension of graphs, Ars Combin. In press.
- [9] I. Peterin and I. G. Yero, Edge metric dimension of some graph operations, Bull. Malays. Math. Sci. Soc. 43 (2020) 2465–2477.
- [10] A. Sebő and E. Tannier, On metric generators of graphs, Math. Oper. Res. 29 (2) (2004) 383–393.
- [11] P. J. Slater, Leaves of trees, Congr. Numer. 14 (1975) 549–559.
- [12] Y. Zhang and S. Gao, On the edge metric dimension of convex polytopes and its related graphs, J. Comb. Optim. 39 (2) (2020) 334-350.
- [13] E. Zhu, A. Taranenko, Z. Shao, and J. Xu, On graphs with the maximum edge metric dimension, Discrete Appl. Math. 257 (2019) 317–324.
- [14] N. Zubrilina, On the edge dimension of a graph, Discrete Math. 341 (7) (2018) 2083–2088.