1. Introduction
In this paper, we assume that all graphs are simple and connected, unless we explicitly say otherwise, and we consider distances in such graphs. Let G be a graph with the set of vertices and the set of edges The distance between vertices is the length of a shortest path in G connecting vertices u and The distance between a vertex and an edge is defined by When no confusion arises from that, we use abbreviated notation and We say that a pair x and of vertices from (respectively of edges from ) is distinguished by a vertex if . A set S is a vertex (respectively an edge) metric generator if every pair x and of vertices from (respectively of edges from ) is distinguished by a vertex The size of a smallest vertex (respectively edge) metric generator in G is called the vertex (respectively the edge) metric dimension of G, and it is denoted by (respectively ). The cyclomatic number of a graph G is defined by A -graphis any graph G with precisely two vertices of degree 3 and all other vertices of degree 2.
The concept of the vertex metric dimension was introduced related to the study of navigation systems [
1] and the landmarks in networks [
2]. Various aspects of this metric dimension have been studied since it was first introduced [
3,
4,
5,
6,
7,
8,
9,
10]. As was noticed recently in [
11], there are graphs in which none of the smallest vertex metric generators distinguish all pairs of edges. This motivated the introduction of a new variant of the metric dimension, namely the edge metric dimension. Even though it is newer than the vertex metric dimension, the edge metric dimension also attracted interest [
12,
13,
14,
15,
16,
17,
18,
19,
20]. A nice survey of the topic of the metric dimension is given in [
21].
Particularly relevant for this paper is the line of investigation from papers [
17,
22,
23,
24,
25,
26]. In [
22], the value of the vertex and edge metric dimensions for unicyclic graphs was bounded so it can take only two consecutive integer values, and then, in [
17], the condition under which the dimensions take each of the values was established. This result was further extended to graphs with edge disjoint cycles [
25], also called
cactus graphs or
cacti. A similar line of research for another variant of the metric dimension, the so-called mixed metric dimension, was conducted in [
23,
24,
27]. The results for cacti from [
25] imply that the simple upper bounds
and
hold for all cacti
G distinct from paths, where
with
being the number of paths pending at a vertex
v of degree
Moreover, the following conjectures were proposed for general graphs.
Moreover, the following conjectures were proposed for general graphs.
Conjecture 1. Let G be a connected graph. Then,
Conjecture 2. Let G be a connected graph. Then,
Since the attainment of the bound in the class of cactus graphs depends on the presence of leaves, leafless cacti and general graphs without leaves were further investigated in [
26]. It was established that, for leafless cacti, the upper bound decreases to
, and all cacti attaining this bound were characterized. It was further conjectured that the same decreased upper bound holds for all leafless graphs, i.e., the following two conjectures were posed.
Conjecture 3. Let be a graph with minimum degree . Then,
Conjecture 4. Let be a graph with minimum degree . Then,
To support these conjectures, it was established in [
26] that they hold for all graphs with
with the strict inequality. Moreover, additional results for graphs with
were also established, but let us first define all involved notions.
A set is called a vertex cut if is not connected or it is trivial. A vertex v is called a cut vertex if is a vertex cut. The (vertex) connectivity of a graph G is the size of the smallest vertex cut in G, and we denote it by A graph G is said to be k-connected if Any maximal 2-connected subgraph of G is called a block of G. If a block contains at least three vertices, then is said to be non-trivial.
In [
26], it was established that, for
, the problem can be reduced to 2-connected graphs, i.e., it was shown that if Conjecture 3 (respectively Conjecture 4) holds for 2-connected graphs, then it holds in general. Moreover, considering when the upper bound is attained, the following claim was established.
Lemma 1. Let be a graph with . If (respectively ) for a block of G distinct from a cycle or there exist two vertex-disjoint non-trivial blocks and in G, then (respectively ).
In this paper, we consider 2-connected graphs that attain the bound of Conjectures 3 and 4. In particular, we study
-graphs, as they are the simplest 2-connected graphs distinct from cycles. We show that the upper bound
holds for both metric dimensions of
-graphs. Since, for all
-graphs, the value of the cyclomatic number equals
to prove the conjectures, it is sufficient to prove that for all such graphs, metric dimensions are bounded above by 3. We also characterize all
-graphs for which the bounds are attained. The paper is concluded with the conjectures that the already known extremal leafless cacti from [
26] and the extremal
-graphs established in this paper are the only leafless graphs for which the bound
is attained. For these conjectures, we also established that they reduce to the same problem on the class of 2-connected graphs.
2. -Graphs with Metric Dimensions Equal to 3
Therefore, let us first introduce a necessary notation for -graphs. Let G be a -graph; by u and v, we denote the two vertices of degree 3 in Notice that there are three distinct paths in G connecting u and and we denote them by , and so that , , and . The cycle in G induced by paths and will be denoted by . A -graph in which paths , and are of lengths and r, respectively, is denoted by .
Lemma 2. Let or with . Then, .
Proof. Let be a set of vertices in G such that . It is sufficient to show that S is not a vertex metric generator. First, if then and are not distinguished by so we can assume . Now, let us consider the case for some Assume first Since and are of equal length, the distance of and to all vertices of is the same; hence, S does not distinguish and Let us now assume , and let us consider vertices and Notice that a shortest path from both and to all vertices of leads through This implies that the distance from and to all the vertices of is the same, so a set would not distinguish and The same reasoning goes for so we may assume that for every
Now, denote by and the two elements of S. Then, and are internal vertices of paths and , respectively, where . We distinguish two cases.
Case 1:and. Let us denote
, and
. If
then
and
form an antipodal pair on
, which implies that two neighbors of
are not distinguished by
S. Therefore, without loss of generality, we may assume
and
. Since
it follows that
a and
b are of the same parity; hence,
is a positive even number. Therefore, we can define
, and we know that
c is a positive integer. Let
. Notice that
Therefore, there exist interior vertices
and
; see
Figure 1a.
Now, we prove that
and
are not distinguished by
S. Notice that
Since
we have
, and so,
and
are not distinguished by
. As for
, notice that
so we have
Furthermore, we have
which implies
We conclude that
and
are not distinguished by
either, so
S is not a vertex metric generator.
Case 2:and. For , this case is analogous to the previous one, so let us assume . Again, denote , , and . If then and are antipodal on , so the two neighbors of are not distinguished by S. Hence, without loss of generality, we may assume Let us denote Since we know that a and b are of the same parity, so is a positive integer. Consequently, also, c is a positive integer.
First, since
and
are internal vertices of paths
and
, respectively, we have
. This yields
Hence, there exists an interior vertex
as it is shown in
Figure 1b. Furthermore, notice that
which implies
Now, let
If
, we consider the vertex
; otherwise, for the sake of simplicity, we denote
; see
Figure 1b. We have already shown
, which yields
and so,
. Hence,
and
are not distinguished by
It remains to prove that
and
are not distinguished by
either. For that purpose, notice that
which implies
Furthermore, notice that
which implies
Therefore, vertices
and
are not distinguished by
either; hence, we conclude that
S is not a vertex metric generator. □
Now, a subgraph H of a graph G is an isometric subgraph if for every pair of vertices Consequently, if a pair of vertices is distinguished by in then it is distinguished by S in G as well.
Lemma 3. Let or with . Then. for any there are such that is a vertex metric generator in G.
Proof. First, notice that every cycle of G is an isometric subgraph in We say that a set is nice, if for every cycle of G, it holds that contains two vertices that do not form an antipodal pair in . We first show that any nice set S is a vertex metric generator in In order to see this, let x and be a pair of vertices from Notice that x and belong to at least one cycle in G. Since S is nice, contains two vertices that are not antipodal in , which implies that is a vertex metric generator in Therefore, x and are distinguished by in Since is an isometric subgraph of this further implies that x and are distinguished by S in so S is a vertex metric generator of G. To complete the proof, for every , we extend a to a nice set.
Let us assume If the set is a nice set in G. Therefore, S is a vertex metric generator, which, due to the symmetry of G, proves the claim. Therefore, let us assume that . By symmetry, we may assume that , where . However, then, is a nice set in G.
Assume now that If it is easy to see that sets and are nice in which, due to the symmetry of G, proves the claim. If then, due to the symmetry of G, it is sufficient to prove the claim for , where , and for , where If for then is nice in G. On the other hand, if for , then is nice in G. □
By Lemmas 2 and 3, the following statement holds.
Theorem 1. For it holds that .
Since, in any -graph G, it holds that and the above theorem gives the following corollary.
Corollary 1. We have .
Hence, for and , the bound from Conjecture 3 holds with equality. Similarly, when considering the edge metric dimension of -graphs, we have the following.
Lemma 4. Let or with and Then, for any there are such that is an edge metric generator in G.
Proof. As or 3 and the problem is finite. To avoid a tedious proof, the statement was easily verified by a computer by checking all sets of cardinality three. □
Proposition 1. Let or with and . Then, .
Proof. Similarly as before, by a computer, we checked easily that there is no edge metric generator of size two. Then, the claim follows from Lemma 4. □
Corollary 2. Let or for and . Then,
3. -Graphs with Metric Dimensions Equal to 2
In this section, we show that all remaining
-graphs, i.e., all
-graphs not mentioned in the previous section, have the vertex (respectively the edge) metric dimension equal to 2. We first consider the vertex metric dimension. For all remaining
-graphs, we show that there is a set
S of cardinality two that is a vertex metric generator; see
Figure 2.
Lemma 5. Let , where and let S be a set of vertices in defined in the following way:
- (i)
If one of p, q, r is odd and at least 3 and one of p, q, r is even, say is odd and r is even, then ;
- (ii)
If and both q and r are even, then ;
- (iii)
If all p, q, r are even and then ;
- (iv)
If all of p, q, r are even, , and then ;
- (v)
If all p, q, r are even and then ;
- (vi)
If all p, q, r are odd and , then ;
- (vii)
If all p, q, r are odd, and , then ;
- (viii)
If all p, q, r are odd and then .
Then, S is a vertex metric generator in
Proof. First, we introduce some notation. For a vertex , we denote by the partition of according to the distances from a. That is, if are in the same set of , then . To prove that is a vertex metric generator in G, it suffices to show that for every pair of vertices from a common set of . Proceeding by way of contradiction, if , then the shortest path from b to x cannot contain a path from b to and vice versa. This simplifies our consideration since contains only two branching vertices (i.e., vertices of degree at least 3). Let us now consider each of the eight cases separately:
(i) For the vertex
we have
We have to show that the other vertex of
i.e.,
distinguishes all pairs of vertices from a common set of
The first type of set in
that contains at least one pair of vertices is
so we have to show that
and
are distinguished by
and that follows from
The next set from
to consider is of the type
where we have
where the last two expressions have place only if
. Therefore, all pairs of vertices from that set are distinguished by
. Notice that the inequality covers also the last type of set from
. Furthermore, observe that we did not use the fact that
here, so the proof covers all cases when one of
is odd and at least 3 and one of
is even.
(ii) Analogously, as in (i), we have
It remains to show that
u distinguishes all pairs of vertices that belong to a common set of
. This is seen from
and
.
(iii) We have
(Observe that the third set has just three vertices if
, and the last set has just one vertex if
.) We show that
distinguishes all pairs of vertices from a common set of
. Regarding set
, notice that
The next sets of
are of the form
, where
and assuming that
does not distinguish the other possible pairs leads to a contradiction, namely
implies
and
, a contradiction;
implies
and
, but such
exists only if
, a contradiction;
implies
and
, but such
i is over the limit for this set;
implies
or simplified
, a contradiction;
implies
and
, a contradiction.
For the last set of , we have , whenever , and for , the set is a singleton.
(iv) For
we have
Now, we consider the distances from
. Assuming
implies
, so
, a contradiction.
The next set to consider is of the form
. We have
which resolves three of the six possible pairs of vertices. For all other possible pairs, we assume that they are not distinguished by
and show that it leads to a contradiction. Namely,
implies
or simplified
, a contradiction;
implies
, which reduces to
, but such
i exceeds the limit for this set, since
;
implies
, which reduces to
, a contradiction.
For the last set of , if and , then and , a contradiction.
(v) The partition for
is
and for distances from
, we have
(vi) For
, we have
Now, consider the distances from
. Assume
implies
, which reduces to
, a contradiction.
In the next set
of
, there are three possible pairs of vertices, for which we have
where the last inequality holds if
, otherwise
, so there is no pair to be distinguished.
The next set from is of the type , where we first have , so the pair is distinguished by . For all remaining pairs of vertices from that set, we show that assuming they are not distinguished by leads to a contradiction. If , then and , a contradiction; if , then , which reduces to , but such i exceeds the limit since ; if , then and, therefore, , but such i exceeds the limit; if , then , which reduces to , a contradiction; finally, if , then , and therefore, , a contradiction.
As for the last type of set in , if and , then , and so, , a contradiction.
(vii) Observe that
Now, we consider the distances from
. If
, then
and
, a contradiction.
As for the set
we have
Therefore, all three pairs of vertices from this set are distinguished by
.
For the next set of
, we first have
so
distinguishes
from all the other vertices in that set. If
, then
and
, a contradiction. If
, then
and
, but such
i exceeds the limit. Finally,
implies
, which reduces to
, a contradiction.
For the last set of , if and , then and , a contradiction.
(viii) Observe that
Hence,
(and also,
) does not depend on the parity of
p. Therefore, analogous to case (v), one can show that
is a vertex metric generator in this case. □
Using Lemma 5, we can prove that all -graphs not mentioned in the previous section have metric dimension 2.
Theorem 2. Let G be a Θ-graph such that and with Then,
Proof. It is sufficient to show that Lemma 5 includes all -graphs distinct from and . Cases (iii)-(v) of this lemma obviously include all -graphs distinct from and in which all three parameters p, q, and r are even. Similarly, cases (vi)–(viii) of the same lemma include all -graphs in which all three parameters are odd. It remains to show that cases (i)–(ii) cover all -graphs in which p, q, and r do not have the same parity. In that case, at least one of the parameters is odd. If none of the parameters is equal to one, then Lemma 5. (i) covers the cases. If there is parameter equal to 1, then , since . Since G has no parallel edges, . Hence, if one of q and r is odd, then this parameter is at least 3 and the other parameter is even, which is covered by Lemma 5. (i) again. The only remaining case when and both q and r are even is covered by Lemma 5. (ii). □
As regards the motivating question for this investigation, Theorem 2 yields the following corollary.
Corollary 3. Let G be a Θ-graph such that and . Then, .
Now, we consider the edge metric dimension of
-graphs. We proceed analogously as in the case of vertex metric dimension. The edge metric generators from the following lemma are illustrated in
Figure 3.
Lemma 6. Let where , and let S be a set of vertices in G defined in the following way:
- (i)
If , , and is even, then ;
- (ii)
If , , and is odd, then ;
- (iii)
If , , and , then ;
- (iv)
If and , then ;
- (v)
If and , then .
Then, S is an edge metric generator in G.
Proof. The proof is analogous to the proof of Lemma 5. Let a be a vertex in G. By , we denote the partition of according to the distances from a. To prove that is an edge metric generator for G, it suffices to show that for every pair of edges from a common set of . Furthermore, to abbreviate the notation, an edge will be denoted by or and a similar notation will be used for edges and . We now consider each of the five cases separately:
(i) Denote
and
. Then, for
, we have
Next, we suppose that
has the same distance to a pair of edges from a common set of
, and we always come to a contradiction. Here, and in the next cases, the first distance is denoted by
and the second distance is denoted by
.
Let us first consider the set from If , then . Further, (otherwise, ), and so, . Consequently, , and therefore, , which contradicts .
Let us now consider the set
and the distances from
to the three possible pairs of edges from this set. If
, then
, since
. Analogously,
. Thus,
and
, a contradiction. The next pair is
and
where assuming
yields
and
. Thus,
which reduces to
, a contradiction. The last pair is
and
in which case
implies
, and so,
and
. This gives
and
, a contradiction.
It remains to consider the set . Assuming yields . However, and . Therefore, , a contradiction.
(ii) Since
, we have
. Since
, we have
. Hence,
. Denote
and
. Then, for
, we have
For each of the sets from
, we now show that all possible pairs of edges from that set are distinguished by
. Let us first consider the set
. Assuming
, analogous as in (i), we obtain
, which contradicts
.
Now, consider
. If
, then analogously as in (i), we obtain
, a contradiction. If
, then
and
. Thus,
which reduces to
, a contradiction. Finally, if
, then
and
. Thus,
and hence,
, a contradiction.
For edges from , we have and , so that . If , then . Therefore, , and consequently, , a contradiction. Finally, if , then . Therefore, , and consequently, , a contradiction.
Finally, consider
. Assuming
yields
a contradiction.
(iii) Notice that, in this case,
, where
. For
, the partition is
First, consider the set
. Since
, we have
, so
and
are distinguished by
.
Now, consider
. Since
all three pairs are distinguished by
Finally, for
, we have
(iv) Observe that
First, for the unique pair from
, it holds that
if
, so it is distinguished by
.
Next, consider
. Suppose that
. If
, then
, and consequently,
, a contradiction. Hence,
and
a contradiction. For the second pair
and
, since
, we have
For the last pair
and
we assume that
. We distinguish three subcases:
- -
If , then ;
- -
If , then ;
- -
If , then .
Now, we consider the set
. We have
where the last inequality is an equality only if
.
Finally, for , suppose that . Then, , and so, . Thus, and , a contradiction.
(v) Observe that
First, consider the set
. Since
, we have
.
Next, consider the set
. We have
where the last inequality is an equality only if
and the first equality is a consequence of
.
Now, consider the set
. We have
where the last inequality holds since
.
Finally, consider the set . If , then , and so, . Thus, and , a contradiction. This concludes the proof. □
The following statement is a consequence of Lemma 6.
Theorem 3. Let G be a Θ-graph such that and for and . Then, .
Proof. First suppose that . If is even, then , so Lemma 6. (i) covers this case. On the other hand, if is odd, then , so Lemma 6. (ii) and Lemma 6. (iii) cover all cases except .
Now, suppose that . Then, Lemma 6. (v) covers all cases, except , , and . These remaining cases are covered by Lemma 6. (iv) when . Hence, uncovered cases are , , , , , and . □
Supporting our motivation, Theorem 3 yields the following corollary.
Corollary 4. Let G be a Θ-graph such that and for and . Then,
4. Further Work
In this paper, we investigated Conjecture 3 (respectively Conjecture 4), which states that the vertex (respectively the edge) metric dimension of a graph
with
is bounded above by
. It was established in [
26] that the conjectures hold for cacti without leaves and that, for other leafless graphs, the problem reduces to 2-connected graphs, i.e., if the conjectures hold for 2-connected graphs distinct from a cycle, then they hold in general. In this paper, we considered
-graphs, since they are the most simple 2-connected graphs distinct from cycles. We established that Conjectures 3 and 4 hold on this class of graphs, and we characterized all
-graphs for which the upper bound is attained.
Besides -graphs attaining the upper bound , it was previously established that the same upper bound is also attained by metric dimensions of some leafless cacti. To be more precise, a daisy graph is any graph consisting of at least two cycles that all share the same vertex. A cycle in a daisy graph is also called a petal. Now, it was established that attains the bound if G is a daisy graph without odd petals and that reaches the same bound for any daisy graph G. We expect that these graphs are the only graphs with whose metric dimensions reach the bound. Therefore, we conclude the paper by stating the following two conjectures.
Conjecture 5. Let G be a connected graph with . Then, if and only if G is a daisy graph without odd petals, or
Conjecture 6. Let G be a connected graph with . Then, if and only if G is a daisy graph, or with and
Similar as with Conjectures 3 and 4, we show in the next proposition that the above two conjectures reduce to the same problem on 2-connected graphs. In order to do so, we use a result from [
26], which states that
where
is the complete list of blocks of
G.
Proposition 2. If Conjecture 5 (respectively Conjecture 6) holds for 2-connected graphs, then it holds in general.
Proof. We say that G is vertex extremal, if or We say G is edge extremal if or for and Now, let G be a graph with , which is not 2-connected. According to Lemma 1, the equality (respectively ) may hold only when every non-trivial block of G distinct from a cycle is vertex extremal (respectively edge extremal) and all blocks of G share a vertex.
We shall now construct a vertex (respectively an edge) metric generator in such a graph whose size is smaller than which is sufficient to prove the claim. Let v be a vertex of G shared by all blocks in Let us assume are all non-trivial blocks in G denoted so that is a cycle whenever According to Lemma 3 (respectively Lemma 4), for , there is a vertex (respectively an edge) metric generator in such that and for such i, let us denote . For let consist of a single vertex, which is a neighbor of v in Now, let Observe that the set S distinguishes in G all pairs of vertices (respectively edges) that belong to the same block of G; this follows from the fact that a pair of vertices (respectively edges) that is distinguished by v in is in G distinguished by every vertex
By the above, a pair of vertices (respectively edges)
x and
is not distinguished by
S in
G only if
x belongs to
and
belongs to
,
. In such a case, we say
and
are
critically incident. Therefore, let
and
be critically incident with
,
such that
x and
are not distinguished by
S. Let further
and
. Then,
and
. Denote
,
,
and
. Then,
and so, a shortest path from
x (respectively
) to every vertex from
(respectively
) leads through
v. Hence,
and
.
If , then let (respectively ) be a neighbor of x (respectively ) on a shortest path from v to x (respectively ). Then, for every , we have , so and are not distinguished by S as well.
Finally, let and be another pair of vertices that is not distinguished by S, , and , and let . Then, x and are not distinguished by , which means that and, analogously, .
Thus, vertices , for which there exists such that is a pair not distinguished by S, form a path starting at a neighbor of v. Denote this neighbor by z. If there is such that and are critically incident as well, then, again, vertices , for which there exists such that is a pair not distinguished by S, form a path starting at z. Therefore, it is sufficient to add z to , and all pairs of vertices from and (as well as from and ) will be distinguished.
We conclude that it is sufficient to introduce to
S at most
vertices, and all pairs
x and
from distinct blocks will also be distinguished by
Consequently, since
, we have
which is obviously smaller than
for
If
then
G is a cactus graph, and for cacti, it was already established that the bound is attained only for daisy graphs without odd petals. The proof for
is analogous. □