Generalized cut method for computing the edge-Wiener index
Faculty of Natural Sciences and Mathematics, University of Maribor, Slovenia
(Received July 20, 2019)
The edge-Wiener index of a connected graph is defined as the Wiener index of the line graph of . In this paper it is shown that the edge-Wiener index of an edge-weighted graph can be computed in terms of the Wiener index, the edge-Wiener index, and the vertex-edge-Wiener index of weighted quotient graphs which are defined by a partition of the edge set that is coarser than -partition. Thus, already known analogous methods for computing the edge-Wiener index of benzenoid systems and phenylenes are greatly generalized. Moreover, reduction theorems are developed for the edge-Wiener index and the vertex-edge-Wiener index since they can be applied in order to compute a corresponding index of a (quotient) graph from the so-called reduced graph. Finally, the obtained results are used to find the closed formula for the edge-Wiener index of an infinite family of graphs.
The Wiener index of a connected graph , denoted as , is defined as the sum of distances between all (unordered) pairs of vertices. More precisely,
where is the standard shortest path distance between vertices and of graph . The Wiener index was for the first time introduced by H. Wiener in 1947 . Since it has good correlations with a large number of physico-chemical properties of organic molecules and also possesses various interesting mathematical properties, it has been studied in many papers.
On the other hand, the edge-Wiener index of a graph was independently introduced in [14, 16]. In  it was suggested that the distance between two edges of a graph , here denoted by , should be defined as the distance between the corresponding vertices in the line graph of , i.e.
since in this way the pair forms a metric space. Therefore, the edge-Wiener index of a connected graph is defined as
However, for edges , of a graph it is also possible to set
which was denoted by in . Such definition gives us another version of the edge-Wiener index, denoted by . More precisely,
Note that in  the numbers and were denoted by and , respectively. It is easy to observe that for any two distinct edges of a graph it holds and therefore, and are connected in the following way (cf. [14, 16]):
For our purposes, turns out to be more convenient than . Hence, from technical reasons we also write instead of , i.e. for any two edges we set
Some recent results on the edge-Wiener index can be found in [5, 8, 20, 21, 23, 27]. Moreover, it is worth mentioning that the edge-Wiener index is closely related to the edge-Hosoya polynomial of a graph . In addition, for a recent survey on edge-Wiener descriptors see .
The cut method is a very useful tool for calculating distance-based topological indices and usually reduces the problem of calculating a topological index to the problem of calculating some indices of smaller graphs obtained by the edge cuts, see  for a recent survey. This method is often applied on benzenoid systems  or on partial cubes [25, 26]. In particular, some methods for computing the edge-Wiener index were developed, for instance, in [1, 2, 7, 29].
In  it has been proved that the edge-Wiener index of a benzenoid system can be computed by using the Wiener index, the edge-Wiener index, and the vertex-edge-Wiener index of the three weighted quotient trees obtained from elementary cuts. Later, a similar result has been established for phenylenes  (note that phenylenes and benzenoid systems represent important chemical graphs). In this paper, we generalize greatly the results from [15, 30] and prove that the edge-Wiener index of an edge-weighted graph can be calculated in terms of the Wiener index, the edge-Wiener index, and the vertex-edge-Wiener index of weighted quotient graphs defined by a partition of the edge set that is coarser than -partition. Therefore, our method is not restricted to some specific family of graphs and neither to partial cubes, but can be applied on any graph with at least two -classes. Consequently, the mentioned result can be used to develop very efficient algorithms for calculating the edge-Wiener index of important chemical graphs or networks and also to easily find closed formulas for some families of graphs. Such methods were recently developed also for some other distance-based topological indices: the Wiener index , the revised (edge-)Szeged index , the degree distance , the Graovac-Pisanski index .
As already mentioned, our method converts the problem of calculating the edge-Wiener index of a graph to the problem of calculating the three indices of weighted quotient graphs. However, it turns out that in some cases such a quotient graph can be further shrunk into the so-called reduced graph, so that the indices of the original graph can be computed from the reduced graph. In  it was shown that the Wiener index of a vertex-weighted graph can be computed from the Wiener index of a reduced graph. Therefore, we prove such results also for the edge-Wiener index and the vertex-edge-Wiener index.
The paper is organized in five sections. In the next section, some basic definitions and preliminary results are stated. In Section 3, it is firstly shown how the distance between two edges can be computed by using the corresponding distances in quotient graphs. Moreover, we use this result to obtain the cut method for computing the edge-Wiener index. Furthermore, the reduction theorems are proved in Section 4. Finally, in Section 5 the obtained results are applied to an infinite family of graphs in order to calculate the closed formula for the edge-Wiener index.
Unless stated otherwise, the graphs considered in this paper are simple, finite, and connected. For a vertex of a graph , we denote by , or shortly by , the open neighbourhood of , i.e. the set of vertices that are adjacent to . The distance between two vertices and the two distances between two edges have already been defined in the previous section. In addition, the distance between a vertex and an edge is
The vertex-edge-Wiener index of a graph was defined in  as
However, in  the vertex-edge-Wiener index was defined with the additional factor .
Next, we introduce the Wiener index, both versions of the edge-Wiener index, and the vertex-edge-Wiener index of weighted graphs. Let . If is a graph and , are given weights, then , , and are the vertex-weighted graph, the edge-weighted graph, and the vertex-edge-weighted graph, respectively. The corresponding Wiener indices of these graphs are defined as follows :
Two edges , of a graph are in relation , , if
Sometimes, this relation is also referred to as Djoković-Winkler relation. We can easily see that relation is reflexive and symmetric, but not necessarily transitive. Therefore, its transitive closure (i.e. the smallest transitive relation containing ) is denoted by . A sugraph of is an isometric subgraph if for all and an isometric subgraph of a hypercube is called a partial cube. It is known that in a partial cube relation is always transitive, so . Moreover, the class of partial cubes contains many interesting chemical graphs (for example benzenoid systems and phenylenes). For more information, see .
Let be the -partition of the set . A partition of is said to be coarser than if each set is the union of one or more -classes of .
Suppose is a graph and is some subset of its edges. The quotient graph is the graph whose vertices are connected components of the graph and two such components and are adjacent in if and only if some vertex from is adjacent to a vertex from in graph . If is an edge in graph , then we denote by also the set of edges of that have one end vertex in and the other end vertex in , i.e. .
Let be a connected graph and a partition coarser than -partition. For any , we define the function as follows: for any let be the connected component of the graph that contains . The result of the following lemma was obtained in . For the complete proof see also .
When is the -partition, the function , defined with for any , is called the canonical isometric embedding (see  for more details).
3 The main result
In this section we prove that the edge-Wiener index of a graph can be computed from the corresponding quotient graphs. Firstly, we define a function which maps any edge of either to a vertex or to an edge of a quotient graph. Note that our definition generalizes the corresponding definition from .
Let be a connected graph and a partition coarser than -partition. For any , we introduce the function by
where is an arbitrary edge of .
We can now show how the distance between two edges can be computed by using the distances in the quotient graphs. In the proof, we use some ideas from [15, 22] but many additional insights are also needed.
If is a connected graph and a partition coarser than -partition, then for every ,
Proof. Let and . Moreover, without loss of generality we can assume that . By Lemma 2.1 it follows
To finish the proof, we show that for any . Therefore, choose an arbitrary and consider the following cases.
Case 1. and .
We obtain and . Therefore, the result follows.
Case 2. and .
Obviously, and for any , , it holds . Thus, we obtain for all . Moreover, by Lemma 2.1 it follows
Since , we now deduce and therefore,
Case 3. and .
This case is similar to Case 2.
Case 4. and .
It is clear that and for any , , it holds and . Suppose that , where . We can calculate
Since , we now get
Obviously, , , and . By using similar reasoning as in Case 2, we can show
From these inequalities and from inequality (2) we conclude
In each case it holds , which completes the proof.
Let be a connected edge-weighted graph and a partition coarser than -partition. The quotient graphs , , are extended to weighted graphs , , in the following way:
for , we define as the sum of all the weights of edges in the connected component of , i.e. ;
for , we define as the sum of all the weights of edges in that have one end vertex in and the other end vertex in , i.e. .
The following theorem is the main result of the paper.
If is an edge-weighted connected graph and a partition coarser than -partition, then
Proof. By using Theorem 3.2 we get
For any , we denote by and the set of edges of that are mapped by function to a vertex or to an edge, respectively. More precisely,
Obviously, it holds and for any . Therefore, for two distinct edges of we have three possibilities: both edges belong to , both edges belong to , or one edge belongs to and the other belongs to . Consequently, the inner sums can be partitioned into three parts:
Let be two arbitrary distinct connected components of . Obviously, for any and it holds . Moreover,
Let , be two arbitrary distinct edges of the graph . Obviously, for any and it holds . Moreover,
Finally, let be a connected component of and an edge of the graph . Obviously, for any and it holds . Moreover,
From the obtained calculations we finally conclude
and the proof is complete.
If we set for any , the following corollary follows by equality (1).
If is a connected graph and a partition coarser than -partition, then
where , are defined as follows: is the number of edges in the connected component and is the number of edges in that have one end vertex in and the other end vertex in .
4 Reduction theorems
It was shown in  that in some cases the problem of computing the Wiener index of a vertex-weighted graph can be reduced to the problem of computing the Wiener index of a smaller graph obtained by a special reduction. Such a reduction can be defined, for example, by the so-called relation , which is important also elsewhere since the vertices that are in this relation are often called twins. In this section, we develop analogous results for the edge-Wiener index and for the vertex-edge-Wiener index, since these indices are needed to efficiently compute the edge-Wiener index in terms of Corollary 3.4. An example showing how these reductions can be used is provided in the next section.
Let be a graph. Two vertices and are in relation if . It is easy to see that is an equivalence relation on the set of vertices . The -equivalence class containing will be denoted with . The following theorem and corollary were obtained in 
 Let be a connected vertex-weighted graph, , and . If is a graph defined by , , and for any , then
However, in  it was assumed that a weight is a function to the set , but the same proof works also when .
In the rest of the section, we define the reduced graph as in Theorem 4.1. For any , let and the graph defined by . Let us denote for any . Moreover, we denote
for any or . In other words, is the set of edges that are incident with vertex and is the set of edges that are incident to and a vertex from . We also set , which represents the set of edges that are incident to a vertex of . In addition, for any , , let .
Furthermore, for any weight we define the weight by and for any . Finally, for any weight we define the weight in the following way: , , and for any . Now we can state our results.
If is a connected edge-weighted graph, , , and , then
Proof. If , and the result obviously follows. Therefore, let and . We can easily see
holds for any , , and ,
holds for any two edges ,
holds for any ,