1. Introduction
If
G is a graph and
is a partition of
, then the colored distance of
G is the sum of the distances between all pairs of vertices that lie in the different parts of
. This concept was defined by Dankelmann, Goddard, and Slater [
1] and is based on a location problem [
2]. Klavžar and Nadjafi-Arani further developed this metric and introduced the dual concept of a colored distance called partition distance [
3]. Dankelmann et al. tackled a few applications of colored distance toward the facility location problem, median graphs, and the average distance of graphs (see [
2,
4]). Klavžar et al. [
3] demonstrated that the dual concept has more practical value and addressed some applications in mathematical chemistry and network analysis [
5,
6] to obtain general bounds as well as to classify corresponding extremal graphs. Moreover, they expressed some basic graph invariants such as the diameter and the clique number by utilizing the partition distance. They also showed that some of these applications cannot be achieved when using the colored distance.
The usefulness of the cut method and the extended cut method in metric graph theory has been proved [
7]. For instance, the method has been used to define distance-based graph invariants. These methods are based on the Djoković–Winkler relation where we apply the canonical metric representation to find the distance moments between pairs of vertices [
8,
9,
10]. Especially in metric graph theory, the methods have already been used to explain distance-based graph invariants based on quotient graphs and cuts (see the survey [
11]). In [
12,
13], results achieved in [
11] were used to analyze the modified Wiener index [
14]. Trees with the maximal value of the modified Wiener index are analyzed in [
15].
The main contributions of this paper involve applying the extended cut method and introducing new expressions and bounds for distance-based quantities (e.g., modified Wiener index). This paper is organized as follows. We start by presenting some preliminary definitions and theorems that we need for proving our main results. In
Section 3, we prove a generalization toward computing the partition and colored distances based on the canonical metric representation. The generalization is twofold. First, we examine partition and colored distances in graphs induced to subsets of vertices of a graph. Second, the calculation of colored distances is being performed by computing a two-dimensional version of the Wiener index of its quotient graph. In
Section 4, we apply our main theorems to derive some bounds for the modified Wiener index and the number of orbits of a partial cube graph
G under the action of
2. Preliminaries
Let
G be a simple graph and define
(for short
) as the length of a shortest path between two vertices
u and
v in
G. Let
and define
If
, then
is called the Wiener index. Similarly, average distance,
is an equivalent number to
(see [
16,
17,
18,
19]). The Djoković–Winkler relation
[
8,
10] is a reflexive and symmetric relation between edges of graphs such that two edges
and
of a connected graph
G are under the relation
if
. The transitive closure
of
is an equivalence relation on
. The equivalence classes of
are shown by
, which is called the
-partition. Define the quotient graph
as follows: For any
, let the connected components of the graph
G-
exist as vertices, and two vertices
P and
Q are adjacent iff there is at least an edge
such that
and
. Consider a vertex weighted graph
; then, the Wiener index
is defined as follows [
20]:
If , then .
An isometric subgraph
H of a graph
G is a subgraph of
G such that the distance between any pair of vertices in
H is the same as that in
A partial cube [
21] is an isometric subgraph of a hypercube. Winkler showed that a connected graph is a partial cube if and only if it is bipartite and the relation
is transitive—that is,
[
10].
If
G is a graph and
is the partition of
into the orbits under the action of
, then the modified Wiener index [
14] of
G is defined by
The modified Wiener index can also be expressed by
Let G be a graph of order n and let with An S-coloring is a partition of with The colored distance of is the sum of the distances between vertices of different colors. The sum of distances between vertices with same colors, the partition distance of G, is Note that
Henceforth, we collect those results that we will make use of from [
3,
22,
23].
Lemma 1. (i) Let P be a shortest path in G. Then, no two edges of P are in the relation Θ.
(ii) Letbe an edge of a graph G, and let W be a-walk in G that does not contain e. Then, there exists an edge f of W such that.
(iii) Let F be a-class of a connected graph G and let. If P is a shortest-path and Q is an arbitrary-path, then.
There are many research studies in which the authors applied weighted quotient graphs induced by the
-relation method for computing several distance-based graph invariants. For more details, see the survey [
11]. The method is called the cut method. The following theorems are recent results that we extend to subsets of vertices.
Theorem 1. [
3] ([Theorem 2.2])
Let G be a connected graph and let be a partition of . If is the -partition of , thenwhere for any .
We say that a partition of is coarser than if each set is the union of one or more -classes of G. Theorem 1 then generalizes this as follows:
Theorem 2. [
3] ([Theorem 2.3])
Let be a connected weighted graph and let be a partition of . If is a partition of coarser than the -partition, thenwhere for any . Cut methods that apply to classes larger than partial cubes or a partition coarser than
-partition are called extended cut methods [
11]. Now, we are ready to formulate our results.
3. Extended Cut Methods on Some Subsets of Vertices
In this section, we extend Theorems 1 and 2 regarding some subsets of vertices that are not necessary a partition of This modification enables us to induce the partition and colored distances in a graph regarding some arbitrary subsets of vertices. Then, we prove and state the induced partition and colored distances based on the extended cut method. Moreover, we reduce the computation of the distances between unordered pairs of vertices to a corresponding appropriately weighted quotient graph of The quotient graphs are weighted by a two-dimensional version with an operator.
The following theorem is an extension of Theorem 2. The idea of the proof is similar with the argument presented in [
3] and we omit it. We point out that in the proof of Theorem 2, Klavžar et al. considered
to be a partition of
and for any vertices
,
, that belong to some
,
, selected a shortest
-path. Then, they utilized a double counting technique to prove the theorem. To prove Theorem 3, it is not necessary to assume that
is a partition of
. In fact, if
is the set of some distinct subsets of
(not necessarily the partition of
), then we select a shortest path between each pair vertices of
,
, and continue the proof using the same idea as used in the proof of Theorem 2. Moreover, we extend the definition of
accordingly.
Theorem 3. Letbe a connected weighted graph and letbe a set containing k distinct subsets of. Ifis a partition ofcoarser than the-partition, thenwherefor any. Several invariants of wide interest in basic graph theory, mathematical chemistry, and computer science can be expressed as instances of Theorem 3. For example, for computing the modified Wiener index, we need to obtain the summation of distances between unordered pair vertices of an orbit under the action Aut(G) [
14]. Second, in the
k-generalized Wiener index [
24], we need to compute the summation of distances between vertices of the same degree
k. In basic graph theory,
k-diameter of a graph
G was introduced as
—that is, as the maximum overall partition distances of size
k. Note that
and
[
25]. One of the main problems in computer science is the network clustering. In a clustering problem, we select some nodes as a cluster node in the network and we need to cluster nodes to transfer their data together [
26]. In this case, we need to find the distance between cluster nodes—that is, a partition distance of cluster nodes.
In [
3,
23] and also the survey [
11], Klavžar and Nadjafi-Arani introduced the extended cut method. Generally, they used a partition of vertices and introduced the partition distance of graphs. Klavžar and Nadjafi-Arani obtained a formula based on the extended cut method for the partition distance of graph. However, they expressed colored distance using the Wiener index and partition distances of a graph as follows:
Corollary 1. [
3] ([Corollary 2.6])
Let G be a connected graph and let be a partition of . If is the -partition of , thenwhere and for any . The weakness of this corollary is twofold. First, using the definition of corresponding quotient graph based on canonical metric representation, it is not possible to state by cuts with the same weight function. Second, it is not possible to determine the colored distance when we are working with some subsets of vertices that are not necessarily a partition of . Hence, we need to obtain from -partition and extend our results when we consider some subsets of vertices. In this case, we need to redefine the weighted function w as a two-dimensional function with an operation “.” where Let and define with an operation “.” such that Similar to the weighted Wiener index , we introduce the distance between two vertices and of a weighted graph as Then, the colored distance of a weighted graph can be calculated as follows:
Theorem 4. Let G be a connected graph and letbe a set containing k distinct subsets ofandIfis the-partition of, thenwherefor any.
Proof. Let
A be a set of shortest paths such that there exist exactly one shortest path
for each pair of vertices
where
and
Create an incidence matrix
that is a matrix that shows the relationship between two classes of objects. If the first class is
A and the second is
, the matrix has one row for each element of
A and one column for each element of
. We assign
for the corresponding entry in row
and column
. In a special case, if
G is a partial cube, then
M is a 0,1 matrix in which
if and only if the path
contains exactly one edge of
We apply a double counting on summation of
M arrays. Indeed, the summation of arrays of
ith row corresponding to
is equal to
So, due to the elements of the set
A, the summation of
M arrays shows
An array of
jth column is greather than or equal than 1 if and only if there is a shortest path in
A that goes through an edge of
Hence, initially, we compute the number of shortest paths in
A that have an edge in
For calculating this number, let
be the connected components of
and
Thus, the number of shortest paths in
A passed through
are equal to:
Alternately, using the definition of the quotient graphs
, the shortest path
induces a path of length
t in
so that
. Let
hold and let
R be a shortest
-path in
. Then,
R can be naturally lifted into an
-path in
G which contains less that
t edges from
. Since this contradicts Lemma 1(iii), we conclude that
and, consequently,
—that is,
Hence, the summation of the
column of
M is equal to:
Summing over all columns, we get:
which completes the proof. □
If
is a connected weighted graph, then we can utilize
instead of
in the incidence matrix. The main idea of the above argument comes from [
23] ([Theorem 3.3]) where the first author with S. Klavžar extended the cut method for a partition of
coarser than the
-partition. The main difference between these two theorems is how to choose the set of shortest paths. In [
23], the set of selected shortest paths is
Y in
G such that for every pair of vertices
,
, there exists a unique shortest
-path in the list, while in Theorem 4, the set
A is a special set that enables us to calculate the summation of distances between all pair of vertices selected in
A. In fact, coloring helps us to see the selected vertices more clearly. Since the proof of the extended cut method proceeds similar to how the proof Theorem 4 proceeds, we omit the details and state the generalized version of above theorem as follows:
Theorem 5. Letbe a connected weighted graph and letbe a set containing k distinct subsets ofand If
is a partition of coarser than the -partition, thenwhere for any . Theorems 3 and 5 are quite powerful. Using a sample computer application, we calculate the summation of distances between two subsets of vertices
and
in a hypercube graph
G. Let
and
be the sets of white and black vertices, respectively. Clearly, we can ascertain that the parallel edges of
G are the partition
of
. Let
in which
shows the vertical parallel edges and
are three horizontal paralleled pair edges of
G (see
Figure 1a). Let
be a coarser partition of
. The quotient graphs
and
with the weight
for each vertex
are shown in
Figure 1b,c respectively. Now, apply Theorem 5 to obtain the summation of distances between each pair of vertices
and
.
Let be two distinct subsets of vertices and let denote the summation of distances for each pair of vertices in which and The following corollary is a special case of Theorem 5 when we have just two subsets of vertices.
Corollary 2. Letbe a connected weighted graph and letbe a set containing k distinct subsets of. Ifis a partition ofcoarser than the-partition, thenwherefor any. Corollary 2 plays the main role in our results in the next section. Alternately, the distance summations between some subsets of
can be calculated by taking a summation on Equation (5). For instance, from Theorem 5 and Corollary 2, it is easy to see that
In the following, it is important to mention some special features of the Theorems 3 and 5. In fact, we can omit the distinct assumption for s. In this case, if a node has several colors ( belongs to different elements of ), we need to define the color of due to our desires. For example, if we consider that the vertex belongs to two different subsets ( has two colors, for instance, red and blue), and we need to find the distance between blue vertices such that the distance between and other blue vertices is a term of our desire, we consider the color of to be blue. Next, set all shortest paths between and blue vertices in Alternately, if we need to consider as a red vertex, we have to deposit the corresponding shortest paths in
4. Some Bounds on the Modified Wiener Index and the Number of Orbits
In this section, we apply Theorem 4 and Corollary 2 to partial cubes and trees to derive some upper bounds for modified Wiener index and the number of orbits of the automorphism group. Before that, the eccentricity of a vertex v is defined to be the greatest distance from v to any other vertex. The radius r of a graph is the minimum eccentricity of any vertex; in other words, A vertex with minimal eccentricity is called the center of a graph. The trees have exactly one center (centered trees) or precisely two adjacent centers (bicentered trees). In bicenterd trees, the edge between two centers is called the edge center.
Lemma 2. Let G be a graph of order n andbe the set of orbits of. Then,in whichis the orbit representative ofand Proof. Assume that
u and
v belong to an arbitrary orbit
Due to the orbit properties of an automorphism group, it is easy to see that
Therefore,
Then, by substituting to (
1), the result follows. □
Lemma 3. If T is a centered tree, then the center of T is an orbit of T with one element. Moreover, the elements of an arbitrary orbit are an independent set ofWhen T is a bicentered tree, the same results hold with a difference that the edge center maybe be an orbit.
Proof. Initially, let T be a centered tree. Since the elements of each orbit are symmetric, the center of T is a unique vertex with special properties and it is an orbit with one element. Next, we show that the elements of an orbit are an independent set. Let be an edge of T such that u and v belong to the same orbit. Let c be the center of T and such that Alternately, T is a centered tree, so —that is, Hence, there is a closed walk in T of odd length. It means that T has a cycle that is a contradiction. Thus, the elements of an orbit form an independent set. If T is a bicentered tree based on the structure of T, maybe both of the centers form an orbit or separately each one becomes an orbit with one element. Let be the centers of T and let both of them belong to different orbits. Then, with the same argument, we can prove that there is no edge between vertices of an orbit. When belong to the same orbit, then there exist two cases. , and The proof of the first case is the same as before. For the second one, we have In this case, the walk is a closed walk in T that is a contradiction and the proof is complete. □
Corollary 3. Let T be a tree of order n and radius r with t orbits; then,
Proof. Since the distance between the center of T and the elements of an orbit is a fixed number, Alternately, the number of orbits is maximum when that is, each node is an orbit or . So, the proof is complete. □
In the next theorem, we apply Corollary 2 to find an upper bound for the modified Wiener index in partial cube graphs based on the number of orbits of the automorphism graph.
Theorem 6. Let G be a partial cube of order n andis the-partition ofLetbe the set of orbits ofthenand the bound is the best possible. Proof. Let
be the
-partition of
and
demonstrates the set of orbit representatives of
respectively. Apply Corollary 2 for an orbit
and consider
and
. Since for each
the graph
parted to two connected components
C and
so its quotient graph is a weighted edge
Thus,
and
. Therefore,
This value is attained by the modified Wiener index of a path with three vertexes or each graph whose automorphism group is identity. Therefore our bound is best possible and the proof is complete. □
We know that trees are a subset of partial cube graphs and each edge of a tree is an element of -partition. The following corollary is obtained from Theorem 6 directly.
Corollary 4. Let T be a tree of order n andhas t orbits. Then, Moreover, the equality holds if and only ifor.
Proof. Since, the trees are partial cubes and each edge of a tree is an element of
-partition, we can obtain the upper bound from Theorem 6. For equality, it is enough to show that equality holds in (
7) for each arbitrary
. Consider the same notation used in Theorem 6. Clearly, when
each orbit is formed from a vertex and
Next, let
, and there is
in which, for two distinct vertices
, we have
If
u and
v are not pendant vertices, then it is enough to consider the pendant edge
as an element of
-partition. Thus,
. Let
be pendant vertices and
. In this case, consider the edge
as a nonpendant edge. Similar to last argument, we can prove that the Equation (
7) does not hold. If
, then
where
shows a star graph with
n vertex. One can easily see that if
, then there is an edge for which the Equation (
7) is not satisfied and the result follows. □
Theorem 7. Let T be an n-vertex tree andbe the set of orbits of. r shows the radius of tree. Then,
- 1.
If T is a centered tree, thenand the equality holds if and only if T is the star graphor the path. - 2.
If T is a bicentered tree, thenand the equality holds if and only if T is the path.
Proof. Initially, let
T be a centered tree with its center named
c. Assume that
demonstrates the set of orbit representatives of
.
denotes a one-element orbit that contains the center of
T. Consider the vertices of a graph with level
by
where it is the set of all orbits such that
Since
T is a tree and by Lemma 3, there are no edge between vertices of
. Define
Indeed, the set
is a partition of
coarser than the
-partition. Let
be the orbit representative and apply Corollary 2 with considering
and
as two separate subsets of
. Consider the quotient graph
that is a star graph
. If
, since for all connected components
C except one of them
, then for each pair of vertices
C and
from
, we have
—that is,
. With similar argument, we can prove that when
and the shortest paths between
and
is passing from
c, we have
Next, let
and the shortest paths between
and
never pass from
In this case, the quotient graph
—that is, the star graph
—is weighted by
in the center and for each pendant vertex; for instance
C, the weight is equal to
. Hence,
Since, the center
of the quotient graph
has the weight
, for each vertex
, we have
. On the other hand, if
C and
are two pendant vertices of
, then
Clearly,
has one element, hence the maximum value of (
9) or, generally, the maximum value of
happened when the connected component corresponding to
called
has no vertices from
—that is,
Note in Equation (
10) that if
then
and
and
. Therefore,
It should be noted that, in the last equation, the value ℓ comes from this fact that for each , the value .
Finally, we obtain the main result by applying the Equation (
11) in the modified Wiener index as follows:
The proof is complete in this case.
For equality, from Inequality (
12), we obtain that
for each
, and
for each
—that is,
, or if
, then
T is a path of odd order (
T is a centered tree). Alternately, the Inequality (
11) is equal in the path and star graph. It means that the equality is satisfied when
or
Vice versa, when
, then
, and if
(
n is odd), then
so one can easily see that the equality holds.
When
T is a bicentered tree, then we have the edge center
We treat
e as a vertex and define the
-partition
similar to the previous case. That is somewhat a tree of radius
Now, we can realize the
-partition as
, and Equation (
11) changes to
The additional term comes from the edge center e where the quotient graph is an edge. To complete the proof, we need to continue as before with some changes in the summation indices. □
Indeed, our approach gives a new method for computing distance-based graph invariants such as the modified Wiener index, terminal Wiener index, and so on. There are many research studies in chemistry, biology, or information theory in which the authors obtained some equalities or bounds for distance-based graph invariants on molecule graphs or networks, such as dendrimer nanostars, fullerenes, or mesh networks [
27,
28,
29,
30,
31]. Almost all of the mentioned researches have been applied to a traditional summation method between vertices, whereas in this paper, we prove a method based on a two-dimensional weight and an equivalence relation.