This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Vertex and edge metric dimensions of cacti

Jelena Sedlar1,3,
Riste Škrekovski2,3
1 University of Split, Faculty of civil engineering, architecture and geodesy, Croatia
2 University of Ljubljana, FMF, 1000 Ljubljana, Slovenia
3 Faculty of Information Studies, 8000 Novo Mesto, Slovenia
Abstract

In a graph G,G, a vertex (resp. an edge) metric generator is a set of vertices SS such that any pair of vertices (resp. edges) from GG is distinguished by at least one vertex from S.S. The cardinality of a smallest vertex (resp. edge) metric generator is the vertex (resp. edge) metric dimension of G.G. In [19] we determined the vertex (resp. edge) metric dimension of unicyclic graphs and that it takes its value from two consecutive integers. Therein, several cycle configurations were introduced and the vertex (resp. edge) metric dimension takes the greater of the two consecutive values only if any of these configurations is present in the graph. In this paper we extend the result to cactus graphs i.e. graphs in which all cycles are pairwise edge disjoint. We do so by defining a unicyclic subgraph of GG for every cycle of GG and applying the already introduced approach for unicyclic graphs which involves the configurations. The obtained results enable us to prove the cycle rank conjecture for cacti. They also yield a simple upper bound on metric dimensions of cactus graphs and we conclude the paper by conjecturing that the same upper bound holds in general.

Keywords: vertex metric dimension; edge metric dimension; cactus graphs, zero forcing number, cycle rank conjecture.

AMS Subject Classification numbers: 05C12; 05C76

1 Introduction

The concept of metric dimension was first studied in the context of navigation system in various graphical networks [7]. There the robot moves from one vertex of the network to another, and some of the vertices are considered to be a landmark which helps a robot to establish its position in a network. Then the problem of establishing the smallest set of landmarks in a network becomes a problem of determining a smallest metric generator in a graph [12].

Another interesting application is in chemistry where the structure of a chemical compound is frequently viewed as a set of functional groups arrayed on a substructure. This can be modeled as a labeled graph where the vertex and edge labels specify the atom and bond types, respectively, and the functional groups and substructure are simply subgraphs of the labeled graph representation. Determining the pharmacological activities related to the feature of compounds relies on the investigation of the same functional groups for two different compounds at the same point [3]. Various other aspects of the notion were studied [1, 5, 13, 15] and a lot of research was dedicated to the behaviour of metric dimension with respect to various graph operations [2, 3, 17, 23].

In this paper, we consider only simple and connected graphs. By d(u,v)d(u,v) we denote the distance between a pair of vertices uu and vv in a graph GG. A vertex ss from GG distinguishes or resolves a pair of vertices uu and vv from GG if d(s,u)d(s,v).d(s,u)\not=d(s,v). We say that a set of vertices SV(G)S\subseteq V(G) is a vertex metric generator, if every pair of vertices in GG is distinguished by at least one vertex from S.S. The vertex metric dimension of G,G, denoted by dim(G),\mathrm{dim}(G), is the cardinality of a smallest vertex generator in GG. This variant of metric dimension, as it was introduced first, is sometimes called only metric dimension and the prefix ”vertex” is omitted.

In [11] it was noticed that there are graphs in which none of the smallest metric generators distinguishes all pairs of edges, so this was the motivation to introduce the notion of the edge metric generator and dimension, particularly to study the relation between dim(G)\mathrm{dim}(G) and edim(G).\mathrm{edim}(G).

The distance d(u,vw)d(u,vw) between a vertex uu and an edge vwvw in a graph GG is defined by d(u,vw)=min{d(u,v),d(u,w)}.d(u,vw)=\min\{d(u,v),d(u,w)\}. Recently, two more variants of metric dimension were introduced, namely the edge metric dimension and the mixed metric dimension of a graph G.G. Similarly as above, a vertex sV(G)s\in V(G) distinguishes two edges e,fE(G)e,f\in E(G) if d(s,e)d(s,f).d(s,e)\neq d(s,f). So, a set SV(G)S\subseteq V(G) is an edge metric generator if every pair of vertices is distinguished by at least one vertex from S,S, and the cardinality of a smallest such set is called the edge metric dimension and denoted by edim(G).\mathrm{edim}(G). Finally, a set SV(G)S\subseteq V(G) is a mixed metric generator if it distinguishes all pairs from V(G)E(G),V(G)\cup E(G), and the mixed metric dimension, denoted by mdim(G)\mathrm{mdim}(G), is defined as the cardinality of a smallest such set in GG.

This new variant also attracted a lot of attention [6, 8, 16, 24, 25, 26], with one particular direction of research being the study of unicyclic graphs and the relation of the two dimensions on them [14, 18, 19]. The mixed metric dimension is then a natural next step, as it unifies these two concepts. It was introduced in [10] and further studied in [21, 20]. A wider and systematic introduction to these three variants of metric dimension can be found in [9].

In this paper we establish the vertex and the edge metric dimension of cactus graph, using the approach from [19] where the two dimensions were established for unicyclic graphs. The extension is not straightforward, as in cactus graphs a problem with indistinguishable pairs of edges and vertices may arise from connecting two cycles, so additional condition will have to be introduced.

2 Preliminaries

A cactus graph is any graph in which all cycles are pairwise edge disjoint. Let GG be a cactus graph with cycles C1,,CcC_{1},\ldots,C_{c} and let gig_{i} denote the length of a cycle CiC_{i} in G.G. For a vertex vv of a cycle Ci,C_{i}, denote by Tv(Ci)T_{v}(C_{i}) the connected component of GE(Ci)G-E(C_{i}) which contains v.v. If GG is a unicyclic graph, then Tv(Ci)T_{v}(C_{i}) is a tree, otherwise Tv(Ci)T_{v}(C_{i}) may contain a cycle. When no confusion arises from that, we will use the abbreviated notation Tv.T_{v}. A thread hanging at a vertex vV(G)v\in V(G) of degree 3\geq 3 is any path u1u2uku_{1}u_{2}\cdots u_{k} such that u1u_{1} is a leaf, u2,,uku_{2},\ldots,u_{k} are of degree 2,2, and uku_{k} is connected to vv by an edge. The number of threads hanging at vv is denoted by (v).\ell(v).

We say that a vertex vV(Ci)v\in V(C_{i}) is branch-active if deg(v)4\deg(v)\geq 4 or TvT_{v} contains a vertex of degree 3\geq 3 distinct from vv. We denote the number of branch-active vertices on CiC_{i} by b(Ci).b(C_{i}). If a vertex vv from a cycle CiC_{i} is branch-active, then TvT_{v} contains both a pair of vertices and a pair of edges which are not distinguished by any vertex outside TvT_{v}, see Figure 1.

Refer to caption
Figure 1: A cactus graph with two cycles. On the cycle CC vertices vv and ww are branch-active, and a pair of vertices is marked in TvT_{v} and TwT_{w} which is not distinguished by any vertex outside TvT_{v} and TwT_{w}, respectively.

Now, we will introduce a property called ”branch-resolving” which a set of vertices SV(G)S\subseteq V(G) must possess in order to avoid this problem of non distinguished vertices (resp. edges) due to branching. First, a thread hanging at a vertex vv of degree 3\geq 3 is SS-free if it does not contain a vertex from S.S. Now, a set of vertices SV(G)S\subseteq V(G) is branch-resolving if at most one SS-free thread is hanging at every vertex vV(G)v\in V(G) of degree 3\geq 3. Therefore, for every branch-resolving set SS it holds that |S|L(G)\left|S\right|\geq L(G) where

L(G)=vV(G),(v)>1((v)1).L(G)=\sum_{v\in V(G),\ell(v)>1}(\ell(v)-1).

It is known in literature [11, 12] that for a tree TT it holds that dim(G)=edim(G)=L(G).\mathrm{dim}(G)=\mathrm{edim}(G)=L(G).

Also, given a set of vertices SV(G),S\subseteq V(G), we say that a vertex vV(Ci)v\in V(C_{i}) is SS-active if TvT_{v} contains a vertex from S.S. The number of SS-active vertices on a cycle CiC_{i} is denoted by aS(Ci).a_{S}(C_{i}). If aS(Ci)2a_{S}(C_{i})\geq 2 for every cycle CiC_{i} in G,G, then we say the set SS is biactive. For a biactive branch-resolving set SS the following holds: if a vertex vv from a cycle CiC_{i} is branch-active, then TvT_{v} contains a vertex with two threads hanging at it or TvT_{v} contains a cycle, either way TvT_{v} contains a vertex from S,S, so vv is SS-active. Therefore, for a biactive branch-resolving set SS we have aS(Ci)b(Ci)a_{S}(C_{i})\geq b(C_{i}) for every ii.

Lemma 1

Let GG be a cactus graph and let SV(G)S\subseteq V(G) be a set of vertices in G.G. If SS is a vertex (resp. an edge) metric generator, then SS is a biactive branch-resolving set.

Proof. Suppose to the contrary that a vertex (resp. an edge) metric generator SS is not a biactive branch-resolving set. If SS is not branch-resolving, then there exists a vertex vv of degree 3\geq 3 and two threads hanging at vv which do not contain a vertex from S.S. Let v1v_{1} and v2v_{2} be two neighbors of v,v, each belonging to one of these two threads. Then v1v_{1} and v2v_{2} (resp. v1vv_{1}v and v2vv_{2}v) are not distinguished by S,S, a contradiction.

Assume now that SS is not biactive. We may assume that GG has at least one cycle, otherwise GG is a tree and there is nothing to prove. Notice that an empty set SS cannot be either a vertex or an edge metric generator in a cactus graph unless G=K2G=K_{2} but then it is a tree. Therefore, if SS is not biactive, there must exist a cycle CiC_{i} with precisely one SS-active vertex vv and let v1v_{1} and v2v_{2} be the two neighbors of vv on Ci.C_{i}. Then v1v_{1} and v2v_{2} (resp. v1vv_{1}v and v2vv_{2}v) are not distinguished by S,S, a contradiction.    

The above lemma gives us a necessary condition for SS to be a vertex (resp. an edge) metric generator in a cactus graph. In [19], a more elaborate condition for unicyclic graphs was established, which is both necessary and sufficient. In this paper we will extend that condition to cactus graphs, but to do so we first need to introduce the following definitions from [19]. Let CiC_{i} be a cycle in a cactus graph GG and let vi,v_{i}, vjv_{j} and vkv_{k} be three vertices of Ci,C_{i}, we say that vi,v_{i}, vjv_{j} and vkv_{k} are a geodesic triple on CiC_{i} if

d(vi,vj)+d(vj,vk)+d(vi,vk)=|V(Ci)|.d(v_{i},v_{j})+d(v_{j},v_{k})+d(v_{i},v_{k})=|V(C_{i})|.

It was shown in [18] that a biactive branch-resolving set with a geodesic triple of SS-active vertices on every cycle is both a vertex and an edge metric generator. This result is useful for bounding the dimensions from above. Also, we need the definition of the five graph configurations from [19].

a) Refer to captionb) Refer to captionc) Refer to captiond) Refer to captione) Refer to captionf) Refer to caption\begin{array}[c]{ll}\text{a) \raisebox{-10.0pt}{\includegraphics[scale={0.8}]{Figure07.pdf}}}&\text{b) \raisebox{-10.0pt}{\includegraphics[scale={0.8}]{Figure08.pdf}}}\\ \text{c) \raisebox{-10.0pt}{\includegraphics[scale={0.8}]{Figure09.pdf}}}&\text{d) \raisebox{-10.0pt}{\includegraphics[scale={0.8}]{Figure10.pdf}}}\\ \text{e) \raisebox{-10.0pt}{\includegraphics[scale={0.8}]{Figure11.pdf}}}&\text{f) \raisebox{-10.0pt}{\includegraphics[scale={0.8}]{Figure12.pdf}}}\end{array}

Figure 2: All six graphs shown in this figure are unicyclic graphs with a biactive branch-resolving set SS\ comprised of vertices sis_{i}. Vertices on a cycle which are SS-active are marked by a dashed circle and connected to its antipodal vertices by a dashed line. Each graph in this figure contains at least one of the five configurations, namely: a) 𝒜\mathcal{A}, b) \mathcal{B} and also 𝒟,\mathcal{D}, c) 𝒞\mathcal{C}, d) 𝒟,\mathcal{D}, e) \mathcal{E} on even cycle and also 𝒞\mathcal{C}, f) \mathcal{E} on odd cycle. A pair xx and xx^{\prime} of undistinguished vertices and/or edges is highlighted in each of the graphs. Notice that the graph in b) which contains \mathcal{B} consequently also contains 𝒟,\mathcal{D}, but graph in d) which contains 𝒟\mathcal{D} does not contain .\mathcal{B}. Similarly, the graph in e) which contains \mathcal{E} also contains 𝒞,\mathcal{C}, but the graph from c) which contains 𝒞\mathcal{C} does not contain \mathcal{E}.
Definition 2

Let GG be a cactus graph, CC a cycle in GG of the length gg, and SS a biactive branch-resolving set in GG. We say that C=v0v1vg1C=v_{0}v_{1}\cdots v_{g-1} is canonically labeled with respect to SS if v0v_{0} is SS-active and k=max{i:vik=\max\{i:v_{i} is SS-active}\} is as small as possible.

Let us now introduce five configurations which a cactus graph can contain with respect to a biactive branch-resolving set S.S. All these configurations are illustrated by Figure 2.

Definition 3

Let GG be a cactus graph, CC a canonically labeled cycle in GG of the length gg, and SS a biactive branch-resolving set in GG. We say that the cycle CC with respect to SS contains configurations:

𝒜\mathcal{A}. If aS(C)=2a_{S}(C)=2, gg is even, and k=g/2k=g/2;

\mathcal{B}. If kg/21k\leq\left\lfloor g/2\right\rfloor-1 and there is an SS-free thread hanging at a vertex viv_{i} for some i[k,g/21][g/2+k+1,g1]{0}i\in[k,\left\lfloor g/2\right\rfloor-1]\cup[\left\lceil g/2\right\rceil+k+1,g-1]\cup\{0\};

𝒞\mathcal{C}. If aS(C)=2a_{S}(C)=2, gg is even, kg/2k\leq g/2 and there is an SS-free thread of the length g/2k\geq g/2-k hanging at a vertex viv_{i} for some i[0,k]i\in[0,k];

𝒟\mathcal{D}. If kg/21k\leq\left\lceil g/2\right\rceil-1 and there is an SS-free thread hanging at a vertex viv_{i} for some i[k,g/21][g/2+k+1,g1]{0}i\in[k,\left\lceil g/2\right\rceil-1]\cup[\left\lfloor g/2\right\rfloor+k+1,g-1]\cup\{0\};

\mathcal{E}. If aS(C)=2a_{S}(C)=2 and there is an SS-free thread of the length g/2k+1\geq\left\lfloor g/2\right\rfloor-k+1 hanging at a vertex viv_{i} with i[0,k].i\in[0,k]. Moreover, if gg is even, an SS-free thread must be hanging at the vertex vjv_{j} with j=g/2+kij=g/2+k-i.

Refer to caption
Figure 3: A cactus graph GG from Example 1. A smallest biactive branch-resolving set S={s1,s2,s3,s4,s5}S=\{s_{1},s_{2},s_{3},s_{4},s_{5}\} is marked in the figure by squares. Vertices on the cycles which are SS-active are marked by a dashed circle. Since every cycle contains a configuration with respect to S,S, for each cycle CiC_{i} there is a pair of vertices and/or edges xix_{i} and xix_{i}^{\prime} which are not distinguished by S,S, these pairs are also highlighted in the figure.

Notice that only an even cycle can contain configuration 𝒜\mathcal{A} or 𝒞\mathcal{C}. Also, configurations \mathcal{B} and 𝒟\mathcal{D} are almost the same, they differ only if CC is odd where the index ii can take two more values in 𝒟\mathcal{D} than in .\mathcal{B}. Finally, for configurations 𝒜\mathcal{A}, 𝒞\mathcal{C}, and \mathcal{E} it holds that aS(C)=2,a_{S}(C)=2, so there are only two SS-active vertices on the cycle CC and hence no geodesic triple of SS-active vertices. On the other hand, for configurations \mathcal{B} and 𝒟\mathcal{D} there might be more than two SS-active vertices on the cycle C,C, but the bounds kg/21k\leq\left\lfloor g/2\right\rfloor-1 and kg/21k\leq\left\lceil g/2\right\rceil-1 again imply there is no geodesic triple of SS-active vertices on C.C. Therefore, we can state the following observation which is useful for constructing metric generators.

Observation 4

If there is a geodesic triple of SS-active vertices on a cycle CC of a cactus graph G,G, then CC does not contain any of the configurations 𝒜\mathcal{A}, \mathcal{B}, 𝒞\mathcal{C}, 𝒟\mathcal{D}, and \mathcal{E} with respect to S.S.

The following result regarding configurations 𝒜\mathcal{A}, \mathcal{B}, 𝒞\mathcal{C}, 𝒟\mathcal{D}, and \mathcal{E} was established for unicyclic graphs (see Lemmas 6, 7, 13 and 14 from [19]).

Theorem 5

Let GG be a unicyclic graph with the cycle CC and let SS be a biactive branch-resolving set in GG. The set SS is a vertex (resp. an edge) metric generator if and only if CC does not contain any of configurations 𝒜\mathcal{A}, \mathcal{B}, and 𝒞\mathcal{C} (resp. 𝒜\mathcal{A}, 𝒟\mathcal{D}, and \mathcal{E}) with respect to S.S.

In this paper we will extend this result to cactus graphs and then use it to determine the exact value of the vertex and the edge metric dimensions of such graphs. We first give an example how this approach with configurations can be extended to cactus graphs.

Example 1

Let GG be the cactus graph from Figure 3. The graph GG contains six cycles and the set S={s1,s2,s3,s4,s5}S=\{s_{1},s_{2},s_{3},s_{4},s_{5}\} is a smallest biactive branch-resolving set in GG. In the figure the set of SS-active vertices on each cycle is marked by a dashed circle. The cycle C1C_{1} (resp. C2C_{2}, C3C_{3}, C4C_{4}, C5C_{5}) with respect to SS contains configuration 𝒜\mathcal{A} (resp. \mathcal{B} and also 𝒟\mathcal{D}, 𝒞\mathcal{C}, \mathcal{E} on odd cycle, \mathcal{E} on even cycle), so in each of these cycles there is a pair of vertices and/or edges xix_{i} and xix_{i}^{\prime} which is not distinguished by S.S. The cycle C6C_{6} does not contain any of the five configurations as there is a geodesic triple of SS-active vertices on C6,C_{6}, so all pairs of vertices and all pair of edges in C6C_{6} are distinguished by SS.

Refer to caption
Figure 4: A cactus graph GG with three cycles in which the unicyclic region GiG_{i} of the cycle CiC_{i} is distinguished with b1b_{1} and b2b_{2} being the boundary vertices of GiG_{i}. The set S={s1,s2,s3}S=\{s_{1},s_{2},s_{3}\} is a smallest biactive branch-resolving set in GG for which a set of SS-active vertices is marked on each cycle. For the set S,S, the regional set in GiG_{i} is Si={s2,b1,b2}.S_{i}=\{s_{2},b_{1},b_{2}\}.

Besides this configuration approach, in cactus graphs an additional condition will have to be introduced for the situation when a pair of cycles share a vertex.

3 Metric generators in cacti

Let GG be a cactus graph with cycles C1,,Cc.C_{1},\ldots,C_{c}. We say that a vertex vV(G)v\in V(G) gravitates to a cycle CiC_{i} in GG if there is a path from vv to a vertex from CiC_{i} which does not share any edge nor any internal vertex with any cycle of G.G. A unicyclic region of the cycle CiC_{i} from GG is the subgraph GiG_{i} of GG induced by all vertices that gravitate to CiC_{i} in G.G. The notion of unicyclic region of a cactus graph is illustrated by Figure 4.

Notice that each unicyclic region GiG_{i} is a unicyclic graph with its cycle being Ci.C_{i}. Also, considering the example from Figure 4, one can easily notice that two distinct unicyclic regions may not be vertex disjoint, as the path connecting vertex b2b_{2} and the cycle CiC_{i} belongs both to GiG_{i} and Gj.G_{j}. But, it does hold that all unicyclic regions cover the whole G.G. We say that a subgraph HH of a graph GG is an isometric subgraph if dH(u,v)=dG(u,v)d_{H}(u,v)=d_{G}(u,v) for every pair of vertices u,vV(H).u,v\in V(H). The following observation is obvious.

Observation 6

The unicyclic region GiG_{i} of a cycle CiC_{i} is an isometric subgraph of G.G.

Finally, we say that a vertex vv from a unicyclic region GiG_{i} is a boundary vertex if vV(Cj)v\in V(C_{j}) for ji.j\not=i. In the example from Figure 4, the boundary vertices of the region GiG_{i} are b1b_{1} and b2b_{2}.

Let SS be a biactive branch-resolving set in GG and let GiG_{i} be a unicyclic region in G.G. For the set SS we define the regional set SiS_{i} as the set obtained from SV(Gi)S\cap V(G_{i}) by introducing all boundary vertices from GiG_{i} to SS. For example, in Figure 4 the set Si={s2,b1,b2}S_{i}=\{s_{2},b_{1},b_{2}\} is the regional set in the region of the cycle CiC_{i}.

Lemma 7

Let GG be a cactus graph with cc cycles C1,,CcC_{1},\ldots,C_{c} and let SV(G)S\subseteq V(G). If SS is a vertex (resp. edge) metric generator in G,G, then the regional set SiS_{i} is a vertex (resp. edge) metric generator in the unicyclic region GiG_{i} for every i{1,,c}i\in\{1,\ldots,c\}.

Proof. Suppose first that there is a cycle CiC_{i} in GG such that the regional set SiS_{i} is not a vertex (resp. an edge) metric generator in the unicyclic region Gi.G_{i}. This implies that there exists a pair of vertices (resp. edges) xx and xx^{\prime} in GiG_{i} which are not distinguished by Si.S_{i}. We will show that xx and xx^{\prime} are not distinguished by SS in GG either. Suppose the contrary, i.e. there is a vertex sSs\in S which distinguishes xx and xx^{\prime} in G.G. If sV(Gi),s\in V(G_{i}), then sSi.s\in S_{i}. Since GiG_{i} is an isometric subgraph of G,G, then xx and xx^{\prime} would be distinguished by sSis\in S_{i} in Gi,G_{i}, a contradiction. Assume therefore that sV(Gi).s\not\in V(G_{i}). Notice that the shortest path from every vertex (resp. edge) in GiG_{i} to ss leads through a same boundary vertex bb in Gi.G_{i}. The definition of SiS_{i} implies bSi,b\in S_{i}, so xx and xx^{\prime} are not distinguished by b.b. Therefore, we obtain

d(x,s)=d(x,b)+d(b,s)=d(x,b)+d(b,s)=d(x,s),d(x,s)=d(x,b)+d(b,s)=d(x^{\prime},b)+d(b,s)=d(x^{\prime},s),

so xx and xx^{\prime} are not distinguished by ss in G,G, a contradiction.    

Notice that the condition from Lemma 7 is necessary for SS to be a metric generator, but it is not sufficient as is illustrated by the graph shown in Figure 5 in which every regional set SiS_{i} is a vertex (resp. an edge) metric generator in the corresponding region GiG_{i}, but there still exists a pair of vertices (resp. edges) which is not distinguished by S,S, so SS is not a vertex (resp. an edge) metric generator in GG.

Refer to caption
Figure 5: A cactus graph GG with three cycles and a smallest biactive branch-resolving set S={s1,s2}S=\{s_{1},s_{2}\} in G.G. Every regional set SiS_{i} is a vertex (resp. an edge) metric generator in the corresponding region GiG_{i}, but still a pair of vertices v1v_{1} and v2v_{2} is not distinguished by SS. The pair of edges v1vv_{1}v and v2vv_{2}v is also not distinguished by SS and the same holds for the pair of edges w1ww_{1}w and w2w.w_{2}w.

Next, we will introduce notions which are necessary to state a condition which will be both necessary and sufficient for a biactive branch-resolving set SS to be a vertex (resp. an edge) metric generator in a cactus graph G.G. An SS-path of the cycle CiC_{i} is any subpath of CiC_{i} which contains all SS-active vertices on CiC_{i} and is of minimum possible length. We denote an SS-path of the cycle CiC_{i} by PiP_{i}. Notice that the end-vertices of an SS-path are always SS-active, otherwise it would not be shortest. For example, on the cycle C2C_{2} in Figure 5 there are two different paths connecting SS-active vertices vv and w,w, one is of the length 33 and the other of length 5,5, so the shorter one is an SS-path. Also, an SS-path PiP_{i} of a cycle CiC_{i} may not be unique, as there may exist several shortest subpaths of CiC_{i} containing all SS-active vertices on Ci,C_{i}, but if the length of PiP_{i} satisfies |Pi|gi/21\left|P_{i}\right|\leq\left\lceil g_{i}/2\right\rceil-1 then PiP_{i} is certainly unique and its end-vertices are v0v_{0} and vkv_{k} in the canonical labelling of Ci.C_{i}.

Definition 8

Let GG be a cactus graph with cycles C1,,CcC_{1},\ldots,C_{c} and let SS be a biactive branch-resolving set in G.G. We say that a vertex vV(Ci)v\in V(C_{i}) is vertex-critical (resp. edge-critical) on CiC_{i} with respect to SS if vv is an end-vertex of PiP_{i} and |Pi|gi/21\left|P_{i}\right|\leq\left\lfloor g_{i}/2\right\rfloor-1 (resp. |Pi|gi/21\left|P_{i}\right|\leq\left\lceil g_{i}/2\right\rceil-1).

Notice that the notion of a vertex-critical and an edge-critical vertex differs only on odd cycles. We say that two distinct cycles CiC_{i} and CjC_{j} of a cactus graph GG are vertex-critically incident (resp. edge-critically incident) with respect to SS if CiC_{i} and CjC_{j} share a vertex vv which is vertex-critical (resp. edge-critical) with respect to SS on both CiC_{i} and CjC_{j}. Notice that on odd cycles the required length of an SS-path PiP_{i} for vv to be vertex-critical differs from the one required for vv to be edge-critical, while on even cycles the required length is the same.

To illustrate this notion, let us consider the cycle C2C_{2} in the graph from Figure 5. Vertices vv and ww are both vertex-critical and edge-critical on C2C_{2} with respect to SS from the figure. Vertex vv belongs also to C1C_{1} and it is also both vertex- and edge-critical on C1.C_{1}. Therefore, cycles C1C_{1} and C2C_{2} are both vertex- and edge-critically incident, the consequence of which is that a pair of vertices v1v_{1} and v2v_{2} which are neighbors of vv and a pair of edges v1vv_{1}v and v2vv_{2}v which are incident to vv are not distinguished by S.S. On the other hand, vertex ww belongs also to C3C_{3} on which it is edge-critical, but it is not vertex-critical since P3P_{3} is not short enough. So, C2C_{2} and C3C_{3} are edge-critically incident, but not vertex-critically incident. Consequently, a pair of edges w1ww_{1}w and w2ww_{2}w is not distinguished by S,S, but a pair of vertices w1w_{1} and w2w_{2} is distinguished by S.S. We will show in the following lemma that this holds in general.

Lemma 9

Let GG be a cactus graph with cc cycles C1,,CcC_{1},\ldots,C_{c} and let SS be a biactive branch-resolving set in GG. If SS is a vertex (resp. an edge) metric generator in G,G, then there is no pair of cycles in GG which are vertex-critically (resp. edge critically) incident with respect to SS.

Proof. Let SS be a vertex (resp. an edge) metric generator in G.G. Suppose the contrary, i.e. there are two distinct cycles CiC_{i} and CjC_{j} in GG which are vertex-critically (resp. edge-critically) incident with respect to SS. This implies that CiC_{i} and CjC_{j} share a vertex vv which is vertex-critical (resp. edge-critical) on both CiC_{i} and CjC_{j}. Let xx and xx^{\prime} be a pair of vertices (resp. edges) which are neighbors (resp. incident) to vv on cycles CiC_{i} and CjC_{j} respectively, but which are not contained on paths PiP_{i} and Pj.P_{j}. The length of paths PiP_{i} and PjP_{j} which is required by the definition of a vertex-critical (resp. edge-critical) vertex implies that a shortest path from both xx and xx^{\prime} to all vertices from PiP_{i} and PjP_{j} leads through v.v. Since PiP_{i} and PjP_{j} contain all SS-active vertices on CiC_{i} and Cj,C_{j}, this further implies that a shortest path from both xx and xx^{\prime} to all vertices from SS leads through v.v. Since d(x,v)=d(x,v)d(x,v)=d(x^{\prime},v), it follows that xx and xx^{\prime} are not distinguished by S,S, a contradiction.    

Each of Lemmas 7 and 9 gives a necessary condition for a biactive branch-resolving set SS to be a vertex (resp. an edge) metric generator in a cactus graph GG. Let us now show that these two necessary conditions taken together form a sufficient condition for SS to be a vertex (resp. an edge) metric generator.

Lemma 10

Let GG be a cactus graph with cc cycles C1,,CcC_{1},\ldots,C_{c} and let SS be a biactive branch-resolving set in GG. If a regional set SiS_{i} is a vertex (resp. an edge) metric generator in the unicyclic region GiG_{i} for every i=1,,ci=1,\ldots,c and there are no vertex-critically (resp. edge-critically) incident cycles in G,G, then SS is a vertex (resp. an edge) metric generator in G.G.

Proof. Let xx and xx^{\prime} be a pair of vertices (resp. edges) from G.G. We want to show that SS distinguishes xx and x.x^{\prime}. In order to do so, we distinguish the following two cases.

Case 1: xx and xx^{\prime} belong to a same unicyclic region GiG_{i} of G.G. Since the regional set SiS_{i} is a vertex (resp. an edge) metric generator in Gi,G_{i}, there is a vertex sSis\in S_{i} which distinguishes xx and xx^{\prime} in Gi.G_{i}. If sS,s\in S, then the fact that GiG_{i} is an isometric subgraph of GG implies that the pair xx and xx^{\prime} is distinguished by the same ss in GG as well. Assume therefore that sS,s\not\in S, so the definition of the regional set SiS_{i} implies that ss is a boundary vertex of Gi.G_{i}. Let sSs^{\prime}\in S be a vertex in GG such that the shortest path from ss^{\prime} to both xx and xx^{\prime} leads through the boundary vertex s.s. Recall that such a vertex ss^{\prime} must exist since SS is biactive. The fact that ss distinguishes xx and xx^{\prime} in GiG_{i}, implies d(x,s)d(x,s),d(x,s)\not=d(x^{\prime},s), which further implies

d(x,s)=d(x,s)+d(s,s)d(x,s)+d(s,s)=d(x,s),d(x,s^{\prime})=d(x,s)+d(s,s^{\prime})\not=d(x^{\prime},s)+d(s,s^{\prime})=d(x^{\prime},s^{\prime}),

so the pair xx and xx^{\prime} is distinguished by SS in GG.

Case 2: xx and xx^{\prime} do not belong to a same unicyclic region of G.G. Let us assume that xx belongs to GiG_{i} and xx^{\prime} does not belong to Gi,G_{i}, and say it belongs to GjG_{j} for jij\not=i. If xx and xx^{\prime} are distinguished by a vertex sSV(Gi),s\in S\cap V(G_{i}), then the claim is proven, so let us assume that xx and xx^{\prime} are not distinguished by any sSV(Gi).s\in S\cup V(G_{i}). Since xx and xx^{\prime} do not belong to a same unicyclic region, there exists a boundary vertex bb of the unicyclic region GiG_{i} such that the shortest path from xx to xx^{\prime} leads through b.b. Let sbs_{b} be a vertex from SS such that the shortest path from xx to sbs_{b} also leads through b,b, which must exist since SS is biactive. We want to prove that xx and xx^{\prime} are distinguished by sb.s_{b}. Let us suppose the contrary, i.e. d(x,sb)=d(x,sb).d(x,s_{b})=d(x^{\prime},s_{b}). Then we have the following

d(x,b)+d(b,sb)=d(x,sb)=d(x,sb)d(x,b)+d(b,sb),d(x,b)+d(b,s_{b})=d(x,s_{b})=d(x^{\prime},s_{b})\leq d(x^{\prime},b)+d(b,s_{b}),

from which we obtain

d(x,b)d(x,b).d(x,b)\leq d(x^{\prime},b). (1)

Now, we distinguish the following two subcases.

Subcase 2.a: bb does not belong to V(Ci).V(C_{i}). Notice that by the definition of the unicyclic region, any acyclic structure hanging at bb in GG is not included in GiG_{i}, as is illustrated by b2b_{2} from Figure 4, which implies bb is a leaf in Gi.G_{i}. Let bb^{\prime} be the only neighbor of bb in Gi.G_{i}. The inequality (1) further implies d(x,b)<d(x,b)d(x,b^{\prime})<d(x^{\prime},b^{\prime}) since xx belongs to GiG_{i} and xx^{\prime} does not. Let v0v_{0} be the vertex from CiC_{i} closest to b,b, which implies v0v_{0} is SS-active on Ci.C_{i}. Let vkv_{k} be an SS-active vertex on CiC_{i} distinct from v0,v_{0}, such a vertex vkv_{k} must exist on CiC_{i} because we assumed SS is biactive. So, we have

d(x,vk)d(x,b)+d(b,vk)<d(x,b)+d(b,vk)=d(x,vk).d(x,v_{k})\leq d(x,b^{\prime})+d(b^{\prime},v_{k})<d(x^{\prime},b^{\prime})+d(b^{\prime},v_{k})=d(x^{\prime},v_{k}).

Let sks_{k} be a vertex from SS which belongs to the connected component of GE(Ci)G-E(C_{i}) containing vk.v_{k}. Then we have

d(x,sk)d(x,vk)+d(vk,sk)<d(x,vk)+d(vk,sk)=d(x,sk).d(x,s_{k})\leq d(x,v_{k})+d(v_{k},s_{k})<d(x^{\prime},v_{k})+d(v_{k},s_{k})=d(x^{\prime},s_{k}).

Therefore, SS distinguishes xx and x,x^{\prime}, so SS is a vertex (resp. an edge) metric generator in G.G.

Subcase 2.b: bb belongs to V(Ci).V(C_{i}). Since bb is a boundary vertex of the unicyclic region Gi,G_{i}, this implies there is a cycle Cl,C_{l}, for li,l\not=i, such that bV(Cl)b\in V(C_{l}). Therefore, cycles CiC_{i} and ClC_{l} share the vertex b.b. Notice that any acyclic structure hanging at bb belongs to both GiG_{i} and GlG_{l}, as is illustrated by b1b_{1} from Figure 4. If xx^{\prime} belongs to Gl,G_{l}, then neither xx nor xx^{\prime} can belong to an acyclic structure hanging at b,b, as we assumed that xx and xx^{\prime} do not belong to a same component. On the other hand, if xx^{\prime} does not belong to GlG_{l} and xx belongs to an acyclic structure hanging at b,b, then we switch GiG_{i} by GlG_{l} and assume that xx belongs to Gl.G_{l}. This way we assure that neither xx not xx^{\prime} belong to an acyclic structure hanging at b.b.

If d(x,b)<d(x,b),d(x,b)<d(x^{\prime},b), let vkv_{k} be an SS-active vertex on CiC_{i} distinct from b,b, which must exist as SS is biactive. From (1) we obtain

d(x,vk)d(x,b)+d(b,vk)<d(x,b)+d(b,vk)=d(x,vk),d(x,v_{k})\leq d(x,b)+d(b,v_{k})<d(x^{\prime},b)+d(b,v_{k})=d(x^{\prime},v_{k}),

so similarly as in previous subcase xx and xx^{\prime} are distinguished by a vertex skSs_{k}\in S which belongs to the connected component of GE(Ci)G-E(C_{i}) which contains vk.v_{k}.

Therefore, assume that d(x,b)=d(x,b).d(x,b)=d(x^{\prime},b). If a shortest path from xx to all SS-active vertices on CiC_{i} and a shortest path from xx^{\prime} to all SS-active vertices on ClC_{l} leads through b,b, then xx^{\prime} belongs to Cl,C_{l}, i.e. j=lj=l, and the pair of cycles CiC_{i} and ClC_{l} are vertex-critically (resp. edge-critically) incident, a contradiction. So, we may assume there is an SS-active vertex vkv_{k}, say on CiC_{i}, such that a shortest path from xx to vkv_{k} does not lead through b.b. Therefore,

d(x,vk)<d(x,b)+d(b,vk)=d(x,b)+d(b,vk)=d(x,vk).d(x,v_{k})<d(x,b)+d(b,v_{k})=d(x^{\prime},b)+d(b,v_{k})=d(x^{\prime},v_{k}).

But now, similarly as in previous cases we have that xx and xx^{\prime} are distinguished by a vertex skSs_{k}\in S which is contained in the connected component of GE(Ci)G-E(C_{i}) containing vk.v_{k}.    

Let us now relate these results with configurations 𝒜,\mathcal{A}, \mathcal{B}, 𝒞\mathcal{C}, 𝒟\mathcal{D} and \mathcal{E}.

Lemma 11

Let GG be a cactus graph and let SS be a biactive branch-resolving set in G.G. A cycle CiC_{i} of the graph GG contains configuration 𝒜\mathcal{A} (or \mathcal{B} or 𝒞\mathcal{C} or 𝒟\mathcal{D} or \mathcal{E}) with respect to SS in GG if and only if CiC_{i} contains the respective configuration with respect to SiS_{i} in Gi.G_{i}.

Proof. Let GG be a cactus graph with cycles C1,,CcC_{1},\ldots,C_{c} and let SS be a biactive branch-resolving set in G.G. Since SS is a biactive set, for every boundary vertex bb in a unicyclic region Gi,G_{i}, there is a vertex sSs\in S such that the shortest path from ss to CiC_{i} leads through b,b, as it is shown in Figure 4. This implies that the set of SS-active vertices on CiC_{i} in GG is the same as the set of SiS_{i}-active vertices on CiC_{i} in Gi.G_{i}. Since the presence of configurations 𝒜\mathcal{A}, \mathcal{B}, 𝒞\mathcal{C}, 𝒟\mathcal{D} and \mathcal{E} on a cycle CiC_{i}, with respect to a set S,S, by definition depends on the position of SS-active vertices on Ci,C_{i}, the claim follows.    

Notice that Lemmas 7, 9 and 10 give us a condition for SS to be a vertex (resp. an edge) metric generator in a cactus graph, which is both necessary and sufficient. In the light of Lemma 11, we can further apply Theorem 5 to obtain the following result which unifies all our results.

Theorem 12

Let GG be a cactus graph with cc cycles C1,,CcC_{1},\ldots,C_{c} and let SS be a biactive branch-resolving set in GG. The set SS is a vertex (resp. an edge) metric generator if and only if each cycle CiC_{i} does not contain any of the configurations 𝒜\mathcal{A}, \mathcal{B}, and 𝒞\mathcal{C} (resp. 𝒜\mathcal{A}, 𝒟\mathcal{D}, and \mathcal{E}) and there are no vertex-critically (resp. edge-critically) incident cycles in GG with respect to SS.

Proof. Let SS be a vertex (resp. an edge) metric generator in GG. Then Lemma 7 implies that SiS_{i} is a vertex (resp. edge) metric generator in the unicyclic region GiG_{i} and the Theorem 5 further implies that every cycle does not contain any of the configurations 𝒜\mathcal{A}, \mathcal{B}, and 𝒞\mathcal{C} (resp. 𝒜\mathcal{A}, 𝒟\mathcal{D}, and \mathcal{E}) with respect to S.S. Also, Lemma 9 implies that there are no vertex-critically (resp. edge-critically) incident cycles in GG with respect to SS.

The other direction is the consequence of Lemma 10 and Theorem 5.    

4 Metric dimensions in cacti

Refer to caption
Figure 6: A cactus graph with three cycles and two different smallest biactive branch-resolving sets S={s1,s2}S=\{s_{1},s_{2}\} and S={s1,s2}.S^{\prime}=\{s_{1}^{\prime},s_{2}^{\prime}\}. With respect to SS the cycle C2C_{2} contains configuration 𝒜\mathcal{A} and C3C_{3} configurations ,\mathcal{B}, 𝒞\mathcal{C} and 𝒟.\mathcal{D}. With respect to SS^{\prime} cycles C2C_{2} and C3C_{3} contain none of the five configurations. The cycle C1C_{1} has b(C1)=2,b(C_{1})=2, so the set of SS-active vertices {u,v}\{u,v\} on C1C_{1} is the same for all smallest biactive branch-resolving sets and C1C_{1} contains configurations \mathcal{B} and 𝒟\mathcal{D} with respect to all of them, including SS and SS^{\prime} shown in the figure. Therefore, in this graph cycle C1C_{1} is both 𝒜𝒞\mathcal{ABC}- and 𝒜𝒟\mathcal{ADE}-positive, and cycles C2C_{2} and C3C_{3} are both 𝒜𝒞\mathcal{ABC}- and 𝒜𝒟\mathcal{ADE}-negative.

Let GG be a cactus graph and SS a smallest biactive branch-resolving set in G.G. Then

|S|=L(G)+B(G),\left|S\right|=L(G)+B(G),

where B(G)=i=1cmax{0,2b(Ci)}.B(G)=\sum_{i=1}^{c}\max\{0,2-b(C_{i})\}. If b(Ci)2b(C_{i})\geq 2, then the set of SS-active vertices on CiC_{i} is the same for all smallest biactive branch-resolving sets SS. The set of SS-active vertices may differ only on cycles CiC_{i} with b(Ci)<2.b(C_{i})<2. Therefore, such a cycle CiC_{i} may contain one of the configurations with respect to one smallest biactive branch-resolving set, but not with respect to another. This is illustrated by Figure 6.

Definition 13

We say that a cycle CiC_{i} from a cactus graph GG is 𝒜𝒞\mathcal{ABC}-negative (resp. 𝒜𝒟\mathcal{ADE}-negative), if there exists a smallest biactive branch-resolving set SS in GG such that CiC_{i} does not contain any of the configurations 𝒜,\mathcal{A}, ,\mathcal{B}, and 𝒞\mathcal{C} (resp. 𝒜,\mathcal{A}, 𝒟,\mathcal{D}, and \mathcal{E}) with respect to S.S. Otherwise, we say that CiC_{i} is 𝒜𝒞\mathcal{ABC}-positive (resp. 𝒜𝒟\mathcal{ADE}-positive). The number of 𝒜𝒞\mathcal{ABC}-positive (resp. 𝒜𝒟\mathcal{ADE}-positive) cycles in GG is denoted by c𝒜𝒞(G)c_{\mathcal{ABC}}(G) (resp. c𝒜𝒟(G)c_{\mathcal{ADE}}(G)).

For two distinct smallest biactive branch-resolving sets SS, the set of SS-active vertices may differ only on cycles with b(Ci)1.b(C_{i})\leq 1. Let CiC_{i} and CjC_{j} be two such cycles in GG and notice that the choice of the vertices included in SS from the region of CiC_{i} is independent of the choice from Cj.C_{j}. Therefore, there exists at least one smallest biactive branch-resolving set SS such that every 𝒜𝒞\mathcal{ABC}-negative (resp. 𝒜𝒟\mathcal{ADE}-negative) avoids the three configurations with respect to S.S. Notice that there may exist more than one such set S,S, and in that case they all have the same size, so among them we may choose the one with the smallest number of vertex-critical (resp. edge-critical) incidencies. Therefore, we say that a smallest biactive branch-resolving set SS is nice if every 𝒜𝒞\mathcal{ABC}-negative (resp. 𝒜𝒟\mathcal{ADE}-negative) cycle CiC_{i} does not contain the three configurations with respect to SS and the number of vertex-critically (resp. edge-critically) incident pairs of cycles with respect to SS is the smallest possible. The niceness of a smallest biactive branch-resolving set is illustrated by Figure 7.

Refer to caption
Figure 7: A cactus graph with three cycles and two different smallest biactive branch-resolving sets S={s1,s2}S=\{s_{1},s_{2}\} and S={s1,s2}.S^{\prime}=\{s_{1}^{\prime},s_{2}^{\prime}\}. With respect to both SS and SS^{\prime} all three cycles do not contain any of the five configurations. The difference is that with respect to SS the cycle C2C_{2} is both vertex- and edge-critically incident with both C1C_{1} and C3C_{3}, and with respect to SS^{\prime} the cycle C2C_{2} is both vertex- and edge-critically incident with C3C_{3}, but only edge-critically incident with C1C_{1}. Therefore, the set SS is not nice. Since the critical incidences of SS^{\prime} cannot be further avoided the set SS^{\prime} is nice.

A set SV(G)S\subseteq V(G) is a vertex cover if it contains a least one end-vertex of every edge in G.G. The cardinality of a smallest vertex cover in GG is the vertex cover number denoted by τ(G).\tau(G). Now, let GG be a cactus graph and let SS be a nice smallest biactive branch-resolving set in G.G. We define the vertex-incident graph GviG_{vi} (resp. edge-incident graph GeiG_{ei}) as a graph containing a vertex for every cycle in G,G, where two vertices are adjacent if the corresponding cycles in GG are 𝒜𝒞\mathcal{ABC}-negative and vertex-critically incident (resp. 𝒜𝒟\mathcal{ADE}-negative and edge-critically incident) with respect to SS. For example, if we consider the cactus graph GG from Figure 8, then V(Gvi)=V(Gei)={Ci:i=1,,7},V(G_{vi})=V(G_{ei})=\{C_{i}:i=1,\ldots,7\}, where E(Gvi)={C3C4,C4C5}E(G_{vi})=\{C_{3}C_{4},C_{4}C_{5}\} and E(Gei)={C2C3,C3C4,C4C5}.E(G_{ei})=\{C_{2}C_{3},C_{3}C_{4},C_{4}C_{5}\}.

We are now in a position to establish the following theorem which gives us the value of the vertex and the edge metric dimensions in a cactus graph.

Theorem 14

Let GG be a cactus graph. Then

dim(G)=L(G)+B(G)+c𝒜𝒞(G)+τ(Gvi),\mathrm{dim}(G)=L(G)+B(G)+c_{\mathcal{ABC}}(G)+\tau(G_{vi}),

and

edim(G)=L(G)+B(G)+c𝒜𝒟(G)+τ(Gei).\mathrm{edim}(G)=L(G)+B(G)+c_{\mathcal{ADE}}(G)+\tau(G_{ei}).

Proof. If there is a cycle in GG with b(C)=0,b(C)=0, then GG is a unicyclic graph. For unicyclic graphs with b(C)=0b(C)=0 we have B(G)=2B(G)=2 and if the three configurations 𝒜\mathcal{A}, \mathcal{B}, 𝒞\mathcal{C} (resp. 𝒜\mathcal{A}, 𝒟\mathcal{D}, \mathcal{E}) cannot be avoided by choosing two vertices into S,S, then c𝒜𝒞(G)=1c_{\mathcal{ABC}}(G)=1 (resp. c𝒜𝒟(G)=1c_{\mathcal{ADE}}(G)=1) and also the third vertex must be introduced to S,S, so the claim holds. In all other situations B(G)B(G) equals the number of cycles in GG with b(Ci)=1.b(C_{i})=1.

Let SS be a smallest vertex (resp. edge) metric generator in GG. Due to Lemma 1 the set SS must be branch-resolving. Let S1SS_{1}\subseteq S be a smallest branch-resolving set contained in S,S, so |S1|=L(G).\left|S_{1}\right|=L(G). Since according to Lemma 1 the set SS must also be biactive, let S2S\S1S_{2}\subseteq S\backslash S_{1} be a smallest set such that S1S2S_{1}\cup S_{2} is biactive. Obviously, S1S2=ϕS_{1}\cap S_{2}=\phi and |S2|=B(G).\left|S_{2}\right|=B(G).

Since S1S2S_{1}\cup S_{2} is a smallest biactive branch-resolving set in G,G, it follows that every 𝒜𝒞\mathcal{ABC}-positive (resp. 𝒜𝒟\mathcal{ADE}-positive) cycle in GG contains at least one of the three configurations with respect to S1S2,S_{1}\cup S_{2}, so according to Theorem 12 the set S1S2S_{1}\cup S_{2} is not a vertex (resp. an edge) metric generator in G.G. Therefore, each 𝒜𝒞\mathcal{ABC}-positive (resp. 𝒜𝒟\mathcal{ADE}-positive) cycle CiC_{i} must contain a vertex siS\(S1S2),s_{i}\in S\backslash(S_{1}\cup S_{2}), where we may assume that sis_{i} is chosen so that it forms a geodesic triple on CiC_{i} with vertices from S1S2,S_{1}\cup S_{2}, so according to Observation 4 the cycle CiC_{i} will not contain any of the configurations with respect to S.S. Denote by S3S_{3} the set of vertices sis_{i} from every 𝒜𝒞\mathcal{ABC}-positive (resp. 𝒜𝒟\mathcal{ADE}-positive) cycle in G.G. Obviously, S3S,S_{3}\subseteq S, S1S2S3=ϕS_{1}\cap S_{2}\cap S_{3}=\phi and |S3|=c𝒜𝒞(G)\left|S_{3}\right|=c_{\mathcal{ABC}}(G) (resp. |S3|=c𝒜𝒟(G)\left|S_{3}\right|=c_{\mathcal{ADE}}(G)).

Notice that S1S2S3S_{1}\cup S_{2}\cup S_{3} is a biactive branch-resolving set in GG such that every cycle CiC_{i} in GG does not contain any of the configurations 𝒜,\mathcal{A}, ,\mathcal{B}, 𝒞\mathcal{C} (resp. 𝒜,\mathcal{A}, 𝒟,\mathcal{D}, \mathcal{E}) with respect to it. Notice that S1S2S3S_{1}\cup S_{2}\cup S_{3} still may not be a vertex (resp. an edge) metric generator, as there may exist vertex-critically (resp. edge-critically) incident cycles in GG with respect to S1S2S3.S_{1}\cup S_{2}\cup S_{3}. Since SS is a smallest vertex (resp. edge) metric generator, we may assume that S2S_{2} is chosen so that a smallest biactive branch-resolving set S1S2S_{1}\cup S_{2} is nice. Therefore, the graph GviG_{vi} (resp. GeiG_{ei}) contains an edge for every pair of cycles in GG which are 𝒜𝒞\mathcal{ABC}-negative and vertex-critically incident (resp. 𝒜𝒟\mathcal{ADE}-negative and edge-critically incident) with respect to S1S2.S_{1}\cup S_{2}. Let us denote S4=S\(S1S2S3).S_{4}=S\backslash(S_{1}\cup S_{2}\cup S_{3}). For each edge xyxy in GviG_{vi} (resp. GeiG_{ei}) the set S4S_{4} must contain a vertex from CxC_{x} or Cy,C_{y}, chosen so that it forms a geodesic triple of SS-active vertices on CxC_{x} or CyC_{y} with other vertices from S.S. Therefore, S4S_{4} must contain at least τ(Gvi)\tau(G_{vi}) (resp. τ(Gei)\tau(G_{ei})) vertices in order for SS to be a vertex (resp. an edge) metric generator. Since SS is a smallest vertex (resp. edge) metric generator, it must hold |S4|=τ(Gvi)\left|S_{4}\right|=\tau(G_{vi}) (resp. |S4|=τ(Gei)\left|S_{4}\right|=\tau(G_{ei})).

We have established that S=S1S2S3S4,S=S_{1}\cup S_{2}\cup S_{3}\cup S_{4}, where S1S2S3S4,S_{1}\cap S_{2}\cap S_{3}\cap S_{4}, so |S|=|S1|+|S2|+|S3|+|S4|.\left|S\right|=\left|S_{1}\right|+\left|S_{2}\right|+\left|S_{3}\right|+\left|S_{4}\right|. Since we also established |S1|=L(G),\left|S_{1}\right|=L(G), |S2|=B(G),\left|S_{2}\right|=B(G), |S3|=c𝒜𝒞(G)\left|S_{3}\right|=c_{\mathcal{ABC}}(G) (resp. |S3|=c𝒜𝒟(G)\left|S_{3}\right|=c_{\mathcal{ADE}}(G)) and |S4|=τ(Gvi)\left|S_{4}\right|=\tau(G_{vi}) (resp. |S4|=τ(Gei)\left|S_{4}\right|=\tau(G_{ei})), the proof is finished.    

The formulas for the calculation of metric dimensions from the above theorem are illustrated by the following examples.

Example 2

Let us consider the cactus graph GG from Figure 6. The set S={s1,s2}S^{\prime}=\{s_{1}^{\prime},s_{2}^{\prime}\} is an optimal smallest biactive branch-resolving set in G.G. But, since C1C_{1} is both 𝒜𝒞\mathcal{ABC}- and 𝒜𝒟\mathcal{ADE}-positive, the set SS^{\prime} is neither a vertex nor an edge metric generator. Let s3s_{3}^{\prime} be any vertex from C1C_{1} which forms a geodesic triple with two SS^{\prime}-active vertices on C1.C_{1}. Then the set S={s1,s2,s3}S=\{s_{1}^{\prime},s_{2}^{\prime},s_{3}^{\prime}\} is a smallest vertex (resp. edge) metric generator, so we obtain

dim(G)=L(G)+B(G)+c𝒜𝒞(G)+τ(Gvi)=0+2+1+0=3.\mathrm{dim}(G)=L(G)+B(G)+c_{\mathcal{ABC}}(G)+\tau(G_{vi})=0+2+1+0=3.

and

edim(G)=L(G)+B(G)+c𝒜𝒟(G)+τ(Gei)=0+2+1+0=3.\mathrm{edim}(G)=L(G)+B(G)+c_{\mathcal{ADE}}(G)+\tau(G_{ei})=0+2+1+0=3.
Refer to caption
Figure 8: A cactus graph GG from Example 3.

Let us now give an example of determining the vertex and the edge metric dimensions on a cactus graph which is a bit bigger.

Example 3

Let GG be the cactus graph from Figure 8. The following table gives the choice and the number of vertices for every expression in the formulas for metric dimensions from Theorem 14

vertices value
L(G)L(G) s1,s2,s3,s4s_{1},s_{2},s_{3},s_{4} 44
B(G)B(G) s5s_{5} 11
c𝒜𝒞(G)c_{\mathcal{ABC}}(G) s6s_{6} 11
τ(Gvi)\tau(G_{vi}) s7s_{7} 11
c𝒜𝒟(G)c_{\mathcal{ADE}}(G) s8,s9s_{8},s_{9} 22
τ(Gei)\tau(G_{ei}) s10,s11s_{10},s_{11} 22
      

Therefore, the set S={s1,s2,s3,s4,s5,s6,s7}S=\{s_{1},s_{2},s_{3},s_{4},s_{5},s_{6},s_{7}\} is a smallest vertex metric generator, so we obtain

dim(G)=L(G)+B(G)+c𝒜𝒞(G)+τ(Gvi)=4+1+1+1=7.\mathrm{dim}(G)=L(G)+B(G)+c_{\mathcal{ABC}}(G)+\tau(G_{vi})=4+1+1+1=7.

On the other hand, the set S={s1,s2,s3,s4,s5,s8,s9,s10,s11}S=\{s_{1},s_{2},s_{3},s_{4},s_{5},s_{8},s_{9},s_{10},s_{11}\} is a smallest edge metric generator, so we have

edim(G)=L(G)+B(G)+c𝒜𝒟(G)+τ(Gei)=4+1+2+2=9.\mathrm{edim}(G)=L(G)+B(G)+c_{\mathcal{ADE}}(G)+\tau(G_{ei})=4+1+2+2=9.

Notice that c𝒜𝒞(G)c.c_{\mathcal{ABC}}(G)\leq c. Also, if τ(Gvi)1\tau(G_{vi})\geq 1 then c𝒜𝒞(G)+τ(Gvi)<c.c_{\mathcal{ABC}}(G)+\tau(G_{vi})<c. The similar holds for c𝒜𝒟(G)c_{\mathcal{ADE}}(G) and τ(Gei).\tau(G_{ei}). From this and Theorem 14 we immediately obtain the following result.

Corollary 15

Let GG be a cactus graph with cc cycles. Then dim(G)L(G)+B(G)+c\mathrm{dim}(G)\leq L(G)+B(G)+c and edim(G)L(G)+B(G)+c.\mathrm{edim}(G)\leq L(G)+B(G)+c.

Further, notice that in a cactus graph with at least two cycles every cycle has at least one branch-active vertex. Therefore, in such a cactus graph G,G, we have B(G)=i=1cmax{0,2b(Ci)}cB(G)=\sum_{i=1}^{c}\max\{0,2-b(C_{i})\}\leq c with equality holding only if b(Ci)=1b(C_{i})=1 for every cycle CiC_{i} in GG. Since c𝒜𝒞(G)+τ(Gvi)=cc_{\mathcal{ABC}}(G)+\tau(G_{vi})=c if and only if c𝒜𝒞(G)=cc_{\mathcal{ABC}}(G)=c and τ(Gvi)=0,\tau(G_{vi})=0, and similarly holds for the edge version of metric dimension, Theorem 14 immediately implies the following simple upper bound on the vertex and edge metric dimensions of a cactus graph GG.

Corollary 16

Let GG be a cactus graph with c2c\geq 2 cycles. Then

dim(G)L(G)+2c\mathrm{dim}(G)\leq L(G)+2c

with equality holding if and only if every cycle in GG is 𝒜𝒞\mathcal{ABC}-positive and contains precisely one branch-active vertex.

Corollary 17

Let GG be a cactus graph with c2c\geq 2 cycles. Then

edim(G)L(G)+2c\mathrm{edim}(G)\leq L(G)+2c

with equality holding if and only if every cycle in GG is 𝒜𝒟\mathcal{ADE}-positive and contains precisely one branch-active vertex.

Notice that the upper bound from the above corollary may not hold for c=1c=1, i.e. for unicyclic graphs, as for the cycle CC of unicyclic graph it may hold that b(C)=0.b(C)=0. As for the tightness of these bounds, we have the following proposition.

Proposition 18

For every pair of integers b0b\geq 0 and c2,c\geq 2, there is a cactus graph GG with cc cycles such that L(G)=bL(G)=b and dim(G)=edim(G)=L(G)+2c.\mathrm{dim}(G)=\mathrm{edim}(G)=L(G)+2c.

Proof. For a given pair of integers b0b\geq 0 and c2,c\geq 2, we construct a cactus graph GG in a following way. Let G0G_{0} be a graph on b+2b+2 vertices, with one vertex uu of degree b+1b+1 and all other vertices of degree 11, i.e. G0G_{0} is a star graph. Let HH be a graph obtained from the 66-cycle by introducing a leaf to it and let G1,,GcG_{1},\ldots,G_{c} be cc vertex disjoint copies of HH. Denote by viv_{i} the only vertex of degree 33 in Gi.G_{i}. Let GG be a graph obtained from G0,G1,,GcG_{0},G_{1},\ldots,G_{c} by connecting them with an edge uviuv_{i} for i=1,,ci=1,\ldots,c. Obviously, GG is a cactus graph with cc cycles and L(G)=bL(G)=b. On each of the cycles in GG the vertex viv_{i} is the only branch-active vertex. If SV(G)S\subseteq V(G) is a smallest branch-resolving set in GG such that there is a cycle CiC_{i} in GG with only two SS-active vertices, then because of the leaf pending on viv_{i} the cycle CiC_{i} contains either configuration 𝒜\mathcal{A} if the pair of SS-active vertices on CiC_{i} is an antipodal pair or both configuration \mathcal{B} and 𝒟.\mathcal{D}. Either way, SS is not a vertex nor an edge metric generator.

On the other hand, the set SS consisting of bb leaves hanging at uu in G0G_{0} and a pair of vertices from each 66-cycle which form a geodesic triple with viv_{i} on the cycle is both a vertex and an edge metric generator in G.G. Since |S|=b+2c=L(G)+2c,\left|S\right|=b+2c=L(G)+2c, the claims hold.    

5 An application to zero forcing number

The results from previous section enable us to solve for cactus graphs a conjecture posed in literature [4] which involves the vertex metric dimension, the zero forcing number and the cyclomatic number c(G)=|E(G)||V(G)|+1c(G)=\left|E(G)\right|-\left|V(G)\right|+1 (which is sometimes called the cycle rank number and denoted by r(G)r(G)) of a graph GG. Notice that in a cactus graph GG the cyclomatic number c(G)c(G) equals the number of cycles in G.G. Let us first define the zero forcing number of a graph.

Assuming that every vertex of a graph GG is assigned one of two colors, say black and white, the set of vertices which are initially black is denoted by S.S. If there is a black vertex with only one white neighbor, then the color-change rule converts the only white neighbor also to black. This is one iteration of color-change rule, it can be applied iteratively. A zero forcing set is any set SV(G)S\subseteq V(G) such that all vertices of GG are colored black after applying the color-change rule finitely many times. The cardinality of the smallest zero forcing set in a graph GG is called the zero forcing number of GG and it is denoted by Z(G).Z(G). In [4] it was proven that for a unicyclic graph GG it holds that dim(G)Z(G)+1\mathrm{dim}(G)\leq Z(G)+1, and it was further conjectured the following.

Conjecture 19

For any graph GG it holds that dim(G)Z(G)+c(G).\mathrm{dim}(G)\leq Z(G)+c(G).

Moreover, they proved for cacti with even cycles the bound dim(G)Z(G)+c(G).\mathrm{dim}(G)\leq Z(G)+c(G). We will use our results to prove that for cacti the tighter bound from the above conjecture holds.

Proposition 20

Let GG be a cactus graph. Then dim(G)Z(G)+c(G)\mathrm{dim}(G)\leq Z(G)+c(G) and edim(G)Z(G)+c(G).\mathrm{edim}(G)\leq Z(G)+c(G).

Proof. Due to Corollary 15 it is sufficient to prove that L(G)+B(G)Z(G).L(G)+B(G)\leq Z(G). Let SV(G)S\subseteq V(G) be a zero forcing set in G.G. Let us first show that SS must be a branch-resolving set. Assume the contrary, i.e. that SS is not a branch-resolving set and let vV(G)v\in V(G) be a vertex of degree 3\geq 3 with at least two SS-free threads hanging at v.v. But then vv has at least two white neighbors, one on each of the SS-free threads hanging at it, which cannot be colored black by S,S, so SS is not a zero forcing set, a contradiction.

Let S1SS_{1}\subseteq S be a smallest branch-resolving set contained in SS and let S2=S\S1.S_{2}=S\backslash S_{1}. Obviously, |S1|=L(G)\left|S_{1}\right|=L(G) and S1S2=ϕ.S_{1}\cap S_{2}=\phi. We now wish to prove that |S2|B(G).\left|S_{2}\right|\geq B(G). If GG is a tree, then the claim obviously holds, so let us assume that GG contains at least one cycle. Let CiC_{i} be a cycle in GG such that b(Ci)1.b(C_{i})\leq 1. If b(Ci)=0,b(C_{i})=0, then GG is a unicyclic graph and CiC_{i} the only cycle in GG. Since b(Ci)=0,b(C_{i})=0, we have S1=ϕ,S_{1}=\phi, so S2=S.S_{2}=S. Since a zero forcing set in unicyclic graph must contain at least two vertices, we obtain |S2|=|S|2=B(G)\left|S_{2}\right|=\left|S\right|\geq 2=B(G) and the claim is proven.

Assume now that for every cycle CiC_{i} with b(Ci)1b(C_{i})\leq 1 it holds that b(Ci)=1.b(C_{i})=1. Let vv be the branch-active vertex on such a cycle CiC_{i} and notice that S1S_{1} can turn only vv black on Ci.C_{i}. Therefore, in order for SS to be a zero forcing set it follows that S2S_{2} must contain a vertex from every such cycle, i.e. |S2|B(G).\left|S_{2}\right|\geq B(G). Therefore, |S|=|S1|+|S2|L(G)+B(G).\left|S\right|=\left|S_{1}\right|+\left|S_{2}\right|\geq L(G)+B(G).    

The above proposition, besides proving for cacti the cycle rank conjecture which was posed for dim(G),\mathrm{dim}(G), also gives a similar result for edim(G).\mathrm{edim}(G). So, this motivates us to pose for edim(G)\mathrm{edim}(G) the counterpart conjecture of Conjecture 19.

6 Concluding remarks

In [18] it was established that for a unicyclic graph GG both vertex and edge metric dimensions are equal to L(G)+max{2b(G),0}L(G)+\max\{2-b(G),0\} or L(G)+max{2b(G),0}+1.L(G)+\max\{2-b(G),0\}+1. In [19] a characterization under which both of the dimensions take one of the two possible values was further established. In this paper we extend the result to cactus graphs where a similar characterization must hold for every cycle in a graph, and also the additional characterization for the connection of two cycles must be introduced. This result enabled us to prove the cycle rank conjecture for cactus graphs.

Moreover, the results of this paper enabled us to establish a simple upper bound on the value of the vertex and the edge metric dimension of a cactus graph GG with cc cycles

dim(G)L(G)+2c and edim(G)L(G)+2c.\mathrm{dim}(G)\leq L(G)+2c\quad\hbox{ and }\quad\mathrm{edim}(G)\leq L(G)+2c.

Since the number of cycles can be generalized to all graphs as the cyclomatic number c(G)=|E(G)||V(G)|+1,c(G)=\left|E(G)\right|-\left|V(G)\right|+1, we conjecture that the analogous bounds hold in general.

Conjecture 21

Let GG be a connected graph. Then, dim(G)L(G)+2c(G).\mathrm{dim}(G)\leq L(G)+2c(G).

Conjecture 22

Let GG be a connected graph. Then, edim(G)L(G)+2c(G).\mathrm{edim}(G)\leq L(G)+2c(G).

In [21] it was shown that the inequality mdim(G)<2c(G)\mathrm{mdim}(G)<2c(G) holds for 33-connected graphs. Since dim(G)mdim(G)\mathrm{dim}(G)\leq\mathrm{mdim}(G) and edim(G)mdim(G),\mathrm{edim}(G)\leq\mathrm{mdim}(G), the previous two conjectures obviously hold for 33-connected graphs.

Also, motivated by the bound on edge metric dimension of cacti involving zero forcing number, we state the following conjecture for general graphs, as a counterpart of Conjecture 19.

Conjecture 23

Let GG be a connected graph. Then, edim(G)Z(G)+c(G).\mathrm{edim}(G)\leq Z(G)+c(G).



Acknowledgments.  Both authors acknowledge partial support of the Slovenian research agency ARRS program P1-0383 and ARRS projects J1-1692 and J1-8130. The first author also the support of Project KK.01.1.1.02.0027, a project co-financed by the Croatian Government and the European Union through the European Regional Development Fund - the Competitiveness and Cohesion Operational Programme.

References

  • [1] P. S. Buczkowski, G. Chartrand, C. Poisson, P. Zhang, On kk-dimensional graphs and their bases, Period. Math. Hungar. 46(1) (2003) 9–15.
  • [2] J. Caceres, C. Hernando, M. Mora, I. M. Pelayo, M. L. Puertas, C. Seara, D. R. Wood, On the metric dimension of Cartesian products of graphs, SIAM J. Discrete Math. 21(2) (2007) 423–441.
  • [3] G. Chartrand, L. Eroh, M. A. Johnson, O. R. Oellermann, Resolvability in graphs and the metric dimension of a graph, Discrete Appl. Math. 105 (2000) 99–113.
  • [4] L. Eroh, C.X. Kang, E. Yi, A comparison between the metric dimension and zero forcing number of trees and unicyclic graphs, Acta Math. Sin. (Engl. Ser.) 33(6) (2017) 731–747.
  • [5] M. Fehr, S. Gosselin, O. R. Oellermann, The metric dimension of Cayley digraphs, Discrete Math. 306 (2006) 31–41.
  • [6] J. Geneson, Metric dimension and pattern avoidance in graphs, Discrete Appl. Math. 284 (2020) 1–7.
  • [7] F. Harary, R. A. Melter, On the metric dimension of a graph, Ars Combin. 2 (1976) 191–195.
  • [8] Y. Huang, B. Hou, W. Liu, L. Wu, S. Rainwater, S. Gao, On approximation algorithm for the edge metric dimension problem, Theoret. Comput. Sci. (2020), doi:https://doi.org/10.1016/j.tcs.2020.05.005.
  • [9] A. Kelenc, Distance-Based Invariants and Measures in Graphs, PhD thesis, University of Maribor, Faculty of Natural Sciences and Mathematics, 2020.
  • [10] A. Kelenc, D. Kuziak, A. Taranenko, I. G. Yero, Mixed metric dimension of graphs, Appl. Math. Comput. 314(1) (2017) 42–438.
  • [11] A. Kelenc, N. Tratnik, I. G. Yero, Uniquely identifying the edges of a graph: the edge metric dimension, Discrete Appl. Math. 251 (2018) 204–220.
  • [12] S. Khuller, B. Raghavachari, A. Rosenfeld, Landmarks in graphs, Discrete Appl. Math. 70 (1996) 217–229.
  • [13] D. J. Klein, E. Yi, A comparison on metric dimension of graphs, line graphs, and line graphs of the subdivision graphs, Eur. J. Pure Appl. Math. 5(3) (2012) 302–316.
  • [14] M. Knor, S. Majstorović, A. T. M. Toshi, R. Škrekovski, I. G. Yero, Graphs with the edge metric dimension smaller than the metric dimension, Appl. Math. Comput. 401 (2021) 126076.
  • [15] R. A. Melter, I. Tomescu, Metric bases in digital geometry, Comput. Vis. Graph. Image Process. 25 (1984) 113–121.
  • [16] I. Peterin, I. G. Yero, Edge metric dimension of some graph operations, Bull. Malays. Math. Sci. Soc. 43 (2020) 2465–2477.
  • [17] S. W. Saputro, R. Simanjuntak, S. Uttunggadewa, H. Assiyatun, E. T. Baskoro, A. N. M. Salman, M. Bača, The metric dimension of the lexicographic product of graphs, Discrete Math. 313 (2013) 1045–1051.
  • [18] J. Sedlar, R. Škrekovski, Bounds on metric dimensions of graphs with edge disjoint cycles, Appl. Math. Comput. 396 (2021) 125908.
  • [19] J. Sedlar, R. Škrekovski, Vertex and edge metric dimensions of unicyclic graphs, arXiv:2104.00577 [math.CO].
  • [20] J. Sedlar, R. Škrekovski, Extremal mixed metric dimension with respect to the cyclomatic number, Appl. Math. Comput. 404 (2021) 126238.
  • [21] J. Sedlar, R. Škrekovski, Mixed metric dimension of graphs with edge disjoint cycles, Discr. Appl. Math. 300 (2021) 1–8.
  • [22] P. J. Slater, Leaves of trees, Congr. Numer. 14 (1975) 549–559.
  • [23] I. G. Yero, D. Kuziak, J. A. Rodriguez-Velazquez, On the metric dimension of corona product graphs, Comput. Math. Appl. 61 (2011) 2793–2798.
  • [24] Y. Zhang, S. Gao, On the edge metric dimension of convex polytopes and its related graphs, J. Comb. Optim. 39(2) (2020) 334–350.
  • [25] E. Zhu, A. Taranenko, Z. Shao, J. Xu, On graphs with the maximum edge metric dimension, Discrete Appl. Math. 257 (2019) 317–324.
  • [26] N. Zubrilina, On the edge dimension of a graph, Discrete Math. 341(7) (2018) 2083–2088.