1. Introduction
The study of metric dimension,
, was first initiated by Slater and Peter [
1,
2]. They were studying the problem of determining the exact location of an intruder in a network. They used the terms “
locating set” and “
location number” to define their concepts. Independently, Hararay and Melter [
3] studied the same concepts and used the term “
metric dimension”. They calculated the metric dimensions of trees and grid graphs and gave a characterization of graphs with small metric dimensions.
In this article, we use the terminology developed by Hararay and Melter. The metric dimension is defined to be the cardinality of the smallest “
resolving set” [
3]. Chartrand et al. [
4] used the term “
metric basis” for the smallest resolving set. An ordered subset
is a metric basis for a simple graph
G, and then the
k-vector,
, is termed as the representation of the vertex
v with respect to the ordered subset
W and is denoted as
.
The concept of metric dimension in graphs has drawn a lot of interest from researchers. Chartrand et al. [
4] calculated the metric dimensions of trees and unicyclic graphs. They also gave the characterization of graphs with metric dimensions 1,
and
. Klien and Yi [
5] studied the metric dimensions of para-line graphs. They also compared the metric dimensions of graphs, line graphs and para-line graphs. Ahmed et al. [
6] calculated the exact values for the metric dimensions of the kayak paddles graph. They also calculated the metric dimensions of cycles with a chord. Sedlar and Skrekovski [
7] showed that the vertex and edge metric dimensions of unicyclic graphs obtain values from two particular consecutive integers, which can be determined from the structure of the graph. Abrishami et al. [
8] calculated the local metric dimensions for graphs having small clique numbers. Hayat et al. [
9] determined the exact values of metric dimensions of multi-partite graphs, effectively generalizing the already established results of bipartite graphs. For further studies on metric dimensions, we refer the reader to [
10,
11,
12,
13,
14,
15,
16,
17,
18] and the references therein.
The metric basis and metric dimensions have also been studied under numerous graph operations. Cáceres et al. [
19] studied the metric dimensions of the Cartesian product of graphs. They established that there is a family of graphs
G with bounded metric dimensions such that the metric dimension of
is unbounded. Jiang and Polyanskii [
20] showed that the metric dimensions of the Cartesian product of
n copies of G of order
q, is
. Fehr et al. [
21] studied the metric dimensions of Cayley digraphs. Nazeer et al. [
22] calculated the metric dimensions of path-related graphs for applications in network optimization. Eroh et al. [
23] studied the effect on metric dimensions of a graph
G when a vertex and/or edge is deleted from
G. Sebő et al. [
24] used the concept of metric dimensions, strong metric generators and isometric embedding to show that the existence of connected joins of graphs can be solved in polynomial time.
Metric dimensions of graphs have applications in robot navigation and drug discovery [
4], combinatorial optimization [
24] and strategies for the mastermind game [
25]. It was observed by Khuller et al. in [
26] that the metric dimension of an arbitrary
n-vertex graph may be approximated in polynomial time. An obvious question is, can we reduce this calculation time for some special types of graphs? In this article, we try to answer this for the join of two path graphs.
1.1. Motivation
Metric dimension of the join of two graphs was studied by Shahida and Sunitha [
27]. They considered two paths of lengths
m and
n and showed that
If we consider
and
, then by Equation (
1),
. Let us assume that the vertices are labelled as
; then it is an easy exercise to show that the set
is a resolving set for
, implying that
.
Rawat and Pradhan [
28] improved the results of Shahida and Sunitha and calculated that
Let us now consider
and
. Then, by Equation (
2),
. Again, assuming that the vertices are labeled as
, one can easily see that the set
is a resolving set for
. One can also verify that the above result does not hold whenever
or
.
The above discussion shows that there is an obvious vacuum in the literature for the calculation of metric dimension of join of two path graphs. Haryanto et al. [
29] tried to fill this gap and calculated the metric dimensions of
. The question of
is still open when
.
The present study was aimed at calculating the metric dimensions of for all values of m and n. This enabled the calculation of in constant time. We also provide an algorithm of complexity to calculate the metric bases for . Since the joining of graphs is a symmetric operation, we can see that is siomorphic to .
1.2. Preliminaries
Let be a simple, connected and undirected graph. The number of vertices in a graph is said to be the order of the graph. The distance between two vertices of a graph G, denoted by , is the length of the shortest path between them. It is clear that , since the distance is always symmetrical. The representation of a vertex with respect to an ordered set , denoted by , is the k-tuple . We say that resolves the graph G, if for any two vertices , there exists at least one such that ; equivalently, W resolves G if for any two vertices , we have, . A resolving set W of minimum cardinality is called the metric basis for the graph G, and is the metric dimension of G.
Let and be simple, connected and non-trivial graphs. The join of these graphs, , is a graph with and From the definition of a join of graphs, we see that the join operation is a symmetric operation. We can also easily conclude that whenever .
Two graphs G and H are said to be isomorphic, denoted as , if there exists a bijection, , such that in G if and only if in H.
In what follows, for simplicity we will write to represent the union of a set and a single vertex.
2. Metric Dimension of the Join of Two Path Graphs
In this section we study the resolving set of the join of two path graphs. Let
and
be paths of order
s and
t respectively; then, the join of these two paths
is as given in the following.
Note that for
,
if
or
(equivalently
), and
otherwise. On the other hand,
, we have
. We also consider
, whenever
n is considered as an order of this graph. These concepts can be clarified from
Figure 1. The join operation for graphs is a symmetric operation since
, and
We provide a concrete short example of the symmetry at work in this operation.
Example 1. Let us consider the joins and when and . Their figure is provided below.
Let us define a mapping , where , , , , , , and .
It can be easily verified that under the mapping Φ. This ensures that and are the same graph with respect to their symmetry. It can also be concluded that if a set W is a resolving set for , then is a resolving set for , owing to the symmetry between them.
We now move on to state and prove our results for this section.
Theorem 1. For and Proof. For this proof, we will discuss all the cases of s and t separately. Note that the vertices are labeled as .
Case 1. When . For and 2, the results are obvious, since and . We discuss the remaining cases of t in the following.
- [a.]
: From Equation (
1),
. Let
; then,
and
, ‘indicating that
is a resolving set for
. Let us consider the set
. In that case,
, and if we consider the set
, we can see that
, implying that these two sets do not resolve
, and hence
.
In the remaining cases, we only show that a resolving set of stated cardinality exists. These resolving sets are very small and well structured, and it can be easily shown that a smaller resolving set does not exist. We will omit this part of the proof from all other cases.
- [b.]
: Equation (
1)
Let us take
as a resolving set; then,
,
and
, giving us
- [c.]
: By Equation (
1),
. Let
; then,
,
,
and
, implying that
is a resolving set.
- [d.]
: Again, with the help of Equation (
1),
. Let
; then,
,
,
and
, giving us,
.
Case 2. When . For and 2, the results are again obvious, since and . Following the same pattern as above, we discuss the remaining cases of t as follows.
- [a.]
:
by Equation (
1). Let
; then,
and
- [b.]
: From Equation (
1),
Let
; then,
,
,
; hence,
- [c.]
:
by using Equation (
1). Let
; then,
,
,
,
; hence,
- [d.]
: Equation (1) . Let ; then, , , and , giving us the result.
Case 3. When . When , we obtain , which is isomophic to , and the result follows from Case 1.a. Similarly, when , we have , and the result follows from Case 2.a. The remaining cases for different values of t are given in the following.
- [a.]
:
by Equation (
1). Let
; then,
,
and
. Hence,
- [b.]
: Using Equation (
1), we obtain
. Let
; then,
,
,
,
⟹
- [c.]
: From Equation (
1),
. Let
; then,
,
,
,
,
, and hence
- [d.]
: By Equation (
1),
. Let
; then,
,
,
,
and
, implying
Case 4. When . When , we obtain , which is isomophic to , and the result follows from Case 1.d. Similarly when , we have (Case 2.d), and when , we have , and is the same as in Case 3.d.
- [a.]
: Equation (
1)
Let
; then,
,
,
,
,
,
, and hence
- [b.]
: By Equation (
1),
Let
; then,
,
,
,
,
,
,
; hence,
- [c.]
: From Equation (
1),
Let
; then,
,
,
,
,
,
aand
, and hence,
□
Theorem 2. When and ; then, Proof. We again discuss this for all cases of s and t seperately.
Case 1. When . When , we obtain , which is isomophic to , and the result follows from Theorem 3.1 Case 1.b. Similarly, when , we have (Theorem 1, Case 2.b), and gives (Theorem 1, Case 3.b).
- [a.]
. From Equation (
6),
. Let
; then,
,
,
and
, giving us
- [b.]
. By Equation (
6),
. Let
; then,
,
,
,
and
. Hence
- [c.]
, Equation (
6)
. Let
; then,
,
,
,
,
and
, and hence
Case 2. When . When , we obtain , which is isomophic to , and the result follows from Theorem 1, Case 1.c. Similarly, when , we have (Theorem 1, Case 2.c); when , we have (Theorem 1, Case 3.c); when , we obtain (Same Theorem, Case 1.b); and when , we have (Theorem 1, Case 4.b).
- [a.]
, by Equation (
6),
. Let
; then,
,
,
,
,
and
, implying
□
We now move on to when and . Before proceeding further, we define some new notation and concepts which will be used later on.
Let
and
, where
. The term
is used for the remainder, when
is divided by 5. Using these concepts, we partition the vertex set of
from
Figure 1 as follows:
We also partition the vertex set of
from
Figure 1 along the same lines. This partition is given in the following:
From the definition of , we can easily deduce certain properties which will be helpful later on. We provide them in the following.
- (I)
When , we obtain . This gives , implying, for .
- (II)
For , for .
- (III)
When , we obtain ⇒.
- (IV)
When , and .
- (V)
When , and .
Similarly, for the partitions , we list the following properties.
- (VI)
Since , for .
- (VII)
When , .
- (VIII)
When , and .
- (IX)
When , and .
We also claim that . To realize this, we proceed as follows.
Since
,
. Now
Next, we investigate the last vertex of
, i.e.,
, when
. Now,
Hence,
.
It is worthwhile to mention here that, at the end of this article, we provide an algorithm based on our results. The loops counters in the algorithm work in such a way that the above-stated properties of and are handled inherently, and the end user does not need to worry about these finer points of mathematics.
Armed with this knowledge, we now proceed to state and prove the main result of this article.
Theorem 3. For and (or vice versa), the metric dimension of is Proof. This proof is completed in two parts. In part 1, we establish that we can in fact generate a resolving set W of of the above cardinality. In part 2, we show that there does not exist any resolving set of having fewer vertices than W.
Part I
Let
. Here,
and
and
and
, where
and
are defined as:
It is easy to calculate that . We will prove that the set W, generated above, is indeed a resolving set for . For this, we will show that, for any pair of distinct vertices , there exists , such that .
Let , ; then, without loss of generality, , since otherwise, we can just rename the indices to obtain the same. We only consider the case when . From the fact that , it is obvious that enjoys any one of the following forms:
- (1)
; equivalently;
- (2)
; equivalently;
- (3)
; equivalently;
- (4)
; equivalently;
- (5)
; equivalently;
- (6)
; equivalently;
- (7)
; equivalently;
- (8)
; equivalently;
It should be noted that ensures that also adheres to the above given forms, and since , we will use the index to denote different forms of .
The proof is divided into different cases. The proof for every case follows a set pattern, wherein for every , we find , such that . This ensures that the representations .
Case 1. When , since , can assume any one of the forms (1) to (4). We discuss all these cases separately.
- [a.]
Suppose that is of the form as given in (1); then, . Let us take ; then, .
Given that , it can assume any of the forms (1) to (4). For all of them, it is given that , and we will be using this information to solve all four cases of in one go. We will not be repeating this information in all the other cases, but it is inherently present in there.
Now , and since , we obtain .
- [b.]
Let be of the form given in (2); then, .
Now, if , then by letting , we obtain . Since and , we obtain . Again, ⇒, while .
If , then defining w as above gives us . For this case, let . From the structure of , it is clear that , while . Hence, , while .
- [c.]
If is of the form given in (3), then . Let . Now . Again, since and , we obtain , giving us .
- [d.]
If is of the form given in (4), then . Let . We obtain . It is again an easy task to show that for all and .
Case 2. When , following the same proof techniques as in Case 1, it can be easily shown that there always exists a , belonging to , such that .
Case 3. When and :
- [a.]
Let be of the form as given in (1); then, . From here, we obtain that .
When s is odd, .
When s is even, .
Let us consider the set ; then, . The above argument ensures that the smallest element of the set is . Let ; then, , since if s is odd, and if s is even.
On the other hand, since , , since .
- [b.]
Let be of the form given in (2); then, . Let ; then, by construction of , we obtain and for all .
- [c.]
If is of the form given in (3); then, . Let for some specific . Let such that . Consider the vertex . Since , , giving us and for all .
- [d.]
If is of the form given in (4), then . Let ; then, by construction of , we obtain and for all .
We have completed our argument to establish that W, as defined above, is indeed a resolving set for . In the next part, we will show that is not a resolving set. This will ensure that there does not exist a resolving set smaller than W and is the metric dimension for .
Part II
Since , we obtain . We now calculate the distance for all . Different cases arise for such a .
Case I. When , depending on the value of s, changes. We discuss these different cases in the following.
- [a.]
When , we obtain , and there is no distance to calculate.
- [b.]
When , then , i.e., . If , then ; otherwise, .
- [c.]
When , again ; i.e., and .
- [d.]
When , we obtain, ; i.e., or . If , we obtain and , and for all other such values of s.
- [e.]
When , we again see that —i.e., or and —for all such values of s.
Case II. When
. Then,
. We claim that
for all
. Contrarily, let us suppose that
. Since
is the last vertex of path
and
, we only have the possibility that the vertex with the largest index in
is adjacent to
, implying
Using the values from the equation set
7, we obtain
, which is a contradiction. Hence,
, implying
for all
, giving us
for all
.
Case III. When
. Then,
. We claim that
for all
. On the contrary, let us suppose that
. Since
is the last vertex of path
and
, we only have the possibility that the vertex with the largest index in
is adjacent to
, implying
Again, using the values from equation set
7, we obtain
, which is a contradiction. Hence,
, implying
for all
, giving us
for all
.
It is our aim to show that whenever we formulate the set , there exists a vertex, say , such that . Again, different cases arise depending on .
Case A. When , depending on the value of s, changes. We discuss these different cases in the following.
- [a.]
When , we obtain , and there is nothing to discuss.
- [b.]
When , ; i.e., .
If , then , since all elements of are in . Since , by letting , we see that , since again, all elements of are in . Hence, is not a resolving set.
On the other hand, if
and
, we again see that
. Let
. Then, by the argument in Cases II and III and by the fact that
for all
, we obtain
Considering the vertex
, since
, all elements of
W occur after
; i.e., all elements of
occur after
; hence,
Hence, is not a resolving set.
- [c.]
When , again . Considering the vertex and proceeding in the same way as above, we see that, .
- [d.]
When , ; i.e., or .
If , we can formulate in two ways; i.e., or . If , by comparing and , we see that is not a resolving set. On the other hand, if , comparing and gives us that is not a resolving set.
If but , letting and comparing and gives us that is not a resolving set.
- [e.]
When , again, —i.e., or . As in the case, and , by letting and comparing the representations of and with respect to , we see that is not a resolving set.
Case B. When
, it is again an easy task to show that
where
. Similarly,
This again shows that
is not a resolving set.
Case C. When , considering the representations and , where , we see that , and again, is not a resolving set.
For the part where is not a resolving set for all , the procedure is the same as for .
This completes the second part of our theorem. Combining these two together, we see that W is indeed a resolving set with minimal cardinality. Hence, . This completes our result. □
The above results conclude that the metric dimension of is not an exact number and increases with the size of both paths—i.e., the metric dimension of is unbounded.
3. Algorithms for Metric Bases and Metric Dimensions of
Theorems 1–3 enable us to calculate the metric dimensions of
in constant time. An algorithm is developed in the following.
Algorithm 1 Calculating the metric dimension of for and . |
Input s and t |
- 1:
- 2:
- 3:
- 4:
- 5:
- 6:
if then - 7:
if then - 8:
if then - 9:
- 10:
end if - 11:
if then - 12:
- 13:
end if - 14:
if then - 15:
- 16:
end if - 17:
end if - 18:
if then - 19:
if then - 20:
- 21:
end if - 22:
if then - 23:
- 24:
end if - 25:
if then - 26:
- 27:
end if - 28:
end if - 29:
else - 30:
end if
|
Output |
It can be readily observed that the algorithm uses assignment and if–else statements only. Each of these steps has a complexity of . Combining their complexities together gives us a complexity of for the whole algorithm.
These theorems also provide us a way to calculate the metric bases for
. Theorems 1 and 2 establish that the metric bases for
can be calculated in constant time for
. Based on Theorem 3, we developed the following algorithm to calculate the metric bases for
when
and
.
Algorithm 2 Calculating the metric basis of for and . |
Input s and t |
- 1:
- 2:
- 3:
- 4:
- 5:
- 6:
for do - 7:
- 8:
end for - 9:
for do - 10:
- 11:
end for - 12:
for do - 13:
- 14:
end for - 15:
for do - 16:
- 17:
end for
|
Output W |
The first five statements of the above algorithm are assignments, each having a complexity of . Loops in steps 6, 9, 12 and 15 are not nested. The counter ensures that every loop runs less than times, with a maximum complexity of . By adding these complexities together, we again obtain ; i.e., the algorithm runs in linear time.
The metric basis we calculated in the algorithm will work for both and because of isomorphism and symmetry. Let us use this algorithm to solve an example already mentioned in introduction.
Example 2. Let and ; then, and . Again, and . Loops in steps 6 and 12 do not satisfy the condition, and hence will not contribute anything to W. The loop in step 9 will run twice and will give us . Similarly, the loop in step 15 will run twice, and we will then obtain .