659
Views
0
CrossRef citations to date
0
Altmetric
Research Articles

Stress of a graph and its computation

, , &
Pages 200-208 | Received 01 Jun 2023, Accepted 28 Jul 2023, Published online: 14 Aug 2023

Abstract

Stress is a centrality measure determined by the shortest paths passing through the given vertex. Noting that adjacency matrix playing an important role in finding the distance and the number of shortest paths between given pair of vertices, an interesting expression and also an algorithm are presented to find stress using adjacency matrix. The results and algorithm are suitably adopted to obtain betweenness centrality measure. Further results are extended to the cases of Cartesian product GH of graphs, corona graph G°H and their special cases.

AMS CLASSIFICATION:

1 Introduction

Centrality measures are among essential tools in network analysis. Depending on the given context, one can quantify the importance of a node or an edge in a network and hence one can identify crucial vertices or edges. In general, one can define centrality measure as a function f which assigns a real value f(v) to every vertex v of a graph G. Many important centrality measures such as degree centrality, betweenness centrality, closeness centrality, eigenvector centrality are studied and used in the analysis of various networks. Readers are referred to [Citation1, Citation6, Citation7, Citation12] for the details.

Stress is an important centrality measure introduced by Alfonso Shimbel; see [Citation13]. Stress of a vertex in a graph is the number of shortest paths passing through that vertex. In spite of its significance in the applications (like in understanding responsible protein causing cancer in the protein-signaling network), studying its mathematical properties is not given a considerable attention. The articles [Citation2, Citation8, Citation9] are few among the articles in recent days in which the properties of stress have been studied in the context of different graphs. Rather than counting the number of shortest paths passing through the vertex to find the stress, as done in these references, we consider the adjacency matrix to be an effective tool to compute the stress and present the algorithm for the same. Further, using the adjacency matrices of the graphs G and H, we compute the stress of the vertices in the Cartesian product GH and the corona graph G°H. In Section 4, we provide algorithms to find the stress of vertices in the graphs using the results discussed in the Section 3.

2 Preliminaries

Throughout this paper, the graphs considered are simple, finite, undirected and connected graphs. The length of a shortest uv path is called the distance between the vertices u and v, and the same is denoted by dG(u,v) or simply d(u,v), if the graph under discussion is clear. In a uv path given by P(u,v)=(u=vi1,vi2,,vin=v), the vertex u=vi1 is called origin and the vertex v=vin is terminus, and the vertices vik,2kn1 are called the internal vertices of the path P. The set of shortest paths between the vertices u and v is denoted by P(u,v) and the set of shortest paths between u and v having w as an interior vertex is denoted by Pw(u,v). Further, we denote #P(u,v) by η(u,v) and #Pw(u,v) by ηw(u,v).

Definition 2.1 (Stress of a vertex, Stress of a graph)

Let G be a graph with V(G)={v1,v2,,vn}. The stress of a vertex v, denoted by stG(v), is the number of shortest paths in G having v as an internal vertex. The stress of a graph G, denoted by st(G), is given by i=1nst(vi).

Every vertex sends information to every other vertex through shortest paths and stress is a centrality measure which measures the ability of a vertex in holding together the communicating vertices. Higher the number of shortest paths passing through a vertex, higher will be its stress. After Alfonso Shimbel introduced this notion of stress, not much theoretical investigation was done in this particular area. But, the articles [Citation10, Citation11, Citation12] are a few evidences in which stress is used in the analysis of some biological networks. In the recent developments (see, [Citation2, Citation8, Citation9]) some important properties of stress are explored. The expressions for the stress of vertices from some standard graphs such as paths, trees, cycles, wheels, complete bipartite etc., are discussed. Among the trees of order n, path graph is seen with maximum stress and star graph with minimum stress. It is found that stress of a block graph is the sum of the stress at the cut vertices. A graph is k-stress regular if stress of each of its vertices is k. Characterization of k-stress regular graphs can also be seen in the literature.

In the current paper we make use of the adjacency matrix of the graph to compute the stress of a vertex. For a graph G with n vertices v1,v2,,vn, the adjacency matrix A(G)=(aij) is an n×n matrix, in which aij=1 if vi is adjacent with vj and aij=0 otherwise. For the same graph, the distance matrix D(G)=(dij) is the n×n matrix where dij=d(vi,vj). Whenever the graph under discussion is clear from the context, we write A and D instead of A(G) and D(G), respectively, to denote the adjacency and distance matrices. Now, we introduce a notion of shortest path matrix N(G) of graph G as in thefollowing.

Definition 2.2 (Shortest path matrix)

Given a connected graph G, the shortest path matrix of G denoted by N(G) is an n×n matrix in which the iith entry ηiiG is 1 and ijth entry ηijG represents the number of shortest paths between vi and vj (ij), i.e., η(vi,vj).

The notations N(G) and ηijG used in the above definition are replaced by N and ηij, respectively, when the graph under discussion is clear from the context. It may be noted that for ij, we have ηij=#P(vi,vj). Further, writing ηii=1 in the above definition is for our computational convenience (representing the number of paths/walks of length zero from a vertex to itself!).

Other centrality measure which is computationally closer to stress is betweenness centrality measure.

Definition 2.3 (Betweenness Centrality)

Betweenness centrality measure of a vertex vk, denoted by CB(vk), is given by (1) CB(vk)=i,jki<jηvk(vi,vj)η(vi,vj).(1)

In Section 3, we give an expression for computing betweenness centrality using the properties of adjacency matrix. Then using the same result, in the Section 4, we present an algorithm to compute this measure.

3 Computation of stress using adjacency matrix

Note that by joining any two paths having one common terminus vertex need not result in a shortest path. In fact, a uvw path is a shortest path between u and w if and only if d(u,v)+d(v,w)=d(u,w). The following lemma relates the stress of any vertex of graph G with the entries of N(G).

Lemma 3.1.

If G is a connected graph with N(G)=(ηij), then for any vertex vkV(G)={v1,v2,,vn}, (2) stG(vk)=1i,jni<j,i,jkd(vi,vk)+d(vk,vj)=d(vi,vj)ηikηkj.(2)

Proof.

For any two vertices vi,vj,ij, it may be noted that a shortest vivj path will pass through a vertex vk if and only if (3) d(vi,vk)+d(vk,vj)=d(vi,vj).(3)

In the above case, any shortest vivj path passing through vk is obtained by joining a shortest vivk path with a shortest vkvj path, and vice versa. In other words, we have one-one correspondence between shortest paths vivj-paths passing through vk and pairs of shortest vivk and vkvj paths. Therefore, if ηik and ηkj denotes the number of shortest vivk paths and vkvj paths, respectively, then the number of shortest paths between vi and vj passing through vk is given by the product ηikηkj. In other words, we have (4) #Pvk(vi,vj)=#P(vi,vk)×#P(vk,vj),(4) or simply, ηvk(vi,vj)=η(vi,vk)η(vk,vj). Now by referring to the Definition 2.1, the stress of vk is given by the sum of the products ηikηkj, where the summation is taken over all pair of vertices vi,vj,i<j satisfying EquationEq. (3), proving EquationEq. (2). Hence the lemma. ▪

It is well known that the entries of Ap provide the number of walks of length p between the distinct vertices and the readers are referred to any standard text books like [Citation4]. The following theorem follows immediately.

Theorem 3.2.

If G is a connected graph, then dij, the distance between vi and vj for ij is the least integer p for which the ijth entry of Ap is nonzero. In such a case, ηij=(Ap)ij.

In view of the above theorem the shortest path matrix N(G) could be redefined as the matrix N=(ηij) such that ηij={lcl1, for i=j(Ap)ij, otherwise, where p is the least integer for which the ijth entry of Ap is nonzero. Now the following corollary is immediate.

Corollary 3.3.

If G is a graph with the adjacency matrix A, then for any vertex vkV(G)={v1,v2,,vn}, (5) stG(vk)=i,j=1i<j,i,jkd(vi,vk)+d(vk,vj)=d(vi,vj)nηikηkj,(5) where ηij={lcl1, for i=j(Ap)ij, otherwise and p is the least integer for which the ijth entry of Ap is nonzero.

In the following theorem, we present an expression to compute betweeness centrality of a vertex in G using the shortest path matrix N(G) of G. The proof is immediate from the definition of betweenness centrality and the EquationEq. (4).

Theorem 3.4.

If G is a graph with the adjacency matrix A, then for any vertex vkV(G)={v1,v2,,vn}, the betweenness centrality of vk is given by (6) CB(vk)=i,j=1i<j,i,jkd(vi,vk)+d(vk,vj)=d(vi,vj)nηikηkjηij,(6) where ηij={lcl1, for i=j(Ap)ij, otherwise, and p is the least integer for which the ijth entry of Ap is nonzero.

We next discuss on how the adjacency matrices of the graphs G and H are useful in determining the stress of verticesin GH.

3.1 Stress of vertices in the Cartesian product

Definition 3.5 (Cartesian product of graphs).

The Cartesian product of two graphs G and H, denoted by GH, is a graph with vertex set V(G)×V(H), where two vertices (u1,v1) and (u2,v2) are adjacent if u1=u2 and v1v2E(H) or v1=v2 and u1u2E(G).

It may be noted that in the case of Cartesian product GH, the corresponding adjacency matrix, distance matrix and shortest path matrix are written by considering the pairs of vertices in the lexicographical ordering as column and row indices. The number of shortest paths between any two vertices (ui1,vj1) and (ui2,vj2) in the Cartesian product GH is studied in literature [Citation3, Citation5] and given by (7) η(ui1,vj1),(ui2,vj2)GH=(dG(ui1,ui2)+dH(vj1,vj2)dG(ui1,ui2))ηi1i2Gηj1j2H.(7)

For the convenience of the reader, we provide a detailed but independent explanation on computing the number of shortest paths between the vertices of Cartesian product of twographs.

To start with, consider a tridiagonal n×n matrix of the form X=[x10001x10001x10000x]and the matrices Xt,t=1,2, to observe the following:

  1. (Xt)1n=0 for all t<n1 and (Xn1)1n=1

  2. The highest power of x in 1jth term of Xk is xkj+1 with the coefficient (8) sk(j)={1forj=1sk1(j1)+sk1(j)for1jk+1.(8)

  3. By taking s0(1)=1 and sk(0)=sk(j)=0 for j>k+1, we observe that sk(j) generates the Pascal’s triangle s0=1,0,0,0,0,0,s1=1,1,0,0,0,0,s2=1,2,1,0,0,0,s3=1,3,3,1,0,0,s4=1,4,6,4,1,0,

and in fact, (9) sk(j)=(kj1)for 1jk+1,(9)

the coefficient of xj in the binomial expansion of (x+1)k.

  1. Now by considering path graphs Pm:(v1,,vm) and Pn:(w1,,wn) of length m1 and n1, we observe that the adjacency matrix of the Cartesian product PmPn is the block matrix of size m×m given by (10) A=[BI000IBI000IBI0000B],(10)

where B is the adjacency matrix of Pn of size n×n and of the form (11) [01000010100001010000010].(11)

Since the vertices of PmPn are arranged in the lexicographical ordering, referring to Theorem 3.2, the distance between (v1,w1) and (vm,wn) is given by the least positive integer k for which (1,mn)th entry of Ak is nonzero. This is possible when Bn1 appears in (1,m)th block of Ak. From the observations (i)–(iii), we get that k must be m+n2 and (1,mn)th entry of Am+n2 is the coefficient of Bn1 in the (1,m)th block and given by (12) sm+n2(m)=(m+n2m1)(12)

  1. If l1 is the length of a path graph P1(u1,u2) and l2 is the length of a path graph P2(v1,v2), then referring to EquationEq. (12) we have (l1+l2l1)(=(dP1(u1,u2)+dP2(v1,v2)dP1(u1,u2))) number of paths between (u1,v1) and (u2,v2) in the P1P2.

  2. Noting that each pair of shortest paths in the factor graphs produce as many number of shortest paths as mentioned in EquationEq. (12) in the Cartesian product, the total number of shortest paths between any two vertices in the Cartesian product is as given in EquationEq. (7).

In the following theorem, we will present an expression to find the stress of a vertex in the Cartesian product GH with reference to the details from the factor graphs.

Theorem 3.6.

For any connected graphs G and H, the stress of a vertex (ui,vj) in GH is given by (13) stGH(ui,vj)=12[(dG(ui,ui1)+dH(vj,vj1)dG(ui,ui1))ηii1Gηjj1H]×[(dG(ui,ui2)+dH(vj,vj2)dG(ui,ui2))ηii2Gηjj2H],(13)

where the summation is taken over all the pairs of vertices (ui1,vj1) and (ui2,vj2) different from (ui,vj) in GH satisfying dG(ui1,ui)+dG(ui,ui2)=dG(ui1,ui2) and dH(vj1,vj)+dH(vj,vj2)=dH(vj1,vj2).

Proof.

Referring to EquationEq. (3), note that any vertex (ui,vj) denoted by x is an internal vertex in the shortest paths between the vertices y=(ui1,vj2) and z=(ui2,vj2) if and only if (14) dGH(y,x)+dGH(x,z)=dGH(y,z),(14) equivalently, (15) dG(ui1,ui)+dG(ui,ui2)=dG(ui1,ui2)and(15) dH(vj1,vj)+dH(vj,vj2)=dH(vj1,vj2).

Now referring to EquationEq. (4) in the Lemma 3.1, when the EquationEqs. (14) and Equation(15) are satisfied, it follows that the product η(y,x)η(x,z) equals to ηx(y,z), the number of shortest yz paths in GH having x as an internal vertex. By EquationEq. (7), we have that the number of shortest yx paths in GH is given by (16) η(y,x)=(dG(ui,ui1)+dH(vj,vj1)dG(ui,ui1))ηii1Gηjj1H,(16) and the number of shortest xz paths in GH is given by (17) η(x,z)=(dG(ui,ui2)+dH(vj,vj2)dG(ui,ui2))ηii2Gηjj2H.(17)

Now, EquationEq. (13) follows by substituting EquationEqs. (16) and Equation(17) in EquationEq. (2) of Lemma 3.1 in the context of GH. ▪

Since the ladder graph Ln is the Cartesian product P2Pn of path graphs, the following corollary is immediate from Theorem 3.6.

Theorem 3.7.

If P2=(u1,u2) and Pn=(v1,v2,,vn) are two paths of length two and n1, respectively, then the stress of any vertex (ui,vj) in the ladder graph Ln=P2Pn is given by, (18) stP2Pn(ui,vj)=(j1)(nj)+(j1)(nj+1)(nj+2)2+(nj)j(j+1)2.(18)

Proof.

By symmetry of Ln, we first note that stLn(u1,vj)=stLn(u2,vj) for 1jn. So, we shall find the stress of vertex (u1,vj) of Ln. Since there exists a unique path between any two pair of vertices from a path, we have ηijP2=ηklPn=1 for 1i,j2 and 1k,ln. Substituting the same in EquationEq. (13), we get (19) stP2Pn(u1,vj)=12(dP2(u1,ui1)+dPn(vj,vj1)dP2(u1,ui1))×(dP2(u1,ui2)+dPn(vj,vj2)dP2(u1,ui2)),(19) where the summation is extended over all ordered pairs (ui1,vji) and (ui2,vj2) other than (u1,vj) satisfying (20) dP2(ui1,u1)+dP2(u1,ui2)=dP2(ui1,ui2)(20)

and (21) dPn(vj1,vj)+dPn(vj,vj2)=dPn(vj1,vj2).(21)

The summation in EquationEq. (19) could be split into the following three cases to satisfy the conditions given in EquationEqs. (20) and Equation(21). The first is Case 1: i1=i2=1, in which case j1<j<j2 or j2<j<j1, the second is Case 2: i1=1,i2=2, in which case j1<jj2 or j2<jj1, and the third is Case 3: i1=2,i2=1, in which case j1j<j2 or j2j<j1. In the Case 1, terms in the summation are equal to 1 as dP2(u1,u1)=0 and the part of summation appearing in EquationEq. (19) reduces to (22) j1,j2:j1<j<j2;j2<j<j11=2(j1)(nj)=2stPn(vj).(22)

In the Case 2, the terms in the summation appearing in EquationEq. (19) are equal to 1+dPn(vj,vj2) for j1<jj2. The summation in this case reduces to (23) (j1)(jj2n(1+dPn(vj,vj2))+jj1n(1+dPn(vj,vj1)))=2(j1)(nj+2)(nj+1)2.(23)

Similarly in the Case 3, the summation reduces to (24) (nj)(1j1j(1+dPn(vj,vj1))+1j1j(1+dPn(vj,vj1)))=2(nj)(j+1)j2.(24)

Now, adding the terms obtained in EquationEqs. (22)–(24), and substituting the same in EquationEq. (19), we get EquationEq. (18) proving the theorem. ▪

3.2 Stress of vertices in corona of graphs

In this subsection, we will consider corona G°H of connected graphs G and H to find the stress of vertices therein.

Definition 3.8 (Corona graph).

The corona G°H of two graphs G and H is defined as the graph obtained by taking one copy of G and |V(G)| copies of H, and joining by an edge each vertex of ith copy of H with the ith vertex of G.

Throughout our discussion in this subsection, G is a connected graph with vertices v1,v2,,vm and H is a connected graph with n vertices w1,w2,,wn. We denote the vertices in the ith copy of H in G°H by w1i,w2i,,wni. Before proceeding further, we shall describe some notions used in the following discussion. For a matrix M, Mi represents the ith column of M, 1m indicates the column matrix of order m of all 1s, J is a n×n matrix of all 1s. Given a graph H, the join graph u+H is a graph obtained by adding a vertex u adjacent to all the vertices of H.

If A is the adjacency matrix of H, then the adjacency matrix of u+H i.e., A(u+H) is the (n+1)×(n+1) matrix, say B, is in the form of [0111A1] and B2=[ndegH(w1)degH(wn)degH(w1)A2+JdegH(wn)]

It is clear that the above B2 is completely nonzero matrix and therefore, we have shortest path matrix of u+H given by N(u+H)=[1111NH1].

The block NH in the matrix N(u+H) is playing an important role in understanding shortest path matrix of corona of graphs and, in fact, ijth entry of NH is given by (25) (NH)ij={1,if i=j1,if (A(H))ij=1(A(H)2)ij+1,otherwise.(25)

The ijth entry of NH gives the number of shortest paths between the ith and jth vertices of H in u+H.

Though we derive the stress of any vertex from the corona in terms of stress of vertices in the factor graph or a smaller graph, we discuss adjacency matrix, shortest path matrix, and distance matrix of corona in the following for the purpose of academic interest. The adjacency matrix of G°H is a block matrix of size (m+1)×(m+1). Concentrating on (i,i)th blocks, for i=1 the entries in the block correspond to the vertices of G. As the adjacency among the vertices of G remains unaltered in G°H, the (i,i)th block for i=1 of A(G°H) is A(G). For i1, the entries of (i,i)th block represents the adjacency between the pair of vertices from (i1)th copy of H in G°H. From the definition of corona graph, it is evident that if a pair of vertices is adjacent in H, then the corresponding pair will be adjacent in every copy of H in G°H and vice versa. Therefore, (i,i)th block of A(G°H), for i1, is given by A(H). Further, for j1, the (1,j)th blocks, correspond to the vertices of G and the vertices of H in the (j1)th copy of H. Since, vj is adjacent to all the vertices from the (j1)th copy and nonadjacent with the vertices from remaining copies of H, this block is given by an m×n matrix with 1’s in the jth row and 0 in the rest of the rows. For ij,i1, no vertex of ith copy is adjacent to no vertex in the jth copy of H in G°H. So, the (i,j)th block for ij,i1 is a zero matrix of order n×n.

Further, we note that the distance matrix D(A°H) is (m+1)×(m+1) block matrix. For i=1, the (i,i)th block of D(G°H) is D(G), as the distance between a pair of vertices of G is preserved in G°H. Since every vertex of H in the ith copy is adjacent to vi in G°H, the (i,i)th block(i1) of D(G°H) is given by D(u+H). For j1, distance between vj and vertices in the kth,kj copy of H is dG(vj,vk)+1 and since vj is adjacent to all the vertices in the jth copy of H, the (1,j)th block of D(G°H) is given by [Dj+1m]1nT. For i<j,i1, the distance between the vertices from the ith copy of H and the jth copy of H is dG(vi,vj)+2. Therefore for ij,i1, the ijth block is given by (dG(vi,vj)+2)J.

Similarly by looking at the structure of the corona graph, the shortest path matrix N(G°H) can be constructed easily with the help of N(G) and NH. The shortest path matrix N(G°H) is a block matrix of order (m+1)×(m+1). The blocks of N(G°H) are given as follows:

  • For i=1, the (i,i)th block of N(G°H) corresponds to the number of shortest paths among the vertices of G in G°H. As the number of shortest paths between a pair of vertices of G remains the same in G°H, this block is given by shortest path matrix of G i.e, N(G).

  • For i1, the (i,i)th block corresponds to the number of shortest paths among the vertices in the (i1)th copy of H in G°H, which is given by the matrix NH. Therefore the (i,i)th blocks are NH for all i1.

  • For j1, the (1,j)th block denotes the number of shortest paths between the vertices of G and the vertices in different copies of H in G°H. These blocks are given by [N(G)j11nT].

  • For i1,i<j, the (i,j)th block corresponds to the vertices from (i1)th copy and (j1)th copy of H. As the number of shortest paths between the vertices in the ith and jth copy of H is same as the number of shortest paths between the vertices vi1 and vj1, this block is given by η(i1)(j1)J, where J is n×n matrix of all 1s.

Based on the above observations, N(G°H) is a block matrix given by [N(G)N(G)11nTN(G)21nTN(G)31nTN(G)m1nT(N(G)11nT)TNHη12Jη13Jη1mJ(N(G)21nT)Tη12JNHη23Jη2mJ(N(G)m1nT)TNH]

In the following theorem, we shall find the stress of vertices in the corona graph G°H using the matrices N(G) and NH.

Theorem 3.9.

Let G be a graph with vertices v1,v2,,vm and let w1i,w2i,,wni be the vertices in the ith copy of the graph H in G°H. Then (26) stG°H(wji)=stu+H(wj);1im,1jn(26) (27) stG°H(vi)=(n2+n+1)stG(vi)+stvi+H(vi)+(n2+n)mj=1jiηijG.(27) where ηij is the ijth entry of the shortest path matrix N(G) of G and u+H is the join graph obtained by adding a vertex u adjacent to all the vertices of H.

Proof.

For any vertex wji,1jn in the ith copy of H in G°H, the possible shortest paths having wji as an internal vertex are the ones of length two passing through wj within the same copy of H. So, the number of such shortest paths in G°H is same as the number of shortest paths in u+H having wj as an internal vertex. Therefore, stG°H(wji)=stu+H(wj),1im;1jn,proving EquationEq. (26).

Next we shall find the stress of a vertex vi from G in G°H. For any pair of vertices vj and vk from G, note that any shortest vjvk path in G having vi as internal vertex preserves its character of shortest length in G°H, vice versa. Therefore, (28) k<j;k,jiηvi(vj,vk)=stG(vi).(28)

For any pair of nonadjacent vertices wpi and wqi, there is unique shortest wpiwqi path in G°H having vi as an internal vertex. Therefore, (29) p,q:p<qηviG°H(wpi,wqi)=p,q:p<qηvivi+H(wp,wq)=stvi+H(vi).(29)

For each wpi and vj (ij), any shortest path between them is the join of wpivi and shortest vivj path and therefore, we have ηviG°H(wpi,vj)=ηG(vi,vj)=ηijG. Further, (30) wpi;vj:jiηviG°H(wpi,vj)=wpi;vj:jiηijG=nj:jiηijG.(30)

With the same argument, we have ηviG°H(wpi,wqj)=ηijG, ηviG°H(wpk,wqj)=ηviG(vk,vj) for k,ji, and ηviG°H(vk,wqj)=ηviG(vk,vj) for k,ji. Therefore, we have the following: (31) wpi;wqj:jiηviG°H(wpi,wqj)=wpi;wqj:jiηijG=n2j:jiηijG,(31) (32) wpk;wqj:k,ji;k<jηviG°H(wpk,wqj)=vk;vj:k,ji,k<jηviG(vk,vj)=n2stG(vi),(32)

and (33) vk;wqj:k,jiηviG°H(vk,wqj)=nvk;vj:k,ji,k<jηviG(vk,vj)=nstG(vi).(33)

Now we get EquationEq. (27), by substituting EquationEqs. (28)–(33) in the expression for stress of vi in G°H, proving the theorem. ▪

From the above theorem, it may be noted that the computation of stress in the corona G°H is reduced to the exercise of finding the stress of vertices in the factor graph G and the join graph u+H using the respective D and N matrices.

4 Algorithms to find stress and betweenness measure

In this section, we present a few algorithms for computing the stress of a vertex in a general graph and in some special cases using adjacency matrices. Since betweenness measure is closely related to stress, we obtain the same by using the functions obtained during stress computation.

4.1 Shortest path matrix

We begin with the first algorithm for a function which will return the shortest path matrix N for a given graph. The inputs for this algorithm to find the shortest path matrix are the adjacency matrix A and the order n of the graph G.

The for loops together in the steps 3 and 4 require m(m1)2 iterations. Matrix multiplication, is of O(m3) and the time required to execute the for loop in step 13 is at most m(m1)2, which is executed only if the list L is non empty. Considering the maximum possible iterations, i.e, considering the path graph, which requires (m1) iterations to make L an empty set, the total time required is less than (m1)[m3+(m2)+(m12)+(m22)++1]. So it follows that the time complexity of Algorithm 1 is O(m4)+O(m3)=O(m4).

4.2 Stress of a vertex in general graph

The following Algorithm 2 returns the stress s of a given vertex vk of the graph.

Initially to find the shortest path matrix in Step 2, we use the Algorithm 1. For m values of the for loop in Step 4 of Algorithm 2, the for loops in Step 6 and 7, will be executed in (m2) iterations. Total time required to execute these for loops will be [m(m1)2]. So the time complexity of Algorithm 2 will be O(m4)+O(m2)=O(m4).

4.3 Betweenness centrality of a vertex in general graph

With a slight variation in step 7 of Algorithm 2, here we present an algorithm to compute the betweenness centrality of a vertex.

To find the shortest path matrix in step 2, we use the Algorithm 1 with complexity O(m4). Further, it requires (m2) iterations to run the for loops in step 4 and step 5. So the time complexity of Algorithm 2 will be O(m4)+O(m2)=O(m4).

4.4 Stress in Cartesian product

In the following Algorithm 3, we compute the stress of vertices in the Cartesian product of two graphs G and H. Algorithm 1 is used to get the shortest path matrix of G and H.

In the Algorithm 3, to find the matrices N and M in Steps 4 and 5, we use Algorithm 1 with complexity O(m4)+O(n4). Further to execute the for loops in Steps 9 and 11, we require (l2)=(mn2) iterations. Complexity will be O(m2n2). So the time complexity of Algorithm 3 will be O(m4)+O(n4)+O(m2n2). Without loss of generality, if we assume that mn, then the time complexity of Algorithm 3 will be O(m4).

4.5 Stress of vertices in a corona graph

In the following algorithm, we find the stress of vertices of G°H using the adjacency matrices of G and H.

To find shortest path matrix of G in step 4, we use Algorithm 1 with complexity O(m4). In step 7, for n values, we use Algorithm 2 to find the stress of vertices in u+H. The complexity will be O((n+1)4) (where n+1 is the size of B). Algorithm 2 is used again in step 10 with complexity O((n+1)4). Further, for m values in the for loop in step 11, Algorithm 2 of complexity O(m4) will be used to calculate stress of vertex in G and the for loop in step 13 is executed m times. It follows that the complexity of this algorithm is O(n5)+O(m5).

Acknowledgments

We thank Professor Bapat for bringing our attention toward number of paths between any two points on the chess board and its relation with binomial coefficient.

Disclosure statement

No potential conflict of interest was reported by the author(s).

Additional information

Funding

Among the authors, Manjunatha Prasad Karantha wish to acknowledge the funding support by Science and Engineering Research Board (DST), India through the projects CRG/2019/000238 and MTR/2018/000156.

References

  • Borgatti, S. P., Everett, M. G. (2006). A graph-theoretic perspective on centrality. Soc. Netw. 28(4): 466–484.
  • Bhargava, K., Dattatreya, N. N., Rajendra, R. (2020). On stress of a vertex in a graph. arXiv preprint arXiv:2208.13493.
  • Camby, E., Caporossi, G., Paiva, M. H. M., Ribeiro, M. R. M., Segatto, M. E. V. (2018). On the number of shortest paths in Cartesian product graphs and its robustness. Les Cahiers du GERAD, GERAD, HEC Montreal, Canada.
  • Harary, F. (1988). Graph Theory. Reading, AM: Addison-Wesley Publishing Company.
  • Kumar, S., Kannan, B. (2020). Betweenness centrality in Cartesian product of graphs. AKCE Int. J. Graphs Comb. 17(1): 571–583.
  • Lopez, R., Worrell, J., Wickus H., Florez, R., Darren, N. A. (2017). Towards a characterization of graphs with distinct betweeness centralities. Australas. J. Combin. 68(2): 285–303.
  • Newman, M. (2018). Networks. Oxford: Oxford University Press.
  • Poojary, R., Bhat, A. K., Subramanian, A., Karantha, M. P. (2023). The stress of a graph. Commun. Comb. Optim. 8(1): 53–65.
  • Poojary, R., Bhat, A. K., Subramanian, A., Karantha, M. P. (2022). Stress of wheel related graphs. Natl. Acad. Sci. Lett. 45: 427–431.
  • Scardoni, G., Laudanna, C. (2012). Centralities Based Analysis of Complex Networks. London: IntechOpen.
  • Scardoni, G., Tosadori, G., Faizan, M., Spoto, F., Fabbri, F., Laudanna, C. (2015). Biological network analysis with CentiScaPe: Centralities and experimental dataset integration. F1000Research 3: 139.
  • Shannon, P., Markiel, A., Ozier, O., Baliga, N. S., Wang, J. T., Ramage, D., Amin, N., Schwikowski, B., Ideker, T. (2003). Cytoscape: A software environment for integrated models of biomolecular interaction networks. Genome Res. 13(11): 2498–2504.
  • Shimbel, A. (1953). Structural parameters of communication networks. Bull. Math. Biophys. 15(4): 501–507.