1 Introduction

Generalized cut method for computing the edge-Wiener index

Niko Tratnik

Faculty of Natural Sciences and Mathematics, University of Maribor, Slovenia

niko.tratnik@um.si

Abstract

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.

## 1 Introduction

The Wiener index of a connected graph , denoted as , is defined as the sum of distances between all (unordered) pairs of vertices. More precisely,

 W(G)=∑{u,v}⊆V(G)dG(u,v)=12∑u∈V(G)∑v∈V(G)dG(u,v),

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.

 d0G(e,f)=dL(G)(e,f),

since in this way the pair forms a metric space. Therefore, the edge-Wiener index of a connected graph is defined as

 We(G)=∑{e,f}⊆E(G)d0G(e,f)=12∑e∈E(G)∑f∈E(G)d0G(e,f).

In other words, is just the Wiener index of the line graph of , i.e.  and hence, the edge-Wiener index was investigated before it was formally introduced (for example, see [9, 10, 11]).

However, for edges , of a graph it is also possible to set

 d1G(e,f)=min{dG(x,a),dG(x,b),dG(y,a),dG(y,b)},

which was denoted by in . Such definition gives us another version of the edge-Wiener index, denoted by . More precisely,

 ˆWe(G)=12∑e∈E(G)∑f∈E(G)d1G(e,f).

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]):

 We(G)=ˆWe(G)+(|E(G)|2). (1)

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

 dG(e,f)=d1G(e,f).

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.

## 2 Preliminaries

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

 dG(v,e)=min{dG(v,x),dG(v,y)}.

The vertex-edge-Wiener index of a graph was defined in  as

 Wve(G)=∑v∈V(G)∑e∈E(G)dG(v,e).

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 :

 W(G,w) = 12∑u∈V(G)∑v∈V(G)w(u)w(v)dG(u,v), We(G,w′) = 12∑e∈E(G)∑f∈E(G)w′(e)w′(f)d0G(e,f), ˆWe(G,w′) = 12∑e∈E(G)∑f∈E(G)w′(e)w′(f)dG(e,f), Wve(G,w,w′) = ∑v∈V(G)∑e∈E(G)w(v)w′(e)dG(v,e).

Two edges , of a graph are in relation , , if

 dG(x,a)+dG(y,b)≠dG(x,b)+dG(y,a).

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 .

###### Lemma 2.1

[19, 24] Let be a connected graph. If is a partition coarser than -partition, then for any it holds

 dG(u,v)=r∑i=1dG/Fi(ℓi(u),ℓi(v)).

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 .

###### Definition 3.1

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.

###### Theorem 3.2

If is a connected graph and a partition coarser than -partition, then for every ,

 dG(e,f)=r∑i=1dG/Fi(αi(e),αi(f)).

Proof. Let and . Moreover, without loss of generality we can assume that . By Lemma 2.1 it follows

 dG(e,f)=r∑i=1dG/Fi(ℓi(x),ℓi(a)).

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

 dG(x,a)−dG(y,a) = r∑j=1dG/Fj(ℓj(x),ℓj(a))−r∑j=1dG/Fj(ℓj(y),ℓj(a)) = r∑j=1(dG/Fj(ℓj(x),ℓj(a))−dG/Fj(ℓj(y),ℓj(a))) = dG/Fi(ℓi(x),ℓi(a))−dG/Fi(ℓi(y),ℓi(a)).

Since , we now deduce and therefore,

 dG/Fi(αi(e),αi(f))=dG/Fi(ℓi(x)ℓi(y),ℓi(a))=dG/Fi(ℓi(x),ℓi(a)).
• 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

 dG(e,a)−dG(e,b) = dG(x,a)−dG(z,b) = r∑j=1dG/Fj(ℓj(x),ℓj(a))−r∑j=1dG/Fj(ℓj(z),ℓj(b)) = r∑j=1(dG/Fj(ℓj(x),ℓj(a))−dG/Fj(ℓj(z),ℓj(b))) = dG/Fi(ℓi(x),ℓi(a))−dG/Fi(ℓi(z),ℓi(b)).

Since , we now get

 dG/Fi(ℓi(x),ℓi(a))≤dG/Fi(ℓi(z),ℓi(b)). (2)

Obviously, , , and . By using similar reasoning as in Case 2, we can show

 dG/Fi(ℓi(x),ℓi(a)) ≤ dG/Fi(ℓi(y),ℓi(a)), dG/Fi(ℓi(z),ℓi(b)) ≤ dG/Fi(ℓi(x),ℓi(b)), dG/Fi(ℓi(z),ℓi(b)) ≤ dG/Fi(ℓi(y),ℓi(b)).

From these inequalities and from inequality (2) we conclude

 dG/Fi(αi(e),αi(f))=dG/Fi(ℓi(x)ℓi(y),ℓi(a)ℓi(b))=dG/Fi(ℓi(x),ℓi(a)).

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.

###### Theorem 3.3

If is an edge-weighted connected graph and a partition coarser than -partition, then

 ˆWe(G,w′)=r∑i=1(W(G/Fi,λi)+ˆWe(G/Fi,λ′i)+Wve(G/Fi,λi,λ′i)).

Proof. By using Theorem 3.2 we get

 ˆWe(G,w′) = 12∑e∈E(G)∑f∈E(G)w′(e)w′(f)dG(e,f) = 12∑e∈E(G)∑f∈E(G)w′(e)w′(f)(r∑i=1dG/Fi(αi(e),αi(f))) = r∑i=1(12∑e∈E(G)∑f∈E(G)w′(e)w′(f)dG/Fi(αi(e),αi(f))).

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,

 Ei1(G)={e∈E(G)|αi(e)∈V(G/Fi)},Ei2(G)={e∈E(G)|αi(e)∈E(G/Fi)}.

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:

 ˆWe(G,w′) = r∑i=1(12∑e∈Ei1(G)∑f∈Ei1(G)w′(e)w′(f)dG/Fi(αi(e),αi(f)) + 12∑e∈Ei2(G)∑f∈Ei2(G)w′(e)w′(f)dG/Fi(αi(e),αi(f)) + ∑e∈Ei1(G)∑f∈Ei2(G)w′(e)w′(f)dG/Fi(αi(e),αi(f))).

Let be two arbitrary distinct connected components of . Obviously, for any and it holds . Moreover,

 ∑e∈E(X)∑f∈E(Y)w′(e)w′(f)dG/Fi(αi(e),αi(f)) = dG/Fi(X,Y)∑e∈E(X)w′(e)∑f∈E(Y)w′(f) = λi(X)λi(Y)dG/Fi(X,Y).

Let , be two arbitrary distinct edges of the graph . Obviously, for any and it holds . Moreover,

 ∑e∈E∑f∈Fw′(e)w′(f)dG/Fi(αi(e),αi(f)) = dG/Fi(E,F)∑e∈Ew′(e)∑f∈Fw′(f) = λ′i(E)λ′i(F)dG/Fi(E,F).

Finally, let be a connected component of and an edge of the graph . Obviously, for any and it holds . Moreover,

 ∑e∈E(X)∑f∈Fw′(e)w′(f)dG/Fi(αi(e),αi(f)) = dG/Fi(X,F)∑e∈E(X)w′(e)∑f∈Fw′(f) = λi(X)λ′i(F)dG/Fi(X,F).

From the obtained calculations we finally conclude

 ˆWe(G,w′) = r∑i=1(12∑X∈V(G/Fi)∑Y∈V(G/Fi)λi(X)λi(Y)dG/Fi(X,Y) + 12∑E∈E(G/Fi)∑F∈E(G/Fi)λ′i(E)λ′i(F)dG/Fi(E,F) + ∑X∈V(G/Fi)∑F∈E(G/Fi)λi(X)λ′i(F)dG/Fi(X,F)) = r∑i=1(W(G/Fi,λi)+ˆWe(G/Fi,λ′i)+Wve(G/Fi,λi,λ′i))

and the proof is complete.

If we set for any , the following corollary follows by equality (1).

###### Corollary 3.4

If is a connected graph and a partition coarser than -partition, then

 We(G)=r∑i=1(W(G/Fi,λi)+ˆWe(G/Fi,λ′i)+Wve(G/Fi,λi,λ′i))+(|E(G)|2),

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 

###### Theorem 4.1

 Let be a connected vertex-weighted graph, , and . If is a graph defined by , , and for any , then

 W(G,w)=W(G′,w′)+∑{ci,cj}⊆C2w(ci)w(cj).
###### Corollary 4.2

 Let be a connected vertex-weighted graph, , , and for any , . If is defined as in Theorem 4.1, then

 W(G,w)=W(G′,w′)+a2k(k−1).

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

 I(ci)={cinj∈E(G)|j∈{1,…,s}},
 I(nj)={cinj∈E(G)|i∈{1,…,k}}

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.

###### Theorem 4.3

If is a connected edge-weighted graph, , , and , then

 ˆWe(G,we)=ˆWe(G′,w′e)+12∑cinj∈I(C)∑e∈I(C)ijwe(cinj)we(e).

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 ,