Certain Distance-Based Topological Indices of Parikh Word Representable Graphs

Department of Basic Sciences, Amal Jyothi College of Engineering, Kanjirappally, Kerala 686518, India Research Scholar, APJ Abdul Kalam Technological University, )iruvananthapuram, Kerala 695016, India Department of Mathematics, School of Arts, Science and Humanities, SASTRA Deemed University, Tanjore, Tamil Nadu 613 401, India School of Mathematics, Computer Science and Engineering Liverpool Hope University, Liverpool L169JD, UK


Introduction
Among various studies that involve graphs for analyzing and solving different kinds of problems, relating words that are finite sequences of symbols with graphs is an interesting area of investigation (for example, [1][2][3][4][5]). Based on the notion of subwords (also called scattered subwords) of a word and the concept of a matrix called Parikh matrix of a word, introduced in [6] and intensively investigated by many researchers (for example, [7][8][9][10][11][12][13] and references therein) with entries of the Parikh matrix giving the counts of certain subwords in a word, a graph called Parikh word representable graph (PWRG) of a word, was introduced in [14] and its relationship with the corresponding word and partition was studied in [15].
On the other hand, there has been a great interest in various topological indices associated with graphs (for example, [16][17][18][19]) due to their application in the area of chemical graph theory [20], which deals with representations of organic compounds or equivalently their molecular structures as graphs, with atoms other than hydrogen often represented by vertices and covalent chemical bonds by edges. In fact, in chemical graph theory, there have been attempts to capture the molecular structure in terms of the topological index of the corresponding graph.
ere are a number of studies (for example, [21]) of various topological indices of graphs establishing formulae for computing the indices and also providing upper and lower bounds on the values of such indices. Recently, in [22], properties of one of the important topological indices, namely, Wiener index and some of its variants related to PWRGs of binary words, were studied. In this study, certain distance-based topological indices of PWRGs of binary core words are investigated.

Preliminaries
e basic definitions and notations relating to words are as given in [23,24]. We recall here some of the needed notions.
An ordered alphabet Σ is a set of symbols with an ordering on its symbols. For example, Σ � a 1 , a 2 , . . . , a k with an ordering a 1 < a 2 < · · · < a k is an ordered alphabet, written as Σ � a 1 < a 2 < · · · < a k . A word w over Σ is a finite sequence of symbols belonging to Σ. A word w ′ is a scattered subword or simply called a subword of a word w over Σ if and only if there exist u 1 , u 2 , . . . , u n , u i ∈ Σ for 1 ≤ i ≤ n and words (possibly empty) v 0 , v 1 , . . . , v n over Σ, such that w ′ � u 1 u 2 , . . . , u n , and w � v 0 u 1 v 1 u 2 v 2 , . . . , v n− 1 u n v n . e number of occurrences of a word u as a subword of w is denoted by |w| u . For example, in the word w � aababb over the ordered binary alphabet a < b { }, the number of a's is |w| a � 3, the number of b's is |w| b � 3, and the number of subwords ab's is |w| ab � 8. In fact, the word ab as a subword of aababb is shown with the symbols a and b of ab shown in bold in aababb.
(1) e set of all words over an alphabet Σ, including the empty word λ with no symbols, is denoted by Σ * . Unless stated otherwise, we consider only a binary alphabet Definition 1. [13] Let w ∈ Σ * . e core of w, denoted by core(w), is the unique word w 0 of w with the smallest possible length, such that w ∈ b * w 0 a * . A word w ∈ Σ * is called a core word if and only if core(w) � w. Clearly, a nonempty binary word w ∈ Σ * is a core word if and only if w starts with a and ends with b.
In [14], a simple graph, called Parikh word representable graph (PWRG), was defined corresponding to a word over an ordered alphabet. Restricting our attention to binary words, we recall now this PWRG. Definition 2. [14] For a binary word w of length n over Σ � a < b { }, we define a simple graph G � G(w), called Parikh word representable graph (PWRG), with n labeled vertices 1, 2, . . . , n representing the positions of the consecutive letters of w, such that for each occurrence of the subword ab in w, there is an edge between the vertices in G, corresponding to the positions of a and b in w. We say that the binary word w represents the graph G � G(w) and a graph G is Parikh word representable if there exists a binary word w that represents G.
It is to be noted that PWRG G(w) of a binary word w over a < b { } is a bipartite graph [14] with as many vertices as the length |w| of w and as many edges as the number of occurrences of the subword ab in w. Figure 1 shows the PWRG of a binary word aababab over the ordered binary alphabet Σ � a < b { }. e graph G(aababab) has 7 vertices and 9 edges. Note that the length of the word aababab is 7, and there are 9 occurrences of the subword ab in aababab.
In this study, we deal with only binary core words and the corresponding PWRGs. Also, we note that for a nonempty binary core word of the form w � a n 1 ba n 2 b, . . . , a n |w| b b, where n 1 ≥ 1 and n k is nonnegative for each k, 2 ≤ k ≤ |w| b , the number of edges in the corresponding PWRG G(w) is |w| ab � n 1 + n 2 + · · · + n |w| b + · · · + n 1 + n 2 + n 1 . (2) Note that in the word w, n k , 1 ≤ k ≤ |w| b , which is a power of a, indicates that there are n k vertices labeled a in the graph G(w) with each of these joined to all the vertices that correspond to the subsequent b's in the word w.

Distance-Based Topological Indices
We consider only simple graphs, and for notions related to graphs, we refer to [25]. Let G � (V, E) be a connected graph with vertex set V(G) � V and edge set E(G) � E. e distance between the vertices u and v of G, denoted by d (u, v), is defined as the length of a shortest path between u and v in G.
e degree of a vertex u of G, which is the number of edges incident at u, is denoted by deg(u). For a given vertex u in a connected graph G, the eccentricity ϵ(u) is defined as the maximum distance between u and any other vertex in G. Definition 3. [26] e Harary index of a connected graph G is defined as the sum of the reciprocals of distances between all pairs of vertices of G, i.e., e Harary index [26] of a connected graph is a topological index which has been extensively investigated (for example, [27][28][29]).

Theorem 1.
e Harary index of the PWRG G(w), for w � a n 1 ba n 2 b, . . . , a n l b, n 1 ≥ 1, n k ≥ 0 for 2 ≤ k ≤ l, is given by Proof. We consider pairs of vertices (u, v) in the PWRG G(w) corresponding to the word w � a n 1 ba n 2 b . . . a n l b, with u, v ∈ 1, 2, . . . , n { }, where the label of u appears before the label of v in w. ere are now four cases to be considered. We will refer to a pair (u, v) of such vertices with ey are given as a pair of type 1, 2, 3, and 4, respectively. ere are (n 1 + n 2 + · · · + n l )C 2 � |w| a C 2 � (1/2)|w| a (|w| a − 1) pairs of vertices of type 1 and lC 2 � |w| b C 2 � (1/2)|w| b (|w| b − 1) of type 4, and the distance between each such pair is 2. Here, nC r is the binomial representing the number of ways of choosing r objects from n objects). ere are ln 1 + (l − 1)n 2 + · · · + n l � |w| ab pairs of vertices of type 2 with distance 1 and n 2 + 2n 3 + · · · + (l − 1)n l � |w| a |w| b − |w| ab pairs of vertices of type 3 with distance 3, since |w| ab � (n 1 + n 2 + · · · + n |w| b ) + · · · + (n 1 + n 2 ) + n 1 . Hence, which yields the required result.
and above by e bounds are attained on G(ab q− 1 a p− 1 b) and G(a p b q ), respectively. [25]. Also, |w| ab ≤ pq [6]. Hence, from eorem 1, the Harary index of G(w) is which is the Harary index of the PWRG G(a p b q ) and which is the Harary index of the PWRG e total eccentricity index [31] of the graph G is e topological index, namely, eccentric connectivity index, was introduced in [30] and has been widely investigated for different classes of graphs (for example, [32][33][34][35] and references therein).

Theorem 3.
e eccentric connectivity index of the PWRG G(w), for w � a n 1 ba n 2 b, . . . , a n l b, n 1 ≥ 1, is given by if n 1 � 1, n i � 0, for 1 < i ≤ l and l > 1, 3|w| a , if n 1 > 1 and l � 1, where k be the number of b's succeeding the last a in w.
Proof. Let G(w) be the PWRG corresponding to w � a n 1 ba n 2 b, . . . , a (11) Now, if n 1 � 1 and n i � 0 for 1 < i ≤ l, then w � ab l , and a is of eccentricity one and degree l and each b is of eccentricity two and degree one. erefore, ζ c (G(w)) � 3|w| b , if n 1 � 1 and n i � 0, 1 < i ≤ l. (12) Similarly, if n 1 > 1 and l � 1, w � a n 1 b and b is of eccentricity one and degree n 1 , while each a is of eccentricity two and degree one. us, ζ c (G(w)) � 3|w| a . Again, if n 1 � 1 Journal of Mathematics and l � 1, then w � ab, and both vertices have eccentricity one and degree one and so ζ c (G(w)) � 2. Hence the result. □ Remark 1. It can be seen that the total eccentricity index of the PWRG G(w), for w � a n 1 ba n 2 b, . . . , a n l b, n 1 ≥ 1, is given by if n 1 � 1, n i � 0, for 1 < i ≤ l and l > 1, where k is the number of b's succeeding the last a in w.

Theorem 4. e eccentric connectivity index ζ c (G(w)) of a PWRG G(w)
for the word w � a n 1 ba n 2 b, . . . , a n q b, n 1 ≥ 1, n i ≥ 0 for 2 ≤ i ≤ l, is bounded above by ζ max c and below by ζ min e upper bound is attained on Proof. Since |w| a � p > 1, |w| b � q > 1, using eorem 3, the eccentric connectivity index ζ c (G(w)) � 6|w| ab − k|w| a − n 1 |w| b will be a maximum if |w| ab is as large as possible, while n 1 and k are as small as possible. Here, k is the number of b's succeeding the last a in w. It is known [10] that for a binary word w, |w| ab ≤ pq when |w| a � pand |w| b � q. e word a p b q has the maximum number pq of subwords ab, and so the eccentric connectivity index of the PWRG corresponding to this word is maximum but only when p + q ≤ 6. We note that p > 1 and q > 1, and the word w is a core word by the hypothesis. When p + q > 6, it can be verified that this word fails to provide the maximum eccentric connectivity index for the corresponding PWRG due to the fact that all the vertices in the PWRG of a p b q have only eccentricity 2. When |w| ab � pq − 1, which is the largest number nearer to the maximum pq, the word a p− 1 bab q− 1 has pq − 1 subwords ab, while the vertices in the PWRG corresponding to the first b and the next a in this word have eccentricity 3 and degrees p − 1 and q − 1, respectively. e eccentric connectivity index of the PWRG corresponding to this word a p− 1 bab q− 1 is maximum when p + q ≥ 6 but only when 2pq − 8p − 8q + 24 ≤ 0. When p + q > 6 and 2pq − 8p − 8q + 24 > 0, it can be verified that the word a p− 1 bab q− 1 fails to provide the maximum eccentric connectivity index for the corresponding PWRG. On the other hand, the word aba p− 2 b q− 2 ab has the minimum value 1 for n 1 and k and has as many a's as possible to the left and as many b's as possible to the right of the word, thus providing maximum degrees for the vertices in the PWRG corresponding to the a's and b's in a p− 2 b q− 2 which have eccentricity 3. In fact, more formally, for w � a n 1 ba n 2 b, . . . , a n q b, n 1 ≥ 1, q > 1, n 1 + n 2 + · · · n q � p > 1, we can show that In order to maximize this expression with the constraint n 1 + n 2 + · · · + n q− 1 + n q � p > 1, we have to minimize the negative terms, and so we have to take n 1 � n q � 1 and n 2 � p − 2, while n i � 0, for 3 ≤ i ≤ q − 1. Note that we cannot choose n 2 � 0 as there are p > 1 number of a's. Hence, it may be observed that for given values of p and q, the maximum value of ζ c (G(w)) is attained on one of the three words w 1 � a p b q , w 2 � a p− 1 bab q− 1 , or w 3 � aba p− 2 b q− 2 ab whose corresponding PWRGs G(w 1 ), G(w 2 ), G(w 3 ) have their eccentric connectivity indices as η 1 � 4pq, η 2 � 4pq + p + q − 6, η 3 � 6pq − 7p − 7q + 18, respectively. Note that η 1 ≥ η 2 when p + q ≤ 6, while the expression 2pq − 8p − 8q + 24 is the difference η 3 − η 2 . Hence, the maximum value is attained on G(a p b q ) when p + q ≤ 6, on G(a p− 1 bab q− 1 ) when p + q ≥ 6, 2pq − 8p − 8q + 24 ≤ 0, and on G(aba p− 2 b q− 2 ab), when p + q > 6 and 2pq − 8p − 8q + 24 > 0.
On the other hand, for p > 1, q > 1, ζ c (G(w)) is minimum when |w| ab is minimum, and this happens for w � a n 1 b q− k a p− n 1 b k with |w| ab � n 1 q + pk − n 1 k minimum when n 1 � k � 1. Hence, the minimum value 5p + 5q − 6 of ζ c (G(w)) is attained on G(ab q− 1 a p− 1 b).
Proof. If k is the number of b's following the last a in w, it is clear that the maximum value of ζ(G(w)) is attained when n 1 � 1, k � 1 and the minimum is attained when n 1 � p, k � q. Hence the result.
Yet another topological index, called eccentricity connectivity coindex [36,37] of a connected graph, is defined as the eccentricity sum of all nonadjacent vertex pairs in the graph. We consider this index here for PWRGs. □ Definition 5. [36,37] e eccentric connectivity coindex ζ c (G) of a connected graph G with edge set E(G) is defined as where ϵ(x) is the eccentricity of the vertex x of G.
Theorem 6. e eccentric connectivity coindex ζ c (G(w)) of the PWRG G(w), for w � a n 1 ba n 2 b, . . . , a n l b, n 1 ≥ 1, n k ≥ 0 for 2 ≤ k ≤ l is given by where k is the number of b's succeeding the last a in w.
Proof. It has been shown [36,37] where n is the number of vertices in the graph G and ϵ(u) is the eccentricity of the vertex u. If |w| a > 1 and l > 1, then the vertices corresponding to the first block a's and k b's succeeding the last a are of eccentricity two, and the remaining vertices are of eccentricity three. erefore, Now, if n 1 � 1, n i � 0 for 1 < i ≤ l and l > 1, then the vertex corresponding to a is of eccentricity one and the remaining vertices are of eccentricity two. erefore, ζ c (G(w)) � 2|w| b (|w| b − 1). Now, if n 1 > 1 and l � 1, then the vertex corresponding to b is of eccentricity one and the remaining vertices are of eccentricity two. en, ζ c (G(w)) � 2|w| a (|w| a − 1).

An Illustration
Bipartite graphs have been used in investigating structural features in the areas of molecular biology and chemistry (for example, [38,39]). We consider here a complete bipartite graph K m,n , m, n > 1, with the bipartition V 1 ∪ V 2 of the vertices such that V 1 � u 1 , . . . , u m and V 2 � v 1 , . . . , n n . e graph K m,n is a PWRG G(w) corresponding to the word w � a m b n over the alphabet a < b { }. First, we observe the following facts relating to K m,n . We now illustrate the computation of the topological indices considered in the earlier sections, both directly from the definition and from the formulae in eorems 1, 3, and Remark 1.
e Harary index of K m,n , by direct computation from the definition, is e same value is obtained from the formula for the Harary index, namely, H(G (w)) � (1/12)(3 |w| a (|w| a − 1) e eccentric connectivity index of K m,n , by direct computation from the definition, is e same value is obtained from the formula for the eccentric connectivity index, namely, ζ c (G(w)) � 6|w| ab − k|w| a − n 1 |w| b where k is the number of b's succeeding the Journal of Mathematics 5 last a and n 1 is the number of a's prior to the first b in G(w), so that k � n, n 1 � m. e total eccentricity index of K m,n , by direct computation from the definition, is ζ K m,n � m × 2 + n × 2 � 2m + 2n. (21) e same value is obtained from the formula for the total eccentricity index, namely, ζ(G(w)) � 3|w| − k − n 1 , where |w| � |w| a + |w| b � m + n.

Conclusion
e distance-based topological indices considered in this study have been extensively investigated by researchers for different classes of graphs, and so we were motivated to study these indices for a recently introduced special class of graphs, called PWRGs. An advantage of this study is that this provides a link between two different areas of research, namely, word combinatorics and graph theory. Specifically, we have obtained expressions for evaluating certain distance-based topological indices for PWRGs [14] of binary core words and established bounds on their values when the vertex set is fixed. It will be of interest to study bounds on these indices when the number of edges is fixed.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that they have no conflicts of interest.