Keywords

14.1 Introduction

In this chapter, we consider connected finite graphs without any loops or multiple edges. In theoretical chemistry, the physicochemical properties of chemical compounds are often modeled by means of molecular-graph -based structure descriptors, which are also referred to as topological indices (Gutman and Polansky 1986; Trinajstić 1992; Todeschini and Consonni 2000; Diudea 2001). In the other words, a topological index Top(G) of a graph G is a real number with the property that for every graph H isomorphic to G, \( \mathrm{Top}(H)=\mathrm{Top}(G) \). Among the variety of topological indices which are designed to capture the different aspects of molecular structure, the Wiener index is the best known one. Vertex version of the Wiener index is the first reported distance -based topological index which was introduced by Wiener (1947a, b). Wiener used his index, for the calculation of the boiling points of alkanes. Using the language which in theoretical chemistry emerged several decades after Wiener, we may say that the Wiener index was conceived as the sum of distances between all pairs of vertices in the molecular graph of an alkane, with the evident aim to provide a measure of the compactness of the respective hydrocarbon molecule. From graph-theoretical point of view, Wiener index of a graph G is defined as:

$$ W(G)={\displaystyle \sum_{\left\{u,v\right\}\subseteq V(G)}d\left(u,v\left|G\right.\right)}, $$

where d(u, v|G) denotes the distance between the vertices u and v of G which is defined as the length of any shortest path in G connecting them. Wiener index happens to be one of the most frequently and most successfully employed structural descriptors that can be deduced from the molecular graph . Since 1976, the Wiener number has found a remarkable variety of chemical applications. Physical and chemical properties of organic substances, which can be expected to depend on the area of the molecular surface and/or on the branching of the molecular carbonatom skeleton, are usually well correlated with the Wiener index . Among them are the heats of formation, vaporization and atomization, density, boiling point, critical pressure, refractive index, surface tension and viscosity of various acyclic and cyclic, saturated and unsaturated as well as aromatic hydrocarbon species, velocity of ultrasound in alkanes and alcohols, rate of electro reduction of chlorobenzenes etc. (Gutman et al. 1993). We refer the reader to Buckley and Harary (1990); Graovac and Pisanski (1991); Gutman (1994); Diudea (1995); Dobrynin et al. (2001); John and Diudea (2004); Ashrafi and Yousefi (2007); and Putz et al. (2013), for more information about the Wiener index .

The Wiener polynomial of a graph G is defined in terms of a parameter q as follows:

$$ W\left(G;q\right)={\displaystyle \sum_{\left\{u,v\right\}\subseteq V(G)}{q}^{d\left(u,v\left|G\right.\right)}}. $$

This coincides with the definition of Hosoya (1988) and Sagan et al. (1996). It is clear that, the first derivative of the Wiener polynomial of G at \( q=1 \) is equal to the Wiener index of G, i.e., \( {W}^{\prime}\left(G;1\right)=W(G) \).

Edge versions of the Wiener index based on distance between all pairs of edges in a graph G were introduced independently by (Dankelman et al. 2009; Iranmanesh et al. 2009; and Khalifeh et al. 2009b). Two possible distances between the edges \( e=uv \) and \( f=zt \) of a graph G can be considered (Iranmanesh et al. 2009). The first distance is denoted by d 0(e, f|G) and defined as follows:

$$ {d}_0\left(e,f\Big|G\operatorname{}\right)=\Big\{\begin{array}{l}{d}_1\left(e,f\Big|G\operatorname{}\right)+1\kern1em if\kern0.5em e\ne f,\\ {}0\kern6.1em if\kern0.5em e=f,\end{array}\operatorname{} $$

where \( {d}_1\left(e,f\left|G\right.\right)= \min \left\{d\left(u,z\left|G\right.\right),d\left(u,t\left|G\right.\right),d\left(v,z\left|G\right.\right),d\left(v,t\left|G\right.\right)\right\} \). It is easy to see that \( {d}_0\left(e,f\left|G\right.\right)=d\left(e,f\left|L(G)\right.\right) \), where L(G) is the line graph of G.

The second distance is denoted by d 4(e, f|G) and defined as follows:

$$ {d}_4\left(e,f\Big|G\operatorname{}\right)=\Big\{\begin{array}{l}{d}_2\left(e,f\Big|G\operatorname{}\right)\kern1em if\kern0.5em e\ne f,\\ {}0\kern4.4em if\kern0.5em e=f,\end{array}\operatorname{} $$

where \( {d}_2\left(e,f\left|G\right.\right)= \max \left\{d\left(u,z\left|G\right.\right),d\left(u,t\left|G\right.\right),d\left(v,z\left|G\right.\right),d\left(v,t\left|G\right.\right)\right\} \).

Corresponding to the above distances , two edge versions of the Wiener index can be defined. The first and second edge-Wiener indices of G are denoted by \( {W}_{e_0}(G) \) and \( {W}_{e_4}(G) \), respectively and defined as follows (Iranmanesh et al. 2009):

$$ {W}_{e_i}(G)={\displaystyle \sum_{\left\{e,f\right\}\subseteq E(G)}{d}_i\left(e,f\left|G\right.\right)},\kern0.5em i\in \left\{0,4\right\}. $$

Obviously, \( {W}_{e_0}(G)=W\left(L(G)\right) \). Details on the edge − Wiener indices can be found in (Gutman 2010; Yousefi−Azari et al. 2011; Nadjafi−Arani et al. 2012; Iranmanesh 2013; Azari and Iranmanesh 2014a, b; Iranmanesh and Azari 2015b) and the references quoted therein.

The edge-Wiener polynomials of a graph G are introduced in terms of a parameter q as follows:

$$ {W}_{e_i}\left(G;q\right)={\displaystyle \sum_{\left\{e, f\right\}\subseteq E(G)}{q}^{d_i\left(e, f\left|G\right.\right)}},\kern0.5em i\in \left\{0,4\right\}. $$

It is clear that, the first derivative of the edge-Wiener polynomials at \( q=1 \) is equal to their corresponding edge-Wiener indices, i.e., \( {W}_{e_i}^{\prime}\left(G;1\right)={W}_{e_i}(G) \), where \( i\in \left\{0,4\right\} \).

Vertex-edge versions of the Wiener index based on the distance between vertices and edges in a graph G were introduced in Khalifeh et al. (2009b); Azari and Iranmanesh (2011b); and Azari et al. (2013b). The distance between the vertex u and the edge \( e= ab \) of a graph G can be defined in two ways. The first distance is denoted by D 1(u, e|G) and defined as follows:

$$ {D}_1\left(u,e\left|G\right.\right)= \min \left\{d\left(u,a\left|G\right.\right),d\left(u,b\left|G\right.\right)\right\}. $$

The second distance is denoted by D 2(u, e|G) and defined as follows:

$$ {D}_2\left(u,e\left|G\right.\right)= \max \left\{d\left(u,a\left|G\right.\right),d\left(u,b\left|G\right.\right)\right\}. $$

Corresponding to these two distances , two vertex-edge versions of the Wiener index can be defined. The first and second vertex-edge Wiener indices of G are denoted by \( {W}_{v{e}_1}(G) \) and \( {W}_{v{e}_2}(G) \), respectively and defined as follows (Azari et al. 2013b):

$$ {W}_{v{e}_i}(G)={\displaystyle \sum_{u\in V(G)}{\displaystyle \sum_{e\in E(G)}{D}_i\left(u,e\left|G\right.\right)}},\kern0.5em i\in \left\{1,2\right\}. $$

One can easily see that, for arbitrary edges \( e=uv \) and \( f=zt \) of G, the quantities d i and D i , \( i\in \left\{1,2\right\} \), satisfy in the following relations:

$$ {d}_1\left(e,f\left|G\right.\right)= \min \left\{{D}_1\left(u,f\left|G\right.\right),{D}_1\left(v,f\left|G\right.\right)\right\}= \min \left\{{D}_1\left(z,e\left|G\right.\right),{D}_1\left(t,e\left|G\right.\right)\right\}, $$
$$ {d}_2\left(e,f\left|G\right.\right)= \max \left\{{D}_2\left(u,f\left|G\right.\right),{D}_2\left(v,f\left|G\right.\right)\right\}= \max \left\{{D}_2\left(z,e\left|G\right.\right),{D}_2\left(t,e\left|G\right.\right)\right\}. $$

The above relations explain the relationship between the edge versions and vertex-edge versions of the Wiener index .

The vertex-edge Wiener polynomials of a graph G are introduced in terms of a parameter q as follows (Azari and Iranmanesh 2011b; Azari et al. 2011):

$$ {W}_{v{e}_i}\left(G;q\right)={\displaystyle \sum_{u\in V(G)}{\displaystyle \sum_{e\in E(G)}{q}^{D_i\left(u,e\left|G\right.\right)}}},\kern0.5em i\in \left\{1,2\right\}. $$

It is easy to see that the first derivative of the vertex-edge Wiener polynomials at \( q=1 \) are equal to their corresponding vertex- edge Wiener indices, i.e., \( {W}_{v{e}_i}^{\prime}\left(G;1\right)={W}_{v{e}_i}(G) \), where \( i\in \left\{1,2\right\} \). The first and the second vertex-edge Wiener indices and polynomials are also called the minimum and maximum indices and polynomials, respectively.

The Zagreb indices are among the oldest topological indices and were introduced by Gutman and Trinajstić (1972). The first and second Zagreb indices of G are denoted by M 1(G) and M 2(G), respectively, and defined as:

$$ {M}_1(G)={\displaystyle \sum_{u\in V(G)}{ \deg}_G{(u)}^2}\kern0.75em \mathrm{and}\kern0.5em {M}_2(G)={\displaystyle \sum_{uv\in E(G)}{ \deg}_G(u){ \deg}_G(v)}, $$

where deg G (u) denotes the degree of the vertex u in G which is the number of vertices incident to u.

The first Zagreb index can also be expressed as a sum over edges of G:

$$ {M}_1(G)={\displaystyle \sum_{uv\in E(G)}\left[{ \deg}_G(u)+{ \deg}_G(v)\right]}. $$

For details on the theory and applications of Zagreb indices see Gutman et al. (1975); Gutman and Das (2004); Zhou (2004); Zhou and Gutman (2005); Khalifeh et al. (2009a); Azari and Iranmanesh (2011a, 2013); Réti (2012); Azari et al. (2013a); Falahati-Nezhad (2014); and Iranmanesh and Azari (2015a).

Let N G (u) denote the set of all first neighbors of u in G. Clearly, the cardinality of N G (u) is equal to deg G (u). We define three quantities related to the graph G as follows:

$$ {N}_1(G)={\displaystyle \sum_{uv\in E(G)}\left|{N}_G(u)\cap {N}_G(v)\right|}, $$
$$ {N}_2(G)={\displaystyle \sum_{uv\in E(G)}{\displaystyle \sum_{z\in {N}_G(u)\cap {N}_G(v)}\left|{N}_G(u)\cap {N}_G(v)\cap {N}_G(z)\right|}}, $$
$$ {N}_3(G)={\displaystyle \sum_{uv\in E(G)}{\displaystyle \sum_{z\in V(G)\backslash \left({N}_G(u)\cup {N}_G(v)\right)}\left|{N}_G(z)\backslash \left({N}_G(u)\cup {N}_G(v)\right)\right|}}. $$

It is easy to see that the quantity N 1(G) is equal to three times the number of all triangles in G. Also, by inclusion–exclusion principle, we obtain:

$$ \begin{array}{l}\left|{N}_G(z)\setminus \left({N}_G(u)\cup {N}_G(v)\right)\right|={ \deg}_G(z)-\left|{N}_G(u)\cap {N}_G(z)\right|-\left|{N}_G(v)\cap {N}_G(z)\right|\\ {}\kern11.45em +\left|{N}_G(u)\cap {N}_G(v)\cap {N}_G(z)\right|.\end{array} $$

The fact that many interesting graphs are composed of simpler graphs that serve as their basic building blocks prompted interest in the type of relationship between the Wiener index and polynomial of composite graphs and their building blocks (Yeh and Gutman 1994; Sagan et al. 1996; Stevanović 2001; Eliasi et al. 2012; Eliasi and Iranmanesh 2013). This development was followed by some articles (Azari et al. 2010, 2012; Azari and Iranmanesh 2011b, 2014a, b; Alizadeh et al. 2014) that established corresponding relationships for the edge-Wiener indices.

In this chapter, we review our recent results on computing the first and second edge-Wiener indices of some composite graphs. All considered operations are binary. Hence, we will usually deal with two simple connected graphs G 1 and G 2. For a given graph G i , its vertex and edge sets will be denoted by V(G i ) and E(G i ), respectively, and their cardinalities by n i and e i , respectively, where \( i\in \left\{1,2\right\} \). The chapter is organized as follows. In Sect. 14.2, the first and second edge-Wiener polynomials and their related indices are computed for the Cartesian product of graphs. In Sects. 14.3 and 14.4, we compute the first edge-Wiener index of the join and corona product of graphs, respectively. Finally, in Sect. 14.5, an exact formula is obtained for the second edge-Wiener index of the composition of graphs.

14.2 Cartesian Product

In this section , we compute the first and second edge-Wiener polynomials and their related indices for the Cartesian product of graphs. We start this section by definition of the Cartesian product of graphs.

The Cartesian product \( {G}_1\times {G}_2 \) of the graphs G 1 and G 2 is a graph with the vertex set \( V\left({G}_1\right)\times V\left({G}_2\right) \) and two vertices \( u=\left({u}_1,{u}_2\right) \) and \( v=\left({v}_1,{v}_2\right) \) of \( {G}_1\times {G}_2 \) are adjacent if and only if \( \left[{u}_1={v}_1\ \mathrm{and}\ {u}_2{v}_2\in E\left({G}_2\right)\right] \) or \( \left[{u}_2={v}_2\ \mathrm{and}\ {u}_1{v}_1\in E\left({G}_1\right)\right] \). Hence, we can consider the edge set of \( {G}_1\times {G}_2 \) as \( E\left({G}_1\times {G}_2\right)={E}_1\cup {E}_2 \), where E 1 and E 2 are the following disjoint sets:

$$ {E}_1=\left\{\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right):{u}_1\in V\left({G}_1\right),{u}_2{v}_2\in E\left({G}_2\right)\right\}, $$
$$ {E}_2=\left\{\left({u}_1,{u}_2\right)\left({v}_1,{u}_2\right):{u}_1{v}_1\in E\left({G}_1\right),{u}_2\in V\left({G}_2\right)\right\}. $$

The number of vertices and edges in \( {G}_1\times {G}_2 \) are given by:

$$ \left|V\left({G}_1\times {G}_2\right)\right|={n}_1{n}_2\kern0.5em \mathrm{and}\kern0.5em \left|E\left({G}_1\times {G}_2\right)\right|={n}_1{e}_2+{n}_2{e}_1. $$

The Cartesian product of two graphs is associative and commutative and it is connected if and only if both components are connected. According to the proof of Theorem 1 in Stevanović (2001), the distance between the vertices \( u=\left({u}_1,{u}_2\right) \) and \( v=\left({v}_1,{v}_2\right) \) of \( {G}_1\times {G}_2 \) is given by:

$$ d\left(u,v\left|{G}_1\times {G}_2\right.\right)=d\left({u}_1,{v}_1\left|{G}_1\right.\right)+d\left({u}_2,{v}_2\left|{G}_2\right.\right). $$

Lemma 14.2.1

$$ {\displaystyle \sum_{\left\{e,f\right\}\subseteq {E}_1}{q}^{d_i\left(e,f\left|{G}_1\times {G}_2\right.\right)}}={e}_2qW\left({G}_1;q\right)+{W}_{e_i}\left({G}_2;q\right)\left[2W\left({G}_1;q\right)+{n}_1\right],\kern0.5em i\in \left\{0,4\right\}. $$

Proof

By definition of the set E 1, for \( i\in \left\{0,4\right\} \), we have:

$$ {\displaystyle \sum_{\left\{e,f\right\}\subseteq {E}_1}{q}^{d_i\left(e,f\left|{G}_1\times {G}_2\right.\right)}}={\displaystyle \sum_{\left\{{u}_1,{a}_1\right\}\subseteq V\left({G}_1\right)}{\displaystyle \sum_{u_2{v}_2\in E\left({G}_2\right)}{q}^{d_i\left(\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),\left({a}_1,{u}_2\right)\left({a}_1,{v}_2\right)\left|{G}_1\times {G}_2\right.\right)}}} $$
$$ +{\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{a_1\in V\left({G}_1\right)}{\displaystyle \sum_{\left\{{u}_2{v}_2,{a}_2{b}_2\right\}\subseteq E\left({G}_2\right)\kern-3.5em }{q}^{d_i(({u}_1,{u}_2\left)\left({u}_1,{v}_2\right),\left({a}_1,{a}_2\right)\left({a}_1,{b}_2\right)\right|{G}_1\times {G}_2\operatorname{}\Big)}}}} $$
$$ ={\displaystyle \sum_{\left\{{u}_1,{a}_1\right\}\subseteq V\left({G}_1\right)}{\displaystyle \sum_{u_2{v}_2\in E\left({G}_2\right)}{q}^{d\left({u}_1,{a}_1\Big|{G}_1\operatorname{}\right)+1}}} $$
$$ +{\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{a_1\in V\left({G}_1\right)}{\displaystyle \sum_{\left\{{u}_2{v}_2,{a}_2{b}_2\right\}\subseteq E\left({G}_2\right)\kern-3.5em }{q}^{d\left({u}_1,{a}_1\Big|{G}_1\operatorname{}\right)+{d}_i\left({u}_2{v}_2,{a}_2{b}_2\Big|{G}_2\operatorname{}\right)}}}} $$
$$ \kern2.4em ={e}_2qW({G}_1;q)+{W}_{e_i}({G}_2;q)[2W({G}_1;q)+{n}_1]. $$

Lemma 14.2.2

$$ {\displaystyle \sum_{\left\{e,f\right\}\subseteq {E}_2}{q}^{d_i\left(e,f\left|{G}_1\times {G}_2\right.\right)}}={e}_1qW\left({G}_2;q\right)+{W}_{e_i}\left({G}_1;q\right)\left[2W\left({G}_2;q\right)+{n}_2\right],\kern0.5em i\in \left\{0,4\right\}. $$

Proof

Similar to the proof of Lemma 14.2.1, we can obtain the desired result.

Lemma 14.2.3

  1. 1.

    \( {\displaystyle \sum_{e\in {E}_1,f\in {E}_2}{q}^{d_0\left(e,f\left|{G}_1\times {G}_2\right.\right)}}=q{W}_{v{e}_1}\left({G}_1;q\right){W}_{v{e}_1}\left({G}_2;q\right), \)

  2. 2.

    \( {\displaystyle \sum_{e\in {E}_1,f\in {E}_2}{q}^{d_4\left(e, f\left|{G}_1\times {G}_2\right.\right)}}={W}_{v{e}_2}\left({G}_1;q\right){W}_{v{e}_2}\left({G}_2;q\right). \)

Proof

We compute:

  1. 1.

    \( \begin{array}{ll}{\displaystyle \sum_{e\in {E}_1,f\in {E}_2}{q}^{d_0\left(e,f\left|{G}_1\times {G}_2\right.\right)}}& ={\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{u_2{v}_2\in E\left({G}_2\right)}{\displaystyle \sum_{a_1{b}_1\in E\left({G}_1\right)}{\displaystyle \sum_{a_2\in V\left({G}_2\right)}{q}^{d_0\left(\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),\left({a}_1,{a}_2\right)\left({b}_1,{a}_2\right)\left|{G}_1\times {G}_2\right.\right)}}}}}\hfill \\ {}& ={\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{u_2{v}_2\in E\left({G}_2\right)}{\displaystyle \sum_{a_1{b}_1\in E\left({G}_1\right)}{\displaystyle \sum_{a_2\in V\left({G}_2\right)}{q}^{1+{D}_1\left({u}_1,{a}_1{b}_1\left|{G}_1\right.\right)+{D}_1\left({a}_2,{u}_2{v}_2\left|{G}_2\right.\right)}}}}}\hfill \\ {}& =q{\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{a_1{b}_1\in E\left({G}_1\right)}{q}^{D_1\left({u}_1,{a}_1{b}_1\left|{G}_1\right.\right)}}}{\displaystyle \sum_{a_2\in V\left({G}_2\right)}{\displaystyle \sum_{u_2{v}_2\in E\left({G}_2\right)}{q}^{D_1\left({a}_2,{u}_2{v}_2\left|{G}_2\right.\right)}}}\hfill \\ {}& =q{W}_{v{e}_1}\left({G}_1;q\right){W}_{v{e}_1}\left({G}_2;q\right).\hfill \end{array} \)

  2. 2.

    \( \begin{array}{ll}{\displaystyle \sum_{e\in {E}_1,f\in {E}_2}{q}^{d_4\left(e,f\left|{G}_1\times {G}_2\right.\right)}}& ={\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{u_2{v}_2\in E\left({G}_2\right)}{\displaystyle \sum_{a_1{b}_1\in E\left({G}_1\right)}{\displaystyle \sum_{a_2\in V\left({G}_2\right)}{q}^{d_4\left(\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),\left({a}_1,{a}_2\right)\left({b}_1,{a}_2\right)\left|{G}_1\times {G}_2\right.\right)}}}}}\hfill \\ {}& ={\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{u_2{v}_2\in E\left({G}_2\right)}{\displaystyle \sum_{a_1{b}_1\in E\left({G}_1\right)}{\displaystyle \sum_{a_2\in V\left({G}_2\right)}{q}^{D_2\left({u}_1,{a}_1{b}_1\left|{G}_1\right.\right)+{D}_2\left({a}_2,{u}_2{v}_2\left|{G}_2\right.\right)}}}}}\hfill \\ {}& ={\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{a_1{b}_1\in E\left({G}_1\right)}{q}^{D_2\left({u}_1,{a}_1{b}_1\left|{G}_1\right.\right)}}}{\displaystyle \sum_{a_2\in V\left({G}_2\right)}{\displaystyle \sum_{u_2{v}_2\in E\left({G}_2\right)}{q}^{D_2\left({a}_2,{u}_2{v}_2\left|{G}_2\right.\right)}}}\hfill \\ {}& ={W}_{v{e}_2}\left({G}_1;q\right){W}_{v{e}_2}\left({G}_2;q\right).\hfill \end{array} \)

Now, we use the previous lemmas to prove the main theorem of this section.

Theorem 14.2.4

The first and second edge-Wiener polynomials of \( {G}_1\times {G}_2 \) are given by:

  1. 1.

    \( \begin{array}{l}{W}_{e_0}\left({G}_1\times {G}_2;q\right)={e}_2qW\left({G}_1;q\right)+{e}_1qW\left({G}_2;q\right)+{n}_2{W}_{e_0}\left({G}_1;q\right)+{n}_1{W}_{e_0}\left({G}_2;q\right)\end{array} \) \( \begin{array}{l}+2W\left({G}_1;q\right){W}_{e_0}\left({G}_2;q\right)+2W\left({G}_2;q\right){W}_{e_0}\left({G}_1;q\right)+q{W}_{v{e}_1}\left({G}_1;q\right){W}_{v{e}_1}\left({G}_2;q\right),\end{array} \)

  2. 2.

    \( \begin{array}{l}{W}_{e_4}\left({G}_1\times {G}_2;q\right)={e}_2qW\left({G}_1;q\right)+{e}_1qW\left({G}_2;q\right)+{n}_2{W}_{e_4}\left({G}_1;q\right)+{n}_1{W}_{e_4}\left({G}_2;q\right)\end{array} \) \( \begin{array}{l}+2W\left({G}_1;q\right){W}_{e_4}\left({G}_2;q\right)+2W\left({G}_2;q\right){W}_{e_4}\left({G}_1;q\right)+{W}_{v{e}_2}\left({G}_1;q\right){W}_{v{e}_2}\left({G}_2;q\right).\end{array} \)

Proof

Since \( E\left({G}_1\times {G}_2\right)={E}_1\cup {E}_2 \) and \( {E}_1\cap {E}_2=\phi \), so for \( i\in \left\{0,4\right\} \), we have:

$$ {W}_{e_i}\left({G}_1\times {G}_2;q\right)={\displaystyle \sum_{\left\{e,f\right\}\subseteq E\left({G}_1\times {G}_2\right)}{q}^{d_i\left(e,f\left|{G}_1\right.\times {G}_2\right)}}={\displaystyle \sum_{\left\{e,f\right\}\subseteq {E}_1}{q}^{d_i\left(e,f\left|{G}_1\right.\times {G}_2\right)}}+{\displaystyle \sum_{\left\{e,f\right\}\subseteq {E}_2}{q}^{d_i\left(e,f\left|{G}_1\right.\times {G}_2\right)}}+{\displaystyle \sum_{e\in {E}_1,f\in {E}_2}{q}^{d_i\left(e,f\left|{G}_1\right.\times {G}_2\right)}}. $$

Using the previous lemmas, the proof is obvious.

As a direct consequence of the previous theorem, we can compute the first and second edge-Wiener indices of the Cartesian product as given in Azari and Iranmanesh (2011b).

Corollary 14.2.5

The first and second edge-Wiener indices of \( {G}_1\times {G}_2 \) are given by:

  1. 1.

    \( \begin{array}{ll}{W}_{e_0}\left({G}_1\times {G}_2\right)=& {e_2}^2W\left({G}_1\right)+{e_1}^2W\left({G}_2\right)+{n_2}^2{W}_{e_0}\left({G}_1\right)\hfill \\ {}& +{n_1}^2{W}_{e_0}\left({G}_2\right)+\left(\underset{2}{\overset{n_1}{}}\right){e}_2+\left(\underset{2}{\overset{n_2}{}}\right){e}_1+{n}_1{n}_2{e}_1{e}_2\hfill \\ {}& +{n}_2{e}_2{W}_{v{e}_1}\left({G}_1\right)+{n}_1{e}_1{W}_{v{e}_1}\left({G}_2\right),\hfill \end{array} \)

  2. 2.

    \( \begin{array}{ll}{W}_{e_4}\left({G}_1\times {G}_2\right)=& {e_2}^2W\left({G}_1\right)+{e_1}^2W\left({G}_2\right)+{n_2}^2{W}_{e_4}\left({G}_1\right)\hfill \\ {}& +{n_1}^2{W}_{e_4}\left({G}_2\right)+\left(\underset{2}{\overset{n_1}{}}\right){e}_2+\left(\underset{2}{\overset{n_2}{}}\right){e}_1+{n}_2{e}_2{W}_{v{e}_2}\left({G}_1\right)\hfill \\ {}& +{n}_1{e}_1{W}_{v{e}_2}\left({G}_2\right).\hfill \end{array} \)

Now, we use Corollary 14.2.5 to find the first and second edge-Wiener indices of the rectangular grids, \( {C}_4- \) nanotubes and \( {C}_4- \) nanotori. The Wiener, edge-Wiener and vertex-edge Wiener indices of the n-vertex path P n and n-vertex cycle C n were computed in Sagan et al. (1996); Iranmanesh et al. (2009); and Azari and Iranmanesh (2011b), respectively. We list these results in Table 14.1.

Table 14.1 The wiener, edge − wiener and vertex − edge wiener indices of paths and cycles

Consider the rectangular grid \( {P}_n\times {P}_m \) shown in Fig. 14.1. Using Corollary 14.2.5 and Table 14.1, we can get the formula for the edge-Wiener indices of \( {P}_n\times {P}_m \) as given in Azari and Iranmanesh (2011b).

Fig. 14.1
figure 1

The rectangular grid \( {P}_n\times {P}_m \)

Corollary 14.2.6

The first and second edge-Wiener indices of \( G={P}_n\times {P}_m \) are given by:

  1. 1.

    \( {W}_{e_0}(G)=\frac{m^3}{6}{\left(2n-1\right)}^2+\frac{m^2}{6}\left(4{n}^3-12{n}^2+8n-3\right)-\frac{m}{3}\left(2{n}^3-4{n}^2+2n-1\right)+\frac{n}{6}\left({n}^2-3n+2\right), \)

  2. 2.

    \( {W}_{e_4}(G)=\frac{m^3}{6}{\left(2n-1\right)}^2+\frac{m^2}{6}\left(4{n}^3-7n+3\right)-\frac{m}{6}\left(4{n}^3+7{n}^2-2n-2\right)+\frac{n}{6}\left({n}^2+3n+2\right). \)

Let \( G={P}_n\times {C}_m \), then \( G=TU{C}_4\left(m,n\right) \) is a C 4 −nanotube (see Fig. 14.2). Using Corollary 14.2.5 and Table 14.1, we can compute the edge-Wiener indices of \( {C}_4- \) nanotubes as given in Azari and Iranmanesh (2011b).

Fig. 14.2
figure 2

A \( {C}_4- \) Nanotube

Corollary 14.2.7

The first and second edge-Wiener indices of \( G=TU{C}_4\left(m,n\right) \) are given by:

  1. 1.

    \( \begin{array}{ll}\hfill & {W}_{e_0}(G)\\ {}& =\left\{\begin{array}{l}\frac{m^3}{8}{\left(2n-1\right)}^2+\frac{m^2}{6}\left(4{n}^3-6{n}^2+5n-3\right)+\frac{m}{8}\left(4{n}^2-8n+3\right)\begin{array}{cc}\hfill \hfill & \hfill \hfill \end{array}\mathrm{if}\ m\ \mathrm{is}\ \mathrm{odd},\\ {}\frac{m^3}{8}{\left(2n-1\right)}^2+\frac{m^2}{6}\left(4{n}^3-6{n}^2+5n-3\right)+\frac{m}{2}{\left(n-1\right)}^2\begin{array}{cccc}\hfill \hfill & \hfill \hfill & \hfill \hfill & \hfill \hfill \end{array}\kern0.7em \mathrm{if}\ m\ \mathrm{is}\ \mathrm{even},\end{array}\right.\hfill \end{array} \)

  2. 2.

    \( \begin{array}{ll}\hfill & {W}_{e_4}(G)\\ {}& =\left\{\begin{array}{l}\frac{m^3}{8}{\left(2n-1\right)}^2+\frac{m^2}{6}\left(4{n}^3+6{n}^2-10n+3\right)-\frac{m}{8}\left(16{n}^2-3\right)\begin{array}{ccc}\hfill \hfill & \hfill \hfill & \hfill \hfill \end{array}\mathrm{if}\ m\ \mathrm{is}\ \mathrm{odd},\\ {}\frac{m^3}{8}{\left(2n-1\right)}^2+\frac{m^2}{6}\left(4{n}^3+6{n}^2-10n+3\right)-\frac{m}{2}\left({n}^2+2n-1\right)\begin{array}{cc}\hfill \hfill & \hfill \hfill \end{array}\mathrm{if}\ m\ \mathrm{is}\ \mathrm{even}.\end{array}\right.\hfill \end{array} \)

Let \( G={C}_n\times {C}_m \), then \( G=T{C}_4\left(m,n\right) \) is a \( {C}_4- \) nanotorus (see Fig. 14.3). Using Corollary 14.2.5 and Table 14.1, we can compute the edge-Wiener indices of \( {C}_4- \) nanotori as given in Azari and Iranmanesh (2011b).

Fig. 14.3
figure 3

A \( {C}_4- \) Nanotorus

Corollary 14.2.8

The first and second edge-Wiener indices of \( G=T{C}_4\left(n,m\right) \) are given by:

  1. 1.

    \( {W}_{e_0}(G)=\frac{m^3}{2}{n}^2+\frac{m^2}{2}n\left({n}^2+1\right)+\frac{m}{2}n\left(n-2\right), \)

  2. 2.

    \( {W}_{e_4}(G)=\left\{\begin{array}{l}\frac{m^3}{2}{n}^2+\frac{m^2}{2}n\left({n}^2+4n-4\right)-mn\left(2n+1\right)\begin{array}{ccc}\hfill \hfill & \hfill \hfill & \hfill \hfill \end{array}\mathrm{if}\ m,n\ \mathrm{are}\ \mathrm{odd},\\ {}\frac{m^3}{2}{n}^2+\frac{m^2}{2}n\left({n}^2+4n-1\right)-\frac{m}{2}n\left(n+2\right)\begin{array}{ccc}\hfill \hfill & \hfill \hfill & \hfill \hfill \end{array}\mathrm{if}\ m,n\ \mathrm{are}\ \mathrm{even},\\ {}\frac{m^3}{2}{n}^2+\frac{m^2}{2}n\left({n}^2+4n-4\right)-\frac{m}{2}n\left(n+2\right)\begin{array}{ccc}\hfill \hfill & \hfill \hfill & \hfill \hfill \end{array}\mathrm{if}\ n\ \mathrm{is}\ \mathrm{odd},\ m\ \mathrm{is}\ \mathrm{even}.\end{array}\right. \)

14.3 Join

In this section, we find the first edge-Wiener index of the join of graphs. The results of this section have been reported in Alizadeh et al. (2014). We start this section by definition of the join of graphs.

The join \( {G}_1\nabla {G}_2 \) of the graphs G 1 and G 2 with disjoint vertex sets V(G 1) and V(G 2) is the graph with the vertex set \( V\left({G}_1\right)\cup V\left({G}_2\right) \) and the edge set \( E\left({G}_1\nabla {G}_2\right)=E\left({G}_1\right)\cup E\left({G}_2\right)\cup S \), where \( S=\left\{{u}_1{u}_2:{u}_1\in V\left({G}_1\right),{u}_2\in V\left({G}_2\right)\right\} \). Hence, the join of two graphs is obtained by connecting each vertex of one graph to each vertex of the other graph while keeping all edges of both graphs. The join of two graphs is sometimes also called a sum and is denoted by \( {G}_1+{G}_2 \). Its definition can be extended inductively to more than two graphs in a straightforward manner. It is a commutative operation and hence both its components will appear symmetrically in any formula including distance -based invariants. The number of vertices and edges in \( {G}_1\nabla {G}_2 \) are given by:

$$ \left|V\left({G}_1\nabla {G}_2\right)\right|={n}_1+{n}_2\kern0.5em \mathrm{and}\kern0.5em \left|E\left({G}_1\nabla {G}_2\right)\right|={e}_1+{e}_2+{n}_1{n}_2. $$

In the following theorem, the first edge-Wiener index of the join of G 1 and G 2 is computed.

Theorem 14.3.1

The first edge-Wiener index of \( {G}_1\nabla {G}_2 \) is given by:

$$ \begin{array}{ll}{W}_{e_0}\left({G}_1\nabla {G}_2\right)=& \left(\begin{array}{c}\hfill {e}_1+{e}_2+{n}_1{n}_2\hfill \\ {}\hfill 2\hfill \end{array}\right)-\left(2{n}_2-1\right){e}_1-\left(2{n}_1-1\right){e}_2\hfill \\ {}& -\frac{1}{2}{n}_1{n}_2\left({n}_1+{n}_2-2\right)-\frac{1}{2}\left({M}_1\left({G}_1\right)+{M}_1\left({G}_2\right)\right)\hfill \\ {}& +\frac{1}{4}\left({N}_3\left({G}_1\right)+{N}_3\left({G}_2\right)\right).\hfill \end{array} $$

Proof

Let Q be the set of all pairs of edges of \( {G}_1\nabla {G}_2 \). We partition Q into six disjoint sets as follows:

$$ {Q}_1=\left\{\left\{e,f\right\}:e,f\in E\left({G}_1\right)\right\}, $$
$$ {Q}_2=\left\{\left\{e,f\right\}:e,f\in E\left({G}_2\right)\right\}, $$
$$ {Q}_3=\left\{\left\{e,f\right\}:e\in E\left({G}_1\right),f\in E\left({G}_2\right)\right\}, $$
$$ {Q}_4=\left\{\left\{e,f\right\}:e\in E\left({G}_1\right),f\in S\right\}, $$
$$ {Q}_5=\left\{\left\{e,f\right\}:e\in E\left({G}_2\right),f\in S\right\}, $$
$$ {Q}_6=\left\{\left\{e,f\right\}:e,f\in S\right\}. $$

The first edge-Wiener index of \( {G}_1\nabla {G}_2 \) is obtained by summing the contributions of all pairs of edges over those six sets. We proceed to evaluate their contributions in order of decreasing complexity.

The case of Q 3 is the simplest. There are e 1 e 2 such pairs and each of them contributes 2 to the first edge-Wiener index. Hence, the total contribution of pairs from Q 3 is equal to 2e 1 e 2.

The set Q 6 contains pairs of edges from S. The total number of such pairs is equal to \( \left(\begin{array}{c}\hfill {n}_1{n}_2\hfill \\ {}\hfill 2\hfill \end{array}\right) \). Among them there are \( {n}_1\left(\begin{array}{c}\hfill {n}_2\hfill \\ {}\hfill 2\hfill \end{array}\right)+{n}_2\left(\begin{array}{c}\hfill {n}_1\hfill \\ {}\hfill 2\hfill \end{array}\right) \) pairs sharing a vertex. Such pairs contribute 1, and all other pairs contribute 2. Hence the total contribution of pairs from Q 6 is equal to \( \left(\begin{array}{c}{n}_1{n}_2\\ {}2\end{array}\right)-{n}_1\left(\begin{array}{c}{n}_2\\ {}2\end{array}\right)-{n}_2\left(\begin{array}{c}{n}_1\\ {}2\end{array}\right). \)

The total number of pairs from Q 4 is equal to e 1 n 1 n 2. All of them are either at distance 1 or at distance 2. The adjacent pairs share a vertex in G 1; hence there are 2e 1 n 2 such pairs, and their contribution is given by 2e 1 n 2. All other pairs from Q 4 contribute 2, and the total contribution of Q 4 is equal to \( 2{e}_1{n}_2\left({n}_1-1\right) \).

By symmetry , the total contribution of pairs from Q 5 is equal to \( 2{e}_2{n}_1\left({n}_2-1\right) \).

It remains to compute the contributions of Q 1 and Q 2. The total number of pairs in Q 1 is equal to \( \left(\begin{array}{c}\hfill {e}_1\hfill \\ {}\hfill 2\hfill \end{array}\right) \). Clearly, no pair of edges from Q 1 is at a distance greater than 3. Hence, we partition Q 1 into three sets Q 1 , Q 1 , and Q 1 , made of the pairs of edges at distance 1, 2, and 3, respectively. Then the total contribution of pairs from Q 1 to the first edge-Wiener index of \( {G}_1\nabla {G}_2 \) is given by \( \left|{Q}_1^{\prime}\right|+2\left|{Q}_1^{{\prime\prime}}\right|+3\left|{Q}_1^{{\prime\prime\prime}}\right| \). We have already mentioned that \( \left|{Q}_1^{{\prime\prime\prime}}\right|=\frac{1}{4}{N}_3\left({G}_1\right) \). Further,

$$ \left|{Q}_1^{\prime}\right|={\displaystyle \sum_{u\in V\left({G}_1\right)}\left(\begin{array}{c}\hfill { \deg}_{G_1}(u)\hfill \\ {}\hfill 2\hfill \end{array}\right)}=\frac{1}{2}{M}_1\left({G}_1\right)-{e}_1. $$

From here it immediately follows that the total contribution of Q 1 is given by:

$$ {e_1}^2-\frac{1}{2}{M}_1\left({G}_1\right)+\frac{1}{4}{N}_3\left({G}_1\right). $$

Again, the total contribution of Q 2 follows by the symmetry , and the formula from the theorem follows by adding the contributions of Q 1, …, Q 6 and simplifying the resulting expression.

As expected, G 1 and G 2 appear symmetrically in the formula of the first edge-Wiener index. It is interesting to note that the formula does not depend on the connectivity of G 1 and G 2. That allows us to compute the first edge-Wiener index of joins of graphs that are not themselves connected.

Now, we can obtain explicit formulae for the first edge-Wiener index of some classes of graphs by specializing components in joins . We start by computing the first edge-Wiener index of a suspension of a graph G.

For a given graph G, we call the graph \( {K}_1\nabla G \) the suspension of G, where K 1 denotes the single vertex graph.

Corollary 14.3.2

Let G be a graph with n vertices and e edges. Then

$$ {W}_{e_0}\left({K}_1\nabla G\right)=2\left(\begin{array}{c}\hfill n+e\hfill \\ {}\hfill 2\hfill \end{array}\right)-\left(\begin{array}{c}\hfill n\hfill \\ {}\hfill 2\hfill \end{array}\right)-\frac{1}{2}{M}_1(G)+\frac{1}{4}{N}_3(G)-e. $$

The star graph \( {S}_{n+1} \) on \( n+1 \) vertices is the suspension of the empty graph on n vertices which is commonly denoted by \( {\overline{K}}_n \). The fan graph \( {F}_{n+1} \) and wheel graph \( {W}_{n+1} \) on \( n+1 \) vertices are also suspensions of n-vertex path P n and n-vertex cycle C n , respectively (see Fig. 14.4).

Fig. 14.4
figure 4

Star, Fan and wheel graphs on \( n+1 \) vertices

The windmill graph D (m) n is the graph obtained by taking m copies of the complete graph K n with a vertex in common. The case \( n=3 \) therefore corresponds to the Dutch windmill graph (see Fig. 14.5). One can easily see that the windmill graph D (m) n is the suspension of m copies of \( {K}_{n-1} \).

Fig. 14.5
figure 5

Dutch windmill graph D (m)3

It can be verified by direct calculation that \( {N}_3\left({P}_n\right)={N}_3\left({C}_n\right)=0 \) for \( n<5 \), \( {N}_3\left({P}_n\right)=4\left(\begin{array}{c}\hfill n-3\hfill \\ {}\hfill 2\hfill \end{array}\right) \), \( {N}_3\left({C}_n\right)=2n\left(n-5\right) \) for \( n\ge 5 \), and \( {N}_3\left({K}_n\right)=0 \) for \( n\ge 3 \). Also, it is easy to see that, \( {M}_1\left({P}_n\right)=4n-6 \), \( {M}_1\left({C}_n\right)=4n \), and \( {M}_1\left({K}_n\right)=n{\left(n-1\right)}^2 \). So, by Corollary 14.3.2, the first edge-Wiener index of these graphs is obtained, at once.

Corollary 14.3.3

The first edge-Wiener index of the star, fan, wheel and windmill graphs is given by:

  1. 1.

    \( {W}_{e_0}\left({S}_{n+1}\right)=\left(\begin{array}{c}\hfill n\hfill \\ {}\hfill 2\hfill \end{array}\right), \)

  2. 2.

    \( {W}_{e_0}\left({F}_{n+1}\right)=\Big\{\begin{array}{l}3\kern8.22em if\ n=2,\\ {}\frac{1}{2}\left(7{n}^2-17n+12\right)\kern1em if\ n=3,4,\\ {}4\left({n}^2-3n+3\right)\kern2.6em if\ n\ge 5,\end{array}\operatorname{} \)

  3. 3.

    \( {W}_{e_0}\left({W}_{n+1}\right)=\Big\{\begin{array}{l}\frac{1}{2}\left(7{n}^2-9n\right)\kern3.5em if\ 3\le n\le 5,\\ {}4{n}^2-7n\begin{array}{cc}\kern2em & \kern1.53em if\ \end{array}n\ge 6,\end{array}\operatorname{} \)

  4. 4.

    \( {W}_{e_0}\left({D}_n^{(m)}\right)=\frac{1}{4}m{\left(n-1\right)}^2\left[m\left({n}^2-2\right)-2\left(n-1\right)\right]. \)

Now, consider the complete bipartite graph on \( {m}_1+{m}_2 \) vertices, \( {K}_{m_1,{m}_2} \). This graph can be represented as the join of the empty graphs \( {\overline{K}}_{m_1} \) and \( {\overline{K}}_{m_2} \). So, application of Theorem 14.3.1 yields:

Corollary 14.3.4

The first edge-Wiener index of the complete bipartite graph on \( {m}_1+{m}_2 \) vertices is given by:

$$ {W}_{e_0}\left({K}_{m_1,{m}_2}\right)=\frac{1}{2}{m}_1{m}_2\left(2{m}_1{m}_2-{m}_1-{m}_2\right). $$

14.4 Corona Product

In this section, we find the first edge-Wiener index of the corona product of graphs. The results of this section have been reported in Alizadeh et al. (2014). We start this section by definition of the corona product of graphs.

The corona product \( {G}_1\circ {G}_2 \) of the graphs G 1 and G 2 is the graph obtained by taking one copy of G 1 and \( \left|V\left({G}_1\right)\right|={n}_1 \) copies of G 2 and joining all vertices of the i-th copy of G 2 to the i-th vertex of G 1 for \( i=1,2,\dots, {n}_1 \). Obviously, \( \left|V\left({G}_1\circ {G}_2\right)\right|={n}_1\left({n}_2+1\right) \) and \( \left|E\left({G}_1\circ {G}_2\right)\right|={e}_1+{n}_1\left({n}_2+{e}_2\right) \). Unlike join and Cartesian product, corona is a noncommutative operation, and its component graphs appear in markedly asymmetric roles.

In the following theorem, the first edge-Wiener index of the corona product of G 1 and G 2 is computed.

Theorem 14.4.1

The first edge-Wiener index of \( {G}_1\circ {G}_2 \) is given by:

$$ \begin{array}{ll}{W}_{e_0}\left({G}_1\circ {G}_2\right)=& {W}_{e_0}\left({G}_1\right)+{\left({n}_2+{e}_2\right)}^2W\left({G}_1\right)+\left({n}_2+{e}_2\right){W}_{v{e}_1}\left({G}_1\right)\hfill \\ {}& -\frac{n_1}{2}{M}_1\left({G}_2\right)+\frac{n_1}{4}{N}_3\left({G}_2\right)+{e_2}^2\left[3\left(\begin{array}{c}\hfill {n}_1\hfill \\ {}\hfill 2\hfill \end{array}\right)+{n}_1\right]+{n}_1\left(\begin{array}{c}\hfill {n}_2\hfill \\ {}\hfill 2\hfill \end{array}\right)\hfill \\ {}& +{n_2}^2\left(\begin{array}{c}\hfill {n}_1\hfill \\ {}\hfill 2\hfill \end{array}\right)+{n}_1{e}_1\left({n}_2+2{e}_2\right)+2{n}_1{e}_2\left({n}_2-1\right)\hfill \\ {}& +2{n}_1{n}_2{e}_2\left({n}_1-1\right).\hfill \end{array} $$

Proof

We partition the edge set of \( {G}_1\circ {G}_2 \) into three sets. The first one is the edge set of G 1, \( {S}_1=E\left({G}_1\right) \), the second one contains all edges in all copies of G 2, and the third one contains all edges with one end in G 1 and the other end in some copies of G 2. We denote the copy of G 2 related to the vertex \( x\in V\left({G}_1\right) \) by G 2,x and the edge set of G 2,x by S 2,x . Now set \( {S}_2={\displaystyle \underset{x\in V\left({G}_1\right)}{\cup }{S}_{2,x}} \). Similarly, for a vertex \( x\in V\left({G}_1\right) \), we set \( {S}_{3,x}=\left\{e:e=ux,u\in V\left({G}_{2,x}\right)\right\} \) and then \( {S}_3={\displaystyle \underset{x\in V\left({G}_1\right)}{\cup }{S}_{3,x}} \).

Now, we start to compute the distances between the edges of these three sets. There are six cases:

Case 1

\( \left\{g,f\right\}\subseteq {S}_1 \).

It is obvious that, \( {d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)={d}_0\left(g,f\Big|{G}_1\right) \). So,

$$ {W}_1={\displaystyle \sum_{\left\{g,f\right\}\subseteq {S}_1}{d}_0(g,f|{G}_1\circ {G}_2)}={W}_{e_0}\left({G}_1\right). $$

Case 2

\( \left\{g,f\right\}\subseteq {S}_2 \), \( g\in {S}_{2,x} \) and \( f\in {S}_{2,y} \).

If \( x=y \) then \( {d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)= \) 1, 2 or 3. By the same reasoning as in the proof of Theorem 14.3.1, we obtain:

$$ {\displaystyle \sum_{\left\{g,f\right\}\subseteq {S}_{2,x}}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}=2\left(\begin{array}{c}\hfill {e}_2\hfill \\ {}\hfill 2\hfill \end{array}\right)-\frac{1}{2}\left({M}_1\left({G}_2\right)-{e}_2\right)={e_2}^2-\frac{1}{2}{M}_1\left({G}_2\right)+\frac{1}{4}{N}_3\left({G}_2\right). $$

If \( x\ne y \) then \( {d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)=3+d\left(x,y\Big|{G}_1\right) \). Now,

$$ \begin{array}{c}{W}_2={\displaystyle \sum_{\left\{g,f\right\}\subseteq {S}_2}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}\\ {}={\displaystyle \sum_{x\in V\left({G}_1\right)}{\displaystyle \sum_{\left\{g,f\right\}\subseteq {S}_{2,x}}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}}+{\displaystyle \sum_{\left\{x,y\right\}\subseteq V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_{2,x}}{\displaystyle \sum_{f\in {S}_{2,y}}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}}}\\ {}={n}_1\left[{e_2}^2-\frac{1}{2}{M}_1\left({G}_2\right)+\frac{1}{4}{N}_3\left({G}_2\right)\right]+{\displaystyle \sum_{\left\{x,y\right\}\subseteq V\left({G}_1\right)}\left(3+d\left(x,y\Big|{G}_1\right)\right)}{e_2}^2\\ {}={n}_1\left[{e_2}^2-\frac{1}{2}{M}_1\left({G}_2\right)+\frac{1}{4}{N}_3\left({G}_2\right)\right]+{e_2}^2\left[3\left(\begin{array}{c}\hfill {n}_1\hfill \\ {}\hfill 2\hfill \end{array}\right)+W\left({G}_1\right)\right]\end{array} $$

Case 3

\( \left\{g,f\right\}\subseteq {S}_3 \).

In this case, we have:

$$ \begin{array}{c}{W}_3={\displaystyle \sum_{\left\{g,f\right\}\subseteq {S}_3}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}\\ {}={\displaystyle \sum_{x\in V\left({G}_1\right)}{\displaystyle \sum_{\left\{g,f\right\}\subseteq {S}_{3,x}}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}}+{\displaystyle \sum_{\left\{x,y\right\}\subseteq V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_{3,x}}{\displaystyle \sum_{f\in {S}_{3,y}}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}}}\\ {}={\displaystyle \sum_{x\in V\left({G}_1\right)}{\displaystyle \sum_{\left\{g,f\right\}\subseteq {S}_{3,x}}1}}+{\displaystyle \sum_{\left\{x,y\right\}\subseteq V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_{3,x}}{\displaystyle \sum_{f\in {S}_{3,y}}\left(d\left(x,y\Big|{G}_1\right)+1\right)}}}\\ {}={\displaystyle \sum_{x\in V\left({G}_1\right)}\frac{1}{2}{n}_2\left({n}_2-1\right)}+{\displaystyle \sum_{\left\{x,y\right\}\subseteq V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_{3,x}}{n}_2\left(d\left(x,y\Big|{G}_1\right)+1\right)}}\\ {}=\frac{1}{2}{n}_1{n}_2\left({n}_2-1\right)+{n_2}^2W\left({G}_1\right)+\frac{1}{2}{n_2}^2{n}_1\left({n}_1-1\right)\end{array} $$

Case 4

\( g\in {S}_1 \), \( f\in {S}_2 \).

In this case, \( g\in {S}_1 \), \( f\in {S}_{2,x} \), \( {d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)=2+{D}_1\left(x,g\Big|{G}_1\right) \). Now,

$$ \begin{array}{l}{W}_4={\displaystyle \sum_{x\in V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_1}{\displaystyle \sum_{f\in {S}_{2,x}}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}}}={\displaystyle \sum_{x\in V\left({G}_1\right)}{\displaystyle \sum_{f\in {S}_{2,x}}{\displaystyle \sum_{g\in {S}_1}\Big(2+{D}_1\left(x,g\Big|{G}_1\right)}}}\Big)\hfill \\ {}\kern1.3em ={\displaystyle \sum_{x\in V\left({G}_1\right)}2{e}_1{e}_2}{\displaystyle +{e}_2{\displaystyle \sum_{x\in V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_1}{D}_1\left(x,g\Big|{G}_1\right)}}}={e}_2\left(2{n}_1{e}_1+{W}_{v{e}_1}\left({G}_1\right)\right).\hfill \end{array} $$

Case 5

\( g\in {S}_1 \), \( f\in {S}_3 \).

Similarly to the above case, \( g\in {S}_1 \), \( f\in {S}_{3,x} \), \( {d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)=1+{D}_1\left(x,g\Big|{G}_1\right) \). Now,

$$ \begin{array}{c}{W}_5={\displaystyle \sum_{x\in V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_1}{\displaystyle \sum_{f\in {S}_{3,x}}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}}}={\displaystyle \sum_{x\in V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_1}{\displaystyle \sum_{f\in {S}_{3,x}}\Big(1+{D}_1\left(x,g\Big|{G}_1\right)}}}\Big)\\ {}={\displaystyle \sum_{x\in V\left({G}_1\right)}{e}_1{n}_2+{n}_2{\displaystyle \sum_{x\in V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_1}{D}_1\left(x,g\Big|{G}_1\right)}}}={n}_2\left({n}_1{e}_1+{W}_{v{e}_1}\left({G}_1\right)\right).\end{array} $$

Case 6

\( g\in {S}_2 \), \( f\in {S}_3 \).

If \( g\in {S}_{2,x} \), \( f\in {S}_{3,x} \), then \( {d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)= \) 1 or 2. The edge g is adjacent to two edges of S 3,x and its distance to other edges is 2. So,

$$ {\displaystyle \sum_{x\in V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_{2,x}}{\displaystyle \sum_{f\in {S}_{3,x}}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}}}={\displaystyle \sum_{x\in V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_{2,x}}\Big(2+2\left({n}_2-2\right)}}\Big)=2\left({n}_2-1\right){e}_2{n}_1. $$

If \( g\in {S}_{2,x} \), \( f\in {S}_{3,y} \), \( x\ne y \) then \( {d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)=2+d\left(x,y\Big|{G}_1\right) \). Now,

$$ \begin{array}{c}{W}_6={\displaystyle \sum_{x,y\in V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_{2,x}}{\displaystyle \sum_{f\in {S}_{3,y}}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}}}\\ {}={\displaystyle \sum_{x\in V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_{2,x}}{\displaystyle \sum_{f\in {S}_{3,x}}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}}}+{\displaystyle \sum_{x\ne y\in V\left({G}_1\right)}{\displaystyle \sum_{g\in {S}_{2,x}}{\displaystyle \sum_{f\in {S}_{3,x}}{d}_0\left(g,f\Big|{G}_1\circ {G}_2\right)}}}\\ {}=\left(2{n}_2-2\right){n}_1{e}_2+{\displaystyle \sum_{x\ne y\in V\left({G}_1\right)}\left(2+d\left(x,y\Big|{G}_1\right)\right)}{n}_2{e}_2\\ {}=2\left({n}_2-1\right){n}_1{e}_2+\Big[2{n}_1\left({n}_1-1\right)+{\displaystyle \sum_{x\ne y\in V\left({G}_1\right)}d\left(x,y\Big|{G}_1\right)\Big]}{n}_2{e}_2\\ {}=2\left({n}_2-1\right){n}_1{e}_2+2\left[{n}_1\left({n}_1-1\right)+W\left({G}_1\right)\right]{n}_2{e}_2.\end{array} $$

Now, the formula for the first edge-Wiener index of \( {G}_1\circ {G}_2 \) follows by adding all six contributions and simplifying the resulting expression.

It is interesting to note that the formula of Theorem 14.4.1 does not include any invariants of G 2 that depend on its connectivity . It is, hence, possible to apply Theorem 14.4.1 to the cases of \( {G}_1\circ {G}_2 \) with disconnected G 2. Such cases arise in transitions from kenographs to plerographs , where G 2 is given as an empty graph, i.e., as \( {\overline{K}}_n \) for some positive integer n.

For a given graph G, its t-fold bristled graph Brs t (G) is obtained by attaching t vertices of degree one to each vertex of G. This graph can be represented as the corona product of G and the empty graph on t vertices \( {\overline{K}}_t \). The t-fold bristled graph of a given graph is also known as its t-thorny graph. The t-fold bristled graphs of P n and C n are shown in Fig. 14.6.

Fig. 14.6
figure 6

The t − fold bristled graphs of P n and C n

Using Theorem 14.4.1, the first edge-Wiener index of the t-fold bristled graph of a given graph G is obtained at once.

Corollary 14.4.2

Let G be a graph with n vertices and e edges. Then

$$ {W}_{e_0}\left(Br{s}_t(G)\right)={W}_{e_0}(G)+t{W}_{v{e}_1}(G)+{t}^2W(G)+n\left(\begin{array}{c}t\\ {}2\end{array}\right)+{t}^2\left(\begin{array}{c}n\\ {}2\end{array}\right)+net. $$

Using Corollary 14.4.2 and Table 14.1, the first edge-Wiener index of Brs t (P n ) and Brs t (C n ) can easily be computed.

Corollary 14.4.3

The first edge-Wiener index of the t-fold bristled graphs of P n and C n are given by:

  1. 1.

    \( {W}_{e_0}\left(Br{s}_t\left({P}_n\right)\right)=\frac{n}{6}\left[{n}^2{\left(t+1\right)}^2+3n\left({t}^2-1\right)-t\left(t+5\right)+2\right], \)

  2. 2.

    \( {W}_{e_0}\left(Br{s}_t\left({C}_n\right)\right)=\Big\{\begin{array}{l}\frac{n\left(t+1\right)}{8}\left[{n}^2+ nt\left(n+4\right)-\left(t+1\right)\right]\kern4em \mathrm{if}\kern0.30em n\kern0.30em \mathrm{is}\ \mathrm{odd},\\ {}\frac{n}{8}\left[{n}^2{\left(t+1\right)}^2+4 nt\left(t+1\right)-4t\right]\kern5.29em \mathrm{if}\kern0.30em n\kern0.30em \mathrm{is}\ \mathrm{even}.\end{array}\operatorname{} \)

Interesting classes of graphs can also be obtained by specializing the first component in the corona product . For example, for a graph G, the graph \( {K}_2\circ G \) is called its bottleneck graph. So, using Theorem 14.4.1, we easily arrive at:

Corollary 14.4.4

Let G be a graph with n vertices and e edges. Then

$$ {W}_{e_0}\left({K}_2\circ G\right)=6{e}^2+10ne+3{n}^2+n-{M}_1(G)+\frac{1}{2}{N}_3(G). $$

Remark 14.4.5

Note that for a given graph G, \( {K}_1\nabla G={K}_1\circ G \). So, the formulae of the first edge-Wiener index of the suspension of G and its t-fold bristled graph computed in Corollaries 14.3.2 and 14.3.3 can also be obtained from Theorem 14.4.1.

14.5 Composition

In this section, we find the second edge-Wiener index of the composition of graphs. The results of this section have been published in Azari et al. (2012). We start this section by definition of the composition of graphs.

The composition G 1[G 2] of graphs G 1 and G 2 with disjoint vertex sets and edge sets is a graph on vertex set \( V\left({G}_1\right)\times V\left({G}_2\right) \) in which \( u=\left({u}_1,{u}_2\right) \) is adjacent with \( v=\left({v}_1,{v}_2\right) \) whenever \( {u}_1{v}_1\in E\left({G}_1\right) \) or [\( {u}_1={v}_1\ \mathrm{a}\mathrm{n}\mathrm{d}\ {u}_2{v}_2\in E\left({G}_2\right) \)]. The composition is not commutative. The easiest way to visualize the composition G 1[G 2] is to expand each vertex of G 1 into a copy of G 2, with each edge of G 1 replaced by the set of all possible edges between the corresponding copies of G 2. Hence, we can define the edge set of G 1[G 2] as \( E\left({G}_1\left[{G}_2\right]\right)={E}_1\cup {E}_2 \), where E 1 and E 2 are the following disjoint sets:

$$ {E}_1=\left\{\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right):{u}_1\in V\left({G}_1\right),{u}_2{v}_2\in E\left({G}_2\right)\right\}, $$
$$ {E}_2=\left\{\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right):{u}_1{v}_1\in E\left({G}_1\right),{u}_2,{v}_2\in V\left({G}_2\right)\right\}. $$

The number of vertices and edges in G 1[G 2] are given by:

$$ \left|V\left({G}_1\left[{G}_2\right]\right)\right|={n}_1{n}_2\kern0.5em \mathrm{and}\kern0.5em \left|E\left({G}_1\left[{G}_2\right]\right)\right|={n}_1{e}_2+{e}_1{n_2}^2. $$

By definition of the composition, the distance between two distinct vertices \( u=\left({u}_1,{u}_2\right) \) and \( v=\left({v}_1,{v}_2\right) \) of G 1[G 2] is given by:

$$ d\left(u,v\Big|{G}_1\left[{G}_2\right]\operatorname{}\right)=\Big\{\begin{array}{l}d\left({u}_1,{v}_1\Big|{G}_1\operatorname{}\right)\kern1em if\kern0.5em {u}_1\ne {v}_1,\\ {}1\kern5.3em if\kern0.5em {u}_1={v}_1,{u}_2{v}_2\in E\left({G}_2\right),\\ {}2\kern5.3em if\kern0.5em {u}_1={v}_1,{v}_2\ \notin\ {N}_{G_2}\left({u}_2\right).\end{array}\operatorname{} $$

In Fig. 14.7, you can see the composition of a 3-vertex path P 3 and 2-vertex path P 2.

Fig. 14.7
figure 7

The composition of P 3 and P 2

Here and in the rest of this section, let \( G={G}_1\left[{G}_2\right] \). Suppose K is the set of all two element subsets of E(G). We partition the set K into the following disjoint sets:

$$ A=\left\{\left\{e,f\right\}\in K:e,f\in {E}_1\right\}, $$
$$ B=\left\{\left\{e,f\right\}\in K:e,f\in {E}_2\right\}, $$
$$ C=\left\{\left\{e,f\right\}\in K:e\in {E}_1,f\in {E}_2\right\}. $$

It is easy to see that \( \left|A\right|=\left(\begin{array}{c}\hfill {n}_1{e}_2\hfill \\ {}\hfill 2\hfill \end{array}\right) \), \( \left|B\right|=\left(\begin{array}{c}\hfill {n_2}^2{e}_1\hfill \\ {}\hfill 2\hfill \end{array}\right) \) and \( \left|C\right|={n}_1{n_2}^2{e}_1{e}_2 \). We start to find \( {W}_{e_4}(G) \), by introducing several subsets of the set A as follows:

$$ {A_1}^{*}=\left\{\left\{e,f\right\}\in A:e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),f=\left({u}_1,{u}_2\right)\left({u}_1,{z}_2\right),{u}_1\in V\left({G}_1\right),\kern-11.82em {u}_2\in V\left({G}_2\right),{v}_2{z}_2\in E\right({G}_2\left)\right\}, $$
$$ {A_2}^{*}=\left\{\left\{e,f\right\}\in A:e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),f=\left({u}_1,{u}_2\right)\left({u}_1,{z}_2\right),{u}_1\in V\left({G}_1\right),\kern-11.1em {u}_2,{v}_2,{z}_2\in V\left({G}_2\right),{z}_2\notin {N}_{G_2}\left({v}_2\right)\right\}, $$
$$ {A_3}^{*}=\left\{\left\{e,f\right\}\in A:e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),f=\left({u}_1,{z}_2\right)\left({u}_1,{t}_2\right),{u}_1\in V\left({G}_1\right),\kern-11.4em {u}_2{z}_2,{u}_2{t}_2,{v}_2{z}_2,{v}_2{t}_2\in E\left({G}_2\right)\right\}, $$
$$ {A_4}^{*}=\left\{\left\{e,f\right\}\in A:e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),f=\left({u}_1,{z}_2\right)\left({u}_1,{t}_2\right),{u}_1\in V\left({G}_1\right),\kern-6.5em {u}_2,{v}_2,{z}_2,{t}_2\in V\left({G}_2\right),{z}_2,{t}_2\notin \left\{{u}_2,{v}_2\right\}\right\}\backslash {A_3}^{*}, $$
$$ \kern1.2em {A_5}^{*}=\left\{\left\{e,f\right\}\in A:e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),f=\left({v}_1,{z}_2\right)\left({v}_1,{t}_2\right),{u}_1,{v}_1\in V\left({G}_1\right),\kern-11.1em {v}_1\ne {u}_1,{u}_2,{v}_2,{z}_2,{t}_2\in V\left({G}_2\right)\right\}. $$

Clearly, every pair of the above sets is disjoint and \( A={\displaystyle \underset{i=1}{\overset{5}{\cup }}{A_i}^{*}} \). In the following lemma, we characterize d 4(e, f|G) for all \( \left\{e,f\right\}\in A \).

Lemma 14.5.1

Let \( \left\{e,f\right\}\in A \).

  1. 1.

    If \( \left\{e,f\right\}\in {A_1}^{*}\cup {A}_3^{*} \), then \( {d}_4\left(e,f\left|G\right.\right)=1 \).

  2. 2.

    If \( \left\{e,f\right\}\in {A_2}^{*}\cup {A}_4^{*} \), then \( {d}_4\left(e,f\left|G\right.\right)=2 \).

  3. 3.

    If \( \left\{e,f\right\}\in {A_5}^{*} \), then \( {d}_4\left(e,f\left|G\right.\right)=d\left({u}_1,{v}_1\left|{G}_1\right.\right) \), where \( e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right) \) and \( f=\left({v}_1,{z}_2\right)\left({v}_1,{t}_2\right) \).

Proof

Let \( \left\{e,f\right\}\in {A}_1^{*}\cup {A}_2^{*} \) and \( e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right) \), \( f=\left({u}_1,{u}_2\right)\left({u}_1,{z}_2\right) \). Since \( e\ne f \), \( d\Big(\left({u}_1,{v}_2\right),\left({u}_1,{z}_2\right)\left|G\Big)\right.\ge 1 \). Hence,

$$ {d}_4\left(e,f\left|G\right.\right)= \max \left\{d\left(\left({u}_1,{u}_2\right),\left({u}_1,{u}_2\right)\left|G\right.\right),d\left(\left({u}_1,{u}_2\right),\left({u}_1,{z}_2\right)\left|G\right.\right),d\right(\left({u}_1,{v}_2\right),\left({u}_1,{u}_2\right)\left|G\Big),\right.d\left(\left({u}_1,{v}_2\right),\left({u}_1,{z}_2\right)\left|G\right.\right)\left\}= \max \right\{0,1,1,d\left(\left({u}_1,{v}_2\right),\left({u}_1,{z}_2\right)\left|G\left)\right\}=\right.d\right(\left({u}_1,{v}_2\right),\left({u}_1,{z}_2\right)\left|G\Big)\right.. $$

If \( \left\{e,f\right\}\in {A_1}^{*} \), then \( {v}_2{z}_2\in E\Big(G{}_2\Big) \). So, \( {d}_4\left(e,f\left|G\right.\right)=1 \) and if \( \left\{e,f\right\}\in {A_2}^{*} \), then z 2 is not adjacent to v 2 in G 2. So, \( {d}_4\left(e,f\left|G\right.\right)=2 \). Now, let \( \left\{e,f\right\}\in {A}_3^{*}\cup {A}_4^{*} \) and \( e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),f=\left({u}_1,{z}_2\right)\left({u}_1,{t}_2\right) \). Then

$$ {d}_4\left(e,f\left|G\right.\right)= \max \left\{d\left(\left({u}_1,{u}_2\right),\left({u}_1,{z}_2\right)\left|G\right.\right),d\left(\left({u}_1,{u}_2\right),\left({u}_1,{t}_2\right)\left|G\right.\right),d\left(\left({u}_1,{v}_2\right),\kern3.99em \left({u}_1,{z}_2\right)\left|G\right.\right),d\left(\left({u}_1,{v}_2\right),\left({u}_1,{t}_2\right)\left|G\right.\right)\right\},d\left(\left({u}_1,{v}_2\right),\left({u}_1,{t}_2\right)\left|G\right.\right)\Big\}. $$

If \( \left\{e,f\right\}\in {A_3}^{*} \), then \( {d}_4\left(e,f\left|G\right.\right)= \max \left\{1,1,1,1\right\}=1 \) and if \( \left\{e,f\right\}\in {A_4}^{*} \), then at least one of the d((u 1, u 2), (u 1, z 2)|G), d((u 1, u 2), (u 1, t 2)|G), d((u 1, v 2), (u 1, z 2)|G) and d((u 1, v 2), (u 1, t 2)|G) is equal to 2. Therefore, \( {d}_4\left(e,f\left|G\right.\right)=2 \). So, (1) and (2) hold.

In order to prove (3), let \( \left\{e,f\right\}\in {A_5}^{*} \) and \( e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),f=\left({v}_1,{z}_2\right)\left({v}_1,{t}_2\right) \). Then \( {v}_1\ne {u}_1 \) and

$$ {d}_4\left(e,f\left|G\right.\right)= \max \left\{d\left(\left({u}_1,{u}_2\right),\left({v}_1,{z}_2\right)\left|G\right.\right),d\left(\left({u}_1,{u}_2\right),\left({v}_1,{t}_2\right)\left|G\right.\right),d\right(\left({u}_1,{v}_2\right),\kern3.82em \left({v}_1,{z}_2\right)\left|G\Big),\right.d\left(\left({u}_1,{v}_2\right),\left({v}_1,{t}_2\right)\left|G\right.\right)\Big\}= \max \left\{d\left({u}_1,{v}_1\left|{G}_1\right.\right),\kern3.82em d\left({u}_1,{v}_1\left|{G}_1\right.\right),d\left({u}_1,{v}_1\left|{G}_1\right.\right),d\left({u}_1,{v}_1\left|{G}_1\right.\right)\right\}=d\left({u}_1,{v}_1\left|{G}_1\right.\right). $$

So, (3) holds.

Now, we define several subsets of the set B as follows:

$$ {B_1}^{*}=\left\{\left\{e,f\right\}\in B:e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right),f=\left({u}_1,{u}_2\right)\left({v}_1,{z}_2\right),{u}_1,{v}_1\in V\left({G}_1\right),\kern-15.88em {u}_2\in V\left({G}_2\right),{v}_2{z}_2\in E\left({G}_2\right)\right\}, $$
$$ {B_2}^{*}=\left\{\left\{e,f\right\}\in B:e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right),f=\left({u}_1,{u}_2\right)\left({v}_1,{z}_2\right),{u}_1,{v}_1\in V\left({G}_1\right),\kern-14.15em {u}_2,{v}_2,{z}_2\in V\left({G}_2\right),{z}_2\notin {N}_{G_2}\left({v}_2\right)\right\}, $$
$$ {B_3}^{*}=\left\{\left\{e,f\right\}\in B:e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right),f=\left({u}_1,{z}_2\right)\left({v}_1,{t}_2\right),{u}_1,{v}_1\in V\left({G}_1\right),\kern-18.95em {u}_2{z}_2,{v}_2{t}_2\in E\left({G}_2\right)\right\}, $$
$$ {B_4}^{*}=\left\{\left\{e,f\right\}\in B:e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right),f=\left({u}_1,{z}_2\right)\left({v}_1,{t}_2\right),{u}_1,{v}_1\in V\left({G}_1\right),\kern-9.4em {u}_2,{v}_2,{z}_2,{t}_2\in V\left({G}_2\right),{z}_2\ne {u}_2,{t}_2\ne {v}_2\right\}\backslash {B_3}^{*}, $$
$$ {B_5}^{*}=\left\{\left\{e,f\right\}\in B:e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right),f=\left({u}_1,{u}_2\right)\left({z}_1,{z}_2\right),{u}_1,{v}_1,{z}_1\in V\left({G}_1\right),\kern-15.75em {z}_1\ne {v}_1,{u}_2,{v}_2,{z}_2\in V\left({G}_2\right)\right\}, $$
$$ {B_6}^{*}=\left\{\left\{e,f\right\}\in B:e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right),f=\left({u}_1,{t}_2\right)\left({z}_1,{z}_2\right),{u}_1,{v}_1,{z}_1\in V\left({G}_1\right),\kern-11.25em {z}_1\ne {v}_1,{u}_2{t}_2\in E\left({G}_2\right),{v}_2,{z}_2\in V\left({G}_2\right)\right\}, $$
$$ {B_7}^{*}=\left\{\left\{e,f\right\}\in B:e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right),f=\left({u}_1,{t}_2\right)\left({z}_1,{z}_2\right),{u}_1,{v}_1,{z}_1\in V\left({G}_1\right),\kern-6.35em {z}_1\ne {v}_1,{u}_2,{v}_2,{t}_2,{z}_2\in V\left({G}_2\right),{t}_2\ne {u}_2,{t}_2\notin {N}_{G_2}\left({u}_2\right)\right\}, $$
$$ {B_8}^{*}=\left\{\left\{e,f\right\}\in B:e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right),f=\left({z}_1,{z}_2\right)\left({t}_1,{t}_2\right),{u}_1,{v}_1,{z}_1,{t}_1\in V\left({G}_1\right),\kern-11.9em {z}_1,{t}_1\notin \left\{{u}_1,{v}_1\right\},{u}_2,{v}_2,{z}_2,{t}_2\in V\left({G}_2\right)\right\}. $$

It is clear that, each pair of the above sets is disjoint and \( B={\displaystyle \underset{i=1}{\overset{8}{\cup }}{B_i}^{*}} \). In the next lemma, we characterize d 4(e, f|G) for all \( \left\{e,f\right\}\in B \).

Lemma 14.5.2

Let \( \left\{e,f\right\}\in B \).

  1. 1.

    If \( \left\{e,f\right\}\in {B_1}^{*}\cup {B}_3^{*} \), then \( {d}_4\left(e,f\left|G\right.\right)=1 \).

  2. 2.

    If \( \left\{e,f\right\}\in {B_2}^{*}\cup {B}_4^{*}\cup {B}_7^{*} \), then \( {d}_4\left(e,f\left|G\right.\right)=2 \).

  3. 3.

    If \( \left\{e,f\right\}\in {B_5}^{*} \), then \( {d}_4\left(e,f\left|G\right.\right)={d}_4\left({u}_1{v}_1,{u}_1{z}_1\left|{G}_1\right.\right) \), where \( e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right) \), \( f=\left({u}_1,{u}_2\right)\left({z}_1,{z}_2\right) \).

  4. 4.

    If \( \left\{e,f\right\}\in {B_6}^{*} \), then \( {d}_4\left(e,f\left|G\right.\right)={d}_4\left({u}_1{v}_1,{u}_1{z}_1\left|{G}_1\right.\right) \), where \( e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right) \), \( f=\left({u}_1,{t}_2\right)\left({z}_1,{z}_2\right) \).

  5. 5.

    If \( \left\{e,f\right\}\in {B_8}^{*} \), then \( {d}_4\left(e,f\left|G\right.\right)={d}_4\left({u}_1{v}_1,{z}_1{t}_1\left|{G}_1\right.\right) \), where \( e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right) \), \( f=\left({z}_1,{z}_2\right)\left({t}_1,{t}_2\right) \).

Proof

The proof is similar to the proof of Lemma 14.5.1.

Consider four subsets of the set C as follows:

$$ {C_1}^{*}=\left\{\left\{e,f\right\}\in C:e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),f=\left({u}_1,{u}_2\right)\left({z}_1,{z}_2\right),{u}_1,{z}_1\in V\left({G}_1\right),\kern-16.5em {u}_2,{v}_2,{z}_2\in V\left({G}_2\right)\right\}, $$
$$ {C_2}^{*}=\left\{\left\{e,f\right\}\in C:e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),f=\left({u}_1,{t}_2\right)\left({z}_1,{z}_2\right),{u}_1,{z}_1\in V\left({G}_1\right),\kern-11.5em {z}_2\in V\left({G}_2\right),{u}_2{t}_2,{v}_2{t}_2\in E\left({G}_2\right)\right\} $$
$$ {C_3}^{*}=\left\{\left\{e,f\right\}\in C:e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),f=\left({u}_1,{t}_2\right)\left({z}_1,{z}_2\right),{u}_1,{z}_1\in V\left({G}_1\right),\kern-6.8em {u}_2,{v}_2,{t}_2,{z}_2\in V\left({G}_2\right),{t}_2\ne {u}_2,{t}_2\ne {v}_2\right\}\backslash {C_2}^{*}, $$
$$ \kern1.1em {C_4}^{*}=\left\{\left\{e,f\right\}\in C:e=\left({u}_1,{u}_2\right)\left({u}_1,{t}_2\right),f=\left({v}_1,{v}_2\right)\left({z}_1,{z}_2\right),{u}_1,{v}_1,{z}_1\in V\left({G}_1\right),\kern-8.5em {v}_1\ne {u}_1,{z}_1\ne {u}_1,{u}_2,{t}_2,{v}_2,{z}_2\in V\left({G}_2\right)\right\}. $$

Clearly, each pair of the above sets is disjoint and \( C={\displaystyle \underset{i=1}{\overset{4}{\cup }}{C_i}^{*}} \). In the following lemma, we find d 4(e, f|G) for all \( \left\{e,f\right\}\in C \).

Lemma 14.5.3

Let \( \left\{e,f\right\}\in C \).

  1. 1.

    If \( \left\{e,f\right\}\in {C_1}^{*}\cup {C_2}^{\ast } \), then \( {d}_4\left(e,f\left|G\right.\right)=1 \).

  2. 2.

    If \( \left\{e,f\right\}\in {C_3}^{*} \), then \( {d}_4\left(e,f\left|G\right.\right)=2 \).

  3. 3.

    If \( \left\{e,f\right\}\in {C_4}^{*} \), then \( {d}_4\left(e,f\left|G\right.\right)={D}_2\Big({u}_1,{v}_1{z}_1\left|{G}_1\Big)\right. \), where \( e=\left({u}_1,{u}_2\right)\left({u}_1,{t}_2\right) \), \( f=\left({v}_1,{v}_2\right)\left({z}_1,{z}_2\right) \).

Proof

The proof is straightforward.

In order to clarify the definition of the sets A 1*, A 2*, …, A 5*, B 1*, B 2*, …, B 8*, C 1*, …, C 4*, we give an example.

Example 14.5.4

Let \( G={P}_3\left[{P}_2\right] \) be the graph of Fig. 14.7. Then

$$ {A_i}^{*}={B_j}^{*}={C_k}^{*}=\phi \kern0.5em \mathrm{and} $$
$$ {A_5}^{*}=A=\left\{\left\{{e}_1,{e}_2\right\},\left\{{e}_1,{e}_3\right\},\left\{{e}_2,{e}_3\right\}\right\}, $$
$$ {B_1}^{*}=\left\{\left\{{f}_1,{f}_5\right\},\left\{{f}_1,{f}_6\right\},\left\{{f}_2,{f}_7\right\},\left\{{f}_2,{f}_8\right\},\left\{{f}_3,{f}_5\right\},\left\{{f}_3,{f}_6\right\},\left\{{f}_4,{f}_7\right\},\left\{{f}_4,{f}_8\right\}\right\}, $$
$$ {B_3}^{*}=\left\{\left\{{f}_1,{f}_3\right\},\left\{{f}_2,{f}_4\right\},\left\{{f}_5,{f}_6\right\},\left\{{f}_7,{f}_8\right\}\right\}, $$
$$ {B_5}^{*}=\left\{\left\{{f}_1,{f}_2\right\},\left\{{f}_1,{f}_7\right\},\left\{{f}_2,{f}_6\right\},\left\{{f}_3,{f}_4\right\},\left\{{f}_3,{f}_8\right\},\left\{{f}_4,{f}_5\right\},\left\{{f}_5,{f}_8\right\},\left\{{f}_6,{f}_7\right\}\right\}, $$
$$ {B_6}^{*}=\left\{\left\{{f}_1,{f}_4\right\},\left\{{f}_1,{f}_8\right\},\left\{{f}_2,{f}_3\right\},\left\{{f}_2,{f}_5\right\},\left\{{f}_3,{f}_7\right\},\left\{{f}_4,{f}_6\right\},\left\{{f}_5,{f}_7\right\},\left\{{f}_6,{f}_8\right\}\right\}, $$
$$ {C_1}^{*}=\left\{\left\{{e}_1,{f}_1\right\},\left\{{e}_1,{f}_3\right\},\left\{{e}_1,{f}_5\right\},\left\{{e}_1,{f}_6\right\},\left\{{e}_2,{f}_1\right\},\left\{{e}_2,{f}_2\right\},\left\{{e}_2,{f}_3\right\},\left\{{e}_2,{f}_4\right\},\kern3.5em \left\{{e}_2,{f}_5\right\},\left\{{e}_2,{f}_6\right\},\left\{{e}_2,{f}_7\right\},\left\{{e}_2,{f}_8\right\},\left\{{e}_3,{f}_2\right\},\left\{{e}_3,{f}_4\right\},\left\{{e}_3,{f}_7\right\},\left\{{e}_3,{f}_8\right\}\right\}, $$
$$ {C_4}^{*}=\left\{\left\{{e}_1,{f}_2\right\},\left\{{e}_1,{f}_4\right\},\left\{{e}_1,{f}_7\right\},\left\{{e}_1,{f}_8\right\},\left\{{e}_3,{f}_1\right\},\left\{{e}_3,{f}_3\right\},\left\{{e}_3,{f}_5\right\},\left\{{e}_3,{f}_6\right\}\right\}. $$

Lemma 14.5.5

$$ {\displaystyle \sum_{\left\{e,f\right\}\in A}{d}_4\left(e,f\left|G\right.\right)}={n}_1\left(2\left(\begin{array}{c}\hfill {e}_2\hfill \\ {}\hfill 2\hfill \end{array}\right)-{N}_1\left({G}_2\right)-\frac{1}{4}{N}_2\left({G}_2\right)\right)+{e_2}^2W\left({G}_1\right). $$

Proof

One can easily see that \( \left|{A_1}^{*}\right|={n}_1{N}_1\left({G}_2\right) \), \( \left|{A_3}^{*}\right|=\frac{1}{4}{n}_1{N}_2\left({G}_2\right) \) and \( \left|{A_5}^{*}\right|=\left(\begin{array}{c}\hfill {n}_1\hfill \\ {}\hfill 2\hfill \end{array}\right){e_2}^2 \). Now, by Lemma 14.5.1, we obtain:

$$ {\displaystyle \sum_{\left\{e,f\right\}\in A}{d}_4\left(e,f\left|G\right.\right)}{\displaystyle =}{\displaystyle \sum_{i=1}^5{\displaystyle \sum_{\left\{e,f\right\}\in {A_i}^{*}}{d}_4\left(e,f\left|G\right.\right)}}=\left|{A_1}^{*}\right|+2\left|{A_2}^{*}\right|+\left|{A_3}^{*}\right|+2\left|{A_4}^{*}\right|\kern6.5em +{\displaystyle \sum \Big\{d\left({u}_1,{v}_1\left|{G}_1\right.\right)}:\left\{e,f\right\}\in {A_5}^{*},e=\left({u}_1,{u}_2\right)\left({u}_1,{v}_2\right),\kern9.6em f=\left({v}_1,{z}_2\right)\left({v}_1,{t}_2\right)\Big\}=2{\displaystyle \sum_{i=1}^5\left|{A_i}^{*}\right|}-\left|{A_1}^{*}\right|-\left|{A_3}^{*}\right|-2\left|{A_5}^{*}\right|\kern5.5em +{e_2}^2{\displaystyle \sum_{\left\{{u}_1,{v}_1\right\}\subseteq V\left({G}_1\right)}d\left({u}_1,{v}_1\left|{G}_1\right.\right)}=2\left|A\right|-\left|{A_1}^{*}\right|-\left|{A_3}^{*}\right|\kern8.5em -2\left|{A_5}^{*}\right|+{e_2}^2W\left({G}_1\right)=2\left(\underset{2}{\overset{n_1{e}_2}{}}\right)-{n}_1{N}_1\left({G}_2\right)-\frac{1}{4}{n}_1{N}_2\left({G}_2\right)\kern4.1em -2\left(\underset{2}{\overset{n_1}{}}\right){e_2}^2+{e_2}^2W\left({G}_1\right)={n}_1\left(2\left(\underset{2}{\overset{e_2}{}}\right)-{N}_1\left({G}_2\right)\kern-5.5em -\frac{1}{4}{N}_2\left({G}_2\right)\right)+{e_2}^2W\left({G}_1\right).\ \blacksquare $$

Lemma 14.5.6

Let H be a graph with the vertex set V(H) and edge set E(H) and let \( \left|E(H)\right|=e \). Then

$$ {\displaystyle \sum_{u\in V(H)}{\displaystyle \sum_{\left\{uv,uz\right\}\subseteq E(H)}{d}_4\left(uv,uz\left|H\right.\right)}}={M}_1(H)-{N}_1(H)-2e. $$

Proof

Consider the sets F 1 and F 2 as follows:

$$ {F}_1=\left\{\left\{uv,uz\right\}\subseteq E(H):u,v,z\in V(H),vz\in E(H)\right\}, $$
$$ {F}_2=\left\{\left\{uv,uz\right\}\subseteq E(H):u,v,z\in V(H),v\ne z,z\notin {N}_H(v)\right\}. $$

Clearly, \( {F}_1\cap {F}_2=\phi \), \( {F}_1\cup {F}_2=\left\{\left\{e,f\right\}\subseteq E(H):e,\ f\ \mathrm{share}\ \mathrm{a}\ \mathrm{vertex}\right\} \), \( \left|{F}_1\right|={N}_1(H) \) and \( \left|{F}_2\right|=\frac{1}{2}\left[{M}_1(H)-2e-2{N}_1(H)\right] \). Let \( \left\{uv,uz\right\}\in {F}_1\cup {F}_2 \). If \( \left\{uv,uz\right\}\in {F}_1 \), then \( vz\in E(H) \). So,

\( {d}_4\left(uv,uz\left|H\right.\right)= \max \left\{d\right(u,u\left|H\Big)\right.,d\left(u,z\left|H\right.\right),d\left(v,u\left|H\right.\right),d\left(v,z\left|H\right.\right)\Big\}= \max \left\{0,1,1,1\right\}=1 \).

Now, if \( \left\{uv,uz\right\}\in {F}_2 \), then \( v\ne z \) and z is not adjacent with v in H. So, \( d\left(v,z\left|H\right.\right)=2 \) and

$$ {d}_4\left(uv,uz\left|H\right.\right)= \max \left\{0,1,1,2\right\}=2. $$

Consequently,

$$ \begin{array}{ll}{\displaystyle \sum_{u\in V(H)}{\displaystyle \sum_{\left\{uv,uz\right\}\subseteq E(H)}{d}_4\left(uv,uz\left|H\right.\right)}}& ={\displaystyle \sum_{u\in V(H)}{\displaystyle \sum_{\left\{uv,uz\right\}\in {F}_1\cup {F}_2}{d}_4\left(uv,uz\left|H\right.\right)}}\hfill \\ {}& ={\displaystyle \sum_{u\in V(H)}{\displaystyle \sum_{\left\{uv,uz\right\}\in {F}_1}1}}+{\displaystyle \sum_{u\in V(H)}{\displaystyle \sum_{\left\{uv,uz\right\}\in {F}_2}2}}=\left(\left|{F}_1\right|+2\left|{F}_2\right|\right)\hfill \\ {}& ={M}_1(H)-{N}_1(H)-2e.\kern11.25em \blacksquare \hfill \end{array} $$

Lemma 14.5.7

$$ {\displaystyle \sum_{\left\{e,f\right\}\in B}{d}_4\left(e,f\left|G\right.\right)=}2{e}_1\left(\begin{array}{c}\hfill {n_2}^2\hfill \\ {}\hfill 2\hfill \end{array}\right)-2{e}_1{e}_2\left({n}_2+{e}_2\right)+{n_2}^4{W}_{e_4}\left({G}_1\right)+2{n_2}^2\left({n_2}^2-{n}_2-2{e}_2\right){N}_1\left({G}_1\right). $$

Proof

It is easy to see that \( \left|{B_1}^{*}\right|=2{e}_1{e}_2{n}_2 \), \( \left|{B_3}^{*}\right|=2{e}_1{e_2}^2, \) \( \left|{B_5}^{\ast}\right|=\frac{1}{2}{n_2}^3\left({M}_1\left({G}_1\right)-2{e}_1\right) \), \( \left|{B_6}^{\ast}\right|={n_2}^2{e}_2\left({M}_1\left({G}_1\right)-2{e}_1\right) \) and \( \left|{B_8}^{\ast}\right|=\frac{1}{2}{n_2}^4\left({e_1}^2+{e}_1-{M}_1\left({G}_1\right)\right) \). Now, we find \( {\displaystyle \sum_{\left\{e,f\right\}\in {B_5}^{*}\cup {B_6}^{*}\cup {B_8}^{*}}{d}_4\left(e,f\left|G\right.\right)} \).

By Lemma 14.5.2, we have:

$$ {\displaystyle \sum_{\left\{e,f\right\}\in {B}_5^{*}}{d}_4\left(e,f\left|G\right.\right)=}{\displaystyle \sum \Big\{{d}_4\left({u}_1{v}_1,{u}_1{z}_1\left|{G}_1\right.\right)}:\left\{e,f\right\}\in {B_5}^{*},e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right),\kern-1.5em f=\left({u}_1,{u}_2\right)\times \left({z}_1,{z}_2\right)\Big\}\kern1.5em ={n_2}^3{\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{\left\{{u}_1{v}_1,{u}_1{z}_1\right\}\subseteq E\left({G}_1\right)}{d}_4\Big(}{u}_1{v}_1,{u}_1{z}_1\left|{G}_1\right.\Big)}. $$

Similarly,

$$ {\displaystyle \sum_{\left\{e,f\right\}\in {B}_6^{*}}{d}_4\left(e,f\left|G\right.\right)=}{\displaystyle \sum \Big\{{d}_4\left({u}_1{v}_1,{u}_1{z}_1\left|{G}_1\right.\right)}:\left\{e,f\right\}\in {B_6}^{*},e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right),\kern-7.2em f=\left({u}_1,{t}_2\right)\left({z}_1,{z}_2\right)\Big\} $$
$$ =2{n_2}^2{e}_2{\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{\left\{{u}_1{v}_1,{u}_1{z}_1\right\}\subseteq E\left({G}_1\right)}{d}_4\Big({u}_1{v}_1},{u}_1{z}_1\left|{G}_1\right.\Big)}, $$

and

$$ {\displaystyle \sum_{\left\{e,f\right\}\in {B}_8^{*}}{d}_4\left(e,f\left|G\right.\right)=}{\displaystyle \sum \Big\{{d}_4\left({u}_1{v}_1,{z}_1{t}_1\left|{G}_1\right.\right)}:\left\{e,f\right\}\in {B_8}^{*},e=\left({u}_1,{u}_2\right)\left({v}_1,{v}_2\right),\kern-7.2em f=\left({z}_1,{z}_2\right)\left({t}_1,{t}_2\right)\Big\} $$
$$ =\frac{1}{2}{n_2}^4{\displaystyle \sum_{u_1{v}_1\in E\left({G}_1\right)}{\displaystyle \sum_{z_1{t}_1\in E\left({G}_1\right),{z}_1,{t}_1\notin \left\{{u}_1,{v}_1\right\}}{d}_4\Big({u}_1{v}_1},{z}_1{t}_1\left|{G}_1\right.\Big)}. $$

Consequently,

$$ {\displaystyle \sum_{\left\{e,f\right\}\in {B_5}^{*}\cup {B_6}^{*}\cup {B_8}^{*}}{d}_4\left(e,f\left|G\right.\right)}=2{n_2}^2{e}_2{\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{\left\{{u}_1{v}_1,{u}_1{z}_1\right\}\subseteq E\left({G}_1\right)}{d}_4\Big({u}_1{v}_1},{u}_1{z}_1\left|{G}_1\right.\Big)}\kern11.2em +\frac{1}{2}{n_2}^4{\displaystyle \sum_{u_1{v}_1\in E\left({G}_1\right)}}{\displaystyle \sum_{z_1{t}_1\in E\left({G}_1\right),{z}_1,{t}_1\notin \left\{{u}_1,{v}_1\right\}}{d}_4\left({u}_1{v}_1,{z}_1{t}_1\left|{G}_1\right.\right)}\kern4.2em =\left({n_2}^3+2{n_2}^2{e}_2\right){\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{\left\{{u}_1{v}_1,{u}_1{z}_1\right\}\subseteq E\left({G}_1\right)}\kern5.6em \times {d}_4\Big({u}_1{v}_1},{u}_1{z}_1\left|{G}_1\right.\Big)}+\frac{1}{2}{n_2}^4\left(2{W}_{e_4}\left({G}_1\right)\kern7.9em -2{\displaystyle \sum_{u_1\in V\left({G}_1\right)}}{\displaystyle \sum_{\left\{{u}_1{v}_1,{u}_1{z}_1\right\}\subseteq E\left({G}_1\right)}{d}_4\left({u}_1{v}_1,{u}_1{z}_1\left|{G}_1\right.\right)}\right)\kern3.3em ={n_2}^4{W_e}_{{}_4}\left({G}_1\right)+{n_2}^2\left({n}_2+2{e}_2-{n_2}^2\right)\kern7.2em \times {\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{\left\{{u}_1{v}_1,{u}_1{z}_1\right\}\subseteq E\left({G}_1\right)}{d}_4\Big(}{u}_1{v}_1,{z}_1{t}_1\left|{G}_1\right.\Big)}. $$

Now, using Lemma 14.5.6, we obtain:

$$ {\displaystyle \sum_{\left\{e,f\right\}\in {B_5}^{*}\cup {B_6}^{*}\cup {B_8}^{*}}{d}_4\left(e,f\left|G\right.\right)}={n_2}^4{W}_{e_4}\left({G}_1\right)+{n_2}^2\left({n}_2+2{e}_2-{n_2}^2\right)\kern8.8em \times \left({M}_1\left({G}_1\right)-2{N}_1\left({G}_1\right)-2{e}_1\right). $$

Therefore,

$$ {\displaystyle \sum_{\left\{e,f\right\}\in B}{d}_4\left(e,f\left|G\right.\right)}={\displaystyle \sum_{i=1}^4{\displaystyle \sum_{\left\{e,f\right\}\in {B_i}^{*}}{d}_4\left(e,f\left|G\right.\right)}}+{\displaystyle \sum_{\left\{e,f\right\}\in {B_7}^{*}}{d}_4\left(e,f\left|G\right.\right)}+{\displaystyle \sum_{\left\{e,f\right\}\in {B_5}^{\ast}\cup {B_6}^{\ast}\cup {B_8}^{\ast }}{d}_4\left(e,f\left|G\right.\right)}=\left|{B_1}^{*}\right|+2\left|{B_2}^{*}\right|+\left|{B_3}^{*}\right|+2\left|{B_4}^{*}\right|+2\left|{B_7}^{*}\right|+{\displaystyle \sum_{\left\{e,f\right\}\in {B_5}^{\ast}\cup {B_6}^{\ast}\cup {B_8}^{\ast }}{d}_4\left(e,f\left|G\right.\right)}=2\left|B\right|-\left|{B_1}^{*}\right|-\left|{B_3}^{*}\right|-2\left|{B_5}^{*}\right|-2\left|{B_6}^{*}\right|-2\left|{B_8}^{*}\right|+{\displaystyle \sum_{\left\{e,f\right\}\in {B_5}^{*}\cup {B_6}^{*}\cup {B_8}^{*}}{d}_4\Big(e,f\left|G\Big)\right.}=2{e}_1\left(\underset{2}{\overset{{n_2}^2}{}}\right)-2{e}_1{e}_2\left({n}_2+{e}_2\right)+{n_2}^4{W}_{e_4}\left({G}_1\right)+2{n_2}^2\left({n_2}^2-{n}_2-2{e}_2\right){N}_1\left({G}_1\right).\ \blacksquare $$

Lemma 14.5.8

$$ {\displaystyle \sum_{\left\{e,f\right\}\in C}{d}_4\left(e,f\left|G\right.\right)}=2{e}_1{e}_2{n}_2\left({n}_2-2\right)-2{e}_1{n}_2{N}_1\left({G}_2\right)+{n_2}^2{e}_2{W}_{v{e}_2}\left({G}_1\right). $$

Proof

One can easily see that, \( \left|{C_1}^{*}\right|=4{e}_1{e}_2{n}_2 \), \( \left|{C_2}^{*}\right|= \) 2e 1 n 2 N 1(G 2) and \( \left|{C_2}^{*}\cup {C_3}^{*}\right|=2{e}_1{e}_2{n}_2\left({n}_2-2\right) \). By Lemma 14.5.3, we obtain:

$$ \begin{array}{l}{\displaystyle \sum_{\left\{e,f\right\}\in {C}_4^{*}}{d}_4\left(e,f\left|G\right.\right)}={\displaystyle \sum \left\{{D}_2\right({u}_1,{v}_1{z}_1\left|{G}_1\Big)\right.}:\left\{e,f\right\}\in {C_4}^{*},e=\left({u}_1,{u}_2\right),\left({u}_1,{t}_2\right),\\ {}f=\left({v}_1,{v}_2\right),\left({z}_1,{z}_2\right)\Big\}\\ {}={n_2}^2{e}_2{\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{v_1{z}_1\in E\left({G}_1\right),{v}_1\ne {u}_1,{z}_1\ne {u}_1}}}{D}_2\left({u}_1,{v}_1{z}_1\left|{G}_1\right.\right)\\ {}={n_2}^2{e}_2{\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{v_1{z}_1\in E\left({G}_1\right)}{D}_2\left({u}_1,{v}_1{z}_1\left|{G}_1\right.\right)}}\\ {}-{n_2}^2{e}_2{\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{u_1{v}_1\in E\left({G}_1\right)}{D}_2\left({u}_1,{u}_1{v}_1\left|{G}_1\right.\right)}}\\ {}={n_2}^2{e}_2\left({W}_{v{e}_2}\left({G}_1\right)-{\displaystyle \sum_{u_1\in V\left({G}_1\right)}{\displaystyle \sum_{u_1{v}_1\in E\left({G}_1\right)}1}}\right)\\ {}={n_2}^2{e}_2\left({W}_{v{e}_2}\left({G}_1\right)-{\displaystyle \sum_{u_1\in V\left({G}_1\right)}{ \deg}_{G_1}(u)}\right)\\ {}={n_2}^2{e}_2\left({W}_{v{e}_2}\left({G}_1\right)-2{e}_1\right).\end{array} $$

Hence,

$$ {\displaystyle \sum_{\left\{e,f\right\}\in C}{d}_4\left(e,f\left|G\right.\right)}={\displaystyle \sum_{i=1}^4{\displaystyle \sum_{\left\{e,f\right\}\in {C_i}^{*}}{d}_4\left(e,f\left|G\right.\right)}=}\left|{C_1}^{*}\right|+\left|{C_2}^{*}\right|+2\left|{C_3}^{*}\right|\kern10.05em +{\displaystyle \sum_{\left\{e,f\right\}\in {C_4}^{*}}{d}_4\left(e,f\left|G\right.\right)}=\left|{C_1}^{*}\right|+2\left|{C_2}^{*}\cup {C_3}^{*}\right|-\left|{C_2}^{*}\right|\kern4.82em +{\displaystyle \sum_{\left\{e,f\right\}\in {C_4}^{\ast }}{d}_4\left(e,f\left|G\right.\right)}=2{e}_1{e}_2{n}_2\left({n}_2-2\right)\kern2.25em -2{e}_1{n}_2{N}_1\left({G}_2\right)+{n_2}^2{e}_2{W}_{v{e}_2}\left({G}_1\right). $$

Now, we express the main theorem of this section.

Theorem 14.5.9

The second edge-Wiener index of G 1[G 2] is given by:

$$ \begin{array}{ll}{W}_{e_4}\left({G}_1\left[{G}_2\right]\right)=& 2{n}_1\left(\underset{2}{\overset{e_2}{}}\right)+2{e}_1\left(\underset{2}{\overset{{n_2}^2}{}}\right)+2{e}_1{e}_2\left({n_2}^2-3{n}_2-{e}_2\right)\hfill \\ {}& \kern6.5em +{e_2}^2W\left({G}_1\right)+{n_2}^4{W}_{e_4}\left({G}_1\right)+{n_2}^2{e}_2{W}_{v{e}_2}\left({G}_1\right)+2{n_2}^2\left({n_2}^2-{n}_2-2{e}_2\right){N}_1\left({G}_1\right)-\left({n}_1+2{e}_1{n}_2\right)\hfill \\ {}& \kern10.6em \times {N}_1\left({G}_2\right)-\frac{1}{4}{n}_1{N}_2\left({G}_2\right).\hfill \end{array} $$

Proof

Since {A, B, C} is a partition of the set K, so by definition of \( {W}_{e_4}(G) \), we have:

$$ {W}_{e_4}(G)={\displaystyle \sum_{\left\{e,f\right\}\in K}{d}_4\left(e,f\left|G\right.\right)}={\displaystyle \sum_{\left\{e,f\right\}\in A}{d}_4\left(e,f\left|G\right.\right)}+{\displaystyle \sum_{\left\{e,f\right\}\in B}{d}_4\left(e,f\left|G\right.\right)}+{\displaystyle \sum_{\left\{e,f\right\}\in C}{d}_4\left(e,f\left|G\right.\right)}. $$

Now, using Lemmas 14.5.5, 14.5.7 and 14.5.8, the proof is obvious.

Now, we can use Theorem 14.5.9 to obtain explicit formulae for the second edge-Wiener index of some classes of graphs by specializing components in compositions . Because P n and C m , \( m\ge 4 \) are triangle–free graphs, so by definition of the quantity N 1, \( {N}_1\left({P}_n\right)={N}_1\left({C}_m\right)=0 \) and \( {N}_1\left({C}_3\right)=3 \). Also, by definition of the quantity N 2, it is easy to see that for \( n\ge 2 \) and \( m\ge 3 \), \( {N}_2\left({P}_n\right)={N}_2\left({C}_m\right)=0 \). Now, using Theorem 14.5.9 and Table 14.1, we can easily get the formulae for the second edge-Wiener index of fence graph P n [P 2] and closed fence graph C n [P 2]; see Fig. 14.8.

Fig. 14.8
figure 8

Fence and closed − fence graphs on 2n vertices

Corollary 14.5.10

The second edge-Wiener index of the fence graph and closed fence graph are given by:

  1. 1.

    \( {W}_{e_4}\left({P}_n\left[{P}_2\right]\right)=\frac{25}{6}{n}^3-\frac{85}{6}n+10, \)

  2. 2.

    \( {W}_{e_4}({C}_n[{P}_2])=\{\begin{array}{l}\frac{25}{8}{n}^3+10{n}^2-\frac{185}{8}n,\kern1em if\ n\ is\ odd,\\ {}\frac{25}{8}{n}^3+10{n}^2-10n,\kern1.55em if\ n\ is\ even.\end{array}\operatorname{} \)

Our next example is about the composition of arbitrary paths and cycles. Application of Theorem 14.5.9 and Table 14.1 yields:

Corollary 14.5.11

For \( n\ge 2 \) and \( m\ge 3 \),

  1. 1.

    \( {W}_{e_4}\left({P}_n\left[{C}_m\right]\right)=\left\{\begin{array}{l}24{n}^3-66n+45\kern15.35em \mathrm{if}\ m=3\\ {}\frac{m^4}{6}\ n\left({n}^2-1\right)+\frac{m^3}{3}\ \left({n}^3+5n-6\right)+\frac{m^2}{6}\ \left({n}^3-49n+54\right)-\mathit{\mathrm{mn}\ \mathrm{if}\ \mathrm{m}}\ge 4\end{array}\right., \)

  2. 2.

    \( {W}_{e_4}\left({C}_m\left[{P}_n\right]\right)=\left\{\begin{array}{l}15{n}^4-3{n}^3-24{n}^2+15n+3,\kern8.35em \mathrm{if}\ m=3\\ {}\frac{m^3}{8}\left({n}^4+2{n}^3-{n}^2-2n+1\right)+\frac{m^2}{2}{n}^2\left({n}^2+n-1\right)\kern1em \mathrm{if}\ m\ \mathrm{is}\ \mathrm{odd}, m\ne 3\\ {}-\frac{m}{8}\left(5{n}^4-10{n}^3+75{n}^2-58n+1\right),\\ {}\frac{m^3}{8}\left({n}^4+2{n}^3-{n}^2-2n+1\right)+\frac{m^2}{2}{n}^2\left({n}^2+n-1\right)\kern1em \mathrm{if}\ m\ \mathrm{is}\ \mathrm{even} \\ {}+mn\left(2{n}^2-10n+7\right)\end{array}\right.. \)