JMATHJournal of Mathematics2314-47852314-4629Hindawi10.1155/2021/55676635567663Research ArticleCertain Distance-Based Topological Indices of Parikh Word Representable Graphshttps://orcid.org/0000-0002-4057-3220ThomasNobin12https://orcid.org/0000-0002-3722-3326MathewLisa1https://orcid.org/0000-0003-0604-2159SriramSastha3https://orcid.org/0000-0001-5549-6435NagarAtulya K.4https://orcid.org/0000-0001-8726-5850SubramanianK. G.4CangulIsmail Naci1Department of Basic SciencesAmal Jyothi College of EngineeringKanjirappallyKerala 686518India2Research ScholarAPJ Abdul Kalam Technological UniversityThiruvananthapuramKerala 695016India3Department of MathematicsSchool of Arts, Science and HumanitiesSASTRA Deemed UniversityTanjoreTamil Nadu 613 401Indiasastra.edu4School of MathematicsComputer Science and Engineering Liverpool Hope UniversityLiverpool L169JDUK2021255202120212522021185202125520212021Copyright © 2021 Nobin Thomas et al.This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Relating graph structures with words which are finite sequences of symbols, Parikh word representable graphs (PWRGs) were introduced. On the other hand, in chemical graph theory, graphs have been associated with molecular structures. Also, several topological indices have been defined in terms of graph parameters and studied for different classes of graphs. In this study, we derive expressions for computing certain topological indices of PWRGs of binary core words, thereby enriching the study of PWRGs.

1. 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, ). 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  and intensively investigated by many researchers (for example,  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  and its relationship with the corresponding word and partition was studied in .

On the other hand, there has been a great interest in various topological indices associated with graphs (for example, ) due to their application in the area of chemical graph theory , 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.

There are a number of studies (for example, ) 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 , 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.

2. Preliminaries

The 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, Σ=a1,a2,,ak with an ordering a1<a2<<ak is an ordered alphabet, written as Σ=a1<a2<<ak. 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 u1,u2,,un, uiΣ for 1in and words (possibly empty) v0,v1,,vn over Σ, such that w=u1u2,,un, and w=v0u1v1u2v2,,vn1unvn. The number of occurrences of a word u as a subword of w is denoted by wu. For example, in the word w=aababb over the ordered binary alphabet a<b, the number of a’s is wa=3, the number of b’s is wb=3, and the number of subwords ab’s is wab=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)aababb,aababb,aababb,aababb,aababb,aababb,aababb,aababb.

The 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 Σ=a<b.

Definition 1.

 Let wΣ. The core of w, denoted by corew, is the unique word w0 of w with the smallest possible length, such that wbw0a. A word wΣ is called a core word if and only if corew=w.

Clearly, a nonempty binary word wΣ is a core word if and only if w starts with a and ends with b.

In , 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.

 For a binary word w of length n over Σ=a<b, we define a simple graph G=Gw, 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=Gw 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 Gw of a binary word w over a<b is a bipartite graph  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. The graph Gaababab 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=an1ban2b,,anwbb, where n11 and nk is nonnegative for each k, 2kwb, the number of edges in the corresponding PWRG G(w) is(2)wab=n1+n2++nwb++n1+n2+n1.

Note that in the word w, nk,1kwb, which is a power of a, indicates that there are nk vertices labeled a in the graph Gw with each of these joined to all the vertices that correspond to the subsequent b’s in the word w.

The PWRG of the word aababab.

3. Distance-Based Topological Indices

We consider only simple graphs, and for notions related to graphs, we refer to . Let G=V,E be a connected graph with vertex set VG=V and edge set EG=E. The distance between the vertices u and v of G, denoted by du,v, is defined as the length of a shortest path between u and v in G. The degree of a vertex u of G, which is the number of edges incident at u, is denoted by degu. 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.

 The 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.,(3)HG=u,vVG1du,v.

The Harary index  of a connected graph is a topological index which has been extensively investigated (for example, ).

Theorem 1.

The Harary index of the PWRG G(w), for w=an1ban2b,,anlb, n11, nk0 for 2kl, is given by(4)HGw=1123wawa1+3wbwb1+8wab+4wawb.

Proof.

We consider pairs of vertices u,v in the PWRG G(w) corresponding to the word w=an1ban2banlb, with u,v1,2,,n, where the label of u appears before the label of v in w. There are now four cases to be considered. We will refer to a pair u,v of such vertices with

Both u and v labeled a

u labeled a and v labeled b

u labeled b and v labeled a

Both u and v labeled b

They are given as a pair of type 1, 2, 3, and 4, respectively. There are n1+n2++nlC2=waC2=1/2wawa1 pairs of vertices of type 1 and lC2=wbC2=1/2wbwb1 of type 4, and the distance between each such pair is 2. Here, nCr is the binomial representing the number of ways of choosing r objects from n objects). There are ln1+l1n2++nl=wab pairs of vertices of type 2 with distance 1 and n2+2n3++l1nl=wawbwab pairs of vertices of type 3 with distance 3, since wab=n1+n2++nwb++n1+n2+n1. Hence,(5)HGw=14wawa1+wbwb1+wab+13wawbwab,which yields the required result.

Theorem 2.

The Harary index HGw of a PWRG Gw=V1V2,E with V1=wa=p,V2=wb=q for the word w=an1ban2b,,anqb,n11,nk0 for 2kl, is bounded by(6)1123p2+3q2+4pq+5p+5q8,and above by(7)14p2+q2+4pqpq.

The bounds are attained on Gabq1ap1b and Gapbq, respectively.

Proof.

Since Gw is connected, wab=Ep+q1 . Also, wabpq . Hence, from Theorem 1, the Harary index of Gw is(8)HGw1123p2+3q2+12pq3p3q=14p2+q2+4pqpq,which is the Harary index of the PWRG Gapbq and(9)HGw1123p2+3q2+4pq+5p+5q8,which is the Harary index of the PWRG Gabq1ap1b.

Definition 4.

 The eccentric connectivity index of a connected graph G with vertex set V is defined as ζcG=vVϵvdegv, where ϵv is the eccentricity of v.

The total eccentricity index  of the graph G is ζG=vVϵv.

The topological index, namely, eccentric connectivity index, was introduced in  and has been widely investigated for different classes of graphs (for example,  and references therein).

Theorem 3.

The eccentric connectivity index of the PWRG Gw, for w=an1ban2b,,anlb,n11, is given by(10)ζcGw=6wabkwan1wb,if wa>1 and wb=l>1,3wb,if n1=1,ni=0, for 1<il and l>1,3wa,if n1>1 and l=1,2,if n1=1,l=1,where k be the number of b’s succeeding the last a in w.

Proof.

Let Gw be the PWRG corresponding to w=an1ban2b,,anlb. Then, the vertices representing all a’s preceding the first b and all b’s succeeding the last a are of eccentricity two, whereas the eccentricity of each of the remaining vertices is three. The vertices u and v in Gw are adjacent if and only if u represents a and v represents b, such that the position of b in w is greater than the position of a in w. This implies that the contribution to the eccentric connectivity index from the vertices in Gw represents

a’s in the first block an1b is 2n1wb, as each vertex corresponding to a has degree wb

b’s succeeding the last a is 2kwa (where k1 is the number of b’s succeeding the last a) as each vertex corresponding to such ab has degree wa and

The remaining a’s and b’s in w is 32wabn1wbkwa, since the sum of the degrees of all vertices in Gw is 2wab

Therefore,(11)ζcGw=2n1wb+2kwa+32wabn1wbkwa=6wabn1wbkwa.

Now, if n1=1 and ni=0 for 1<il, then w=abl, and a is of eccentricity one and degree l and each b is of eccentricity two and degree one. Therefore,(12)ζcGw=3wb,if n1=1 and ni=0,1<il.

Similarly, if n1>1 and l=1, w=an1b and b is of eccentricity one and degree n1, while each a is of eccentricity two and degree one. Thus, ζcGw=3wa. Again, if n1=1 and l=1, then w=ab, and both vertices have eccentricity one and degree one and so ζcGw=2. Hence the result.

Remark 1.

It can be seen that the total eccentricity index of the PWRG Gw, for w=an1ban2b,,anlb,n11, is given by(13)ζGw=3wkn1,if wa>1 and wb=l>1,2wb+1,if n1=1,ni=0, for 1<il and l>1,2wa+1,if n1>1 and l=1,2,if n1=1,l=1,where k is the number of b’s succeeding the last a in w.

Theorem 4.

The eccentric connectivity index ζcGw of a PWRG Gw=V1V2,E with V1=wa=p>1,V2=wb=q>1 for the word w=an1ban2b,,anqb,n11,ni0 for 2il, is bounded above by ζcmax and below by ζcmin where(14)ζcmax=4pq,if p+q6,4pq+p+q6,if p+q6 and 2pq8p8q+240,6pq7p7q+18,if p+q>6 and 2pq8p8q+240,ζcmin=5p+5q6.

The upper bound is attained on Gapbq when p+q6, on Gap1babq1 when p+q6,2pq8p8q+240 and on Gabap2bq2ab when p+q>6,2pq8p8q+240, while the lower bound is attained on Gabq1ap1b.

Proof.

Since wa=p>1,wb=q>1, using Theorem 3, the eccentric connectivity index ζcGw=6wabkwan1wb will be a maximum if wab is as large as possible, while n1 and k are as small as possible. Here, k is the number of b’s succeeding the last a in w. It is known  that for a binary word w,wabpq when wa=pand wb=q. The word apbq 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+q6. 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 apbq have only eccentricity 2. When wab=pq1, which is the largest number nearer to the maximum pq, the word ap1babq1 has pq1 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 p1 and q1, respectively. The eccentric connectivity index of the PWRG corresponding to this word ap1babq1 is maximum when p+q6 but only when 2pq8p8q+240. When p+q>6 and 2pq8p8q+24>0, it can be verified that the word ap1babq1 fails to provide the maximum eccentric connectivity index for the corresponding PWRG. On the other hand, the word abap2bq2ab has the minimum value 1 for n1 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 ap2bq2 which have eccentricity 3. In fact, more formally, for w=an1ban2b,,anqb,n11,q>1, n1+n2+nq=p>1, we can show that(15)ζcGw=6pqn1q3qnq+2p3n1+3n2+5n3++2q3nq1+q1nq.

In order to maximize this expression with the constraint n1+n2++nq1+nq=p>1, we have to minimize the negative terms, and so we have to take n1=nq=1 and n2=p2, while ni=0, for 3iq1. Note that we cannot choose n2=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 ζcGw is attained on one of the three words w1=apbq,w2=ap1babq1, or w3=abap2bq2ab whose corresponding PWRGs Gw1,Gw2,Gw3 have their eccentric connectivity indices as η1=4pq,η2=4pq+p+q6,η3=6pq7p7q+18, respectively. Note that η1η2 when p+q6, while the expression 2pq8p8q+24 is the difference η3η2. Hence, the maximum value is attained on Gapbq when p+q6, on Gap1babq1 when p+q6,2pq8p8q+240, and on Gabap2bq2ab, when p+q>6 and 2pq8p8q+24>0.

On the other hand, for p>1,q>1, ζcGw is minimum when wab is minimum, and this happens for w=an1bqkapn1bk with wab=n1q+pkn1k minimum when n1=k=1. Hence, the minimum value 5p+5q6 of ζcGw is attained on Gabq1ap1b.

Theorem 5.

The total eccentricity index ζGw of a PWRG Gw=V1V2,E with V1=wa=p,V2=wb=q for the word w=an1ban2b,,anqb,n11,ni0 for 2iq, is bounded above by 3p+3q2 and below by 2p+2q. This upper bound is attained on Gw, for any word w=abuab, where ua=p2,ub=q2. In particular, it is achieved on Gabq1ap1b. The lower bound is achieved on Gapbq.

Proof.

If k is the number of b’s following the last a in w, it is clear that the maximum value of ζGw is attained when n1=1,k=1 and the minimum is attained when n1=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] The eccentric connectivity coindex ζc¯G of a connected graph G with edge set EG is defined as(16)ζc¯G=uvEGϵu+ϵv,where ϵx is the eccentricity of the vertex x of G.

Theorem 6.

The eccentric connectivity coindex ζc¯Gw of the PWRG Gw, for w=an1ban2b,,anlb,n11,nk0 for 2kl is given by(17)ζc¯Gw=w13wn1k6wab+kwa+n1wb,if wa>1,l>12wbwb1,if n1=1,ni=0,1<il,l>1,2wawa1,if n1>1,l=1,0,if n1=1,l=1,where k is the number of b’s succeeding the last a in w.

Proof.

It has been shown [36, 37] that ζc¯G=uVGϵun1degu which can be written as ζc¯G=n1uVGϵuζcG, where n is the number of vertices in the graph G and ϵu is the eccentricity of the vertex u. If wa>1 and l>1, then the vertices corresponding to the first block a’s and kb’s succeeding the last a are of eccentricity two, and the remaining vertices are of eccentricity three.

Therefore,(18)ζc¯Gw=w13wn1k6wab+kwa+n1wb.

Now, if n1=1,ni=0 for 1<il and l>1, then the vertex corresponding to a is of eccentricity one and the remaining vertices are of eccentricity two.

Therefore, ζc¯Gw=2wbwb1.

Now, if n1>1 and l=1, then the vertex corresponding to b is of eccentricity one and the remaining vertices are of eccentricity two. Then, ζc¯Gw=2wawa1.

If n1=1,l=1, then. ζc¯Gw=0.

4. 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 Km,n,m,n>1, with the bipartition V1V2 of the vertices such that V1=u1,,um and V2=v1,,nn. The graph Km,n is a PWRG Gw corresponding to the word w=ambn over the alphabet a<b.

First, we observe the following facts relating to Km,n.

For 1i,jm,1r,sn, ui,ujV1,ij, and vr,vsV2,rs, we have dui,uj=dvr,vs=2,dui,vr=1, ϵui=ϵvr=2

In the graph Km,n,m,n>1, there are 1/2mm1 unordered pairs of vertices ui,uj,ij, 1/2nn1 unordered pairs of vertices vr,vs,rs, and mn unordered pairs of vertices ui,vr

The degree of each vertex ui,1im is degui=n, and the degree of each vertex vr,1rn is degvr=m.

We now illustrate the computation of the topological indices considered in the earlier sections, both directly from the definition and from the formulae in Theorems 1, 3, and Remark 1.

The Harary index of Km,n, by direct computation from the definition, is(19)HKm,n=12mm1×12+12nn1×12+mn=14m2+n2+mn+4mn.

The same value is obtained from the formula for the Harary index, namely, HGw=1/123wawa1+3wbwb1+8wab+4wawb, since wa=m,wb=n,wab=mn.

The eccentric connectivity index of Km,n, by direct computation from the definition, is(20)ζcKm,n=m×2n+n×2m=4mn.

The same value is obtained from the formula for the eccentric connectivity index, namely, ζcGw=6wabkwan1wb where k is the number of b’s succeeding the last a and n1 is the number of a’s prior to the first b in Gw, so that k=n,n1=m.

The total eccentricity index of Km,n, by direct computation from the definition, is(21)ζKm,n=m×2+n×2=2m+2n.

The same value is obtained from the formula for the total eccentricity index, namely, ζGw=3wkn1, where w=wa+wb=m+n.

The eccentric connectivity coindex of Km,n, by direct computation (using the modified expression for the eccentric connectivity coindex given in the proof of Theorem 6), is(22)ζc¯Km,n=N1uVKm,nϵuζcKm,n,where N is the number of vertices in the graph Km,n, so that(23)ζc¯Km,n=m+n1m+n×24mn=2m2+n2mn.

The same value is obtained from the formula for the eccentric connectivity coindex, namely,(24)ζc¯Gw=w13wn1k6wab+kwa+n1wb=m+n13m+nmn6mn+nm+mn=2m2+n2mn.

5. Conclusion

The 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  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

The data used to support the findings of this study are included within the article.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

The authors would like to thank the reviewers for their very useful comments which helped to revise the study and improve the presentation of the study.