EUROPEAN JOURNAL OF PURE AND APPLIED MATHEMATICS Vol. 17, No. 3, 2024, 1659-1673 ISSN 1307-5543 – ejpam.com Published by New York Business Global The Wiener Index of Prime Graph PG(Zn) Noor Hidayat1,∗, Vira Hari Krisnawati1, Muhammad Husnul Khuluq1, Farah Maulidya Fatimah1, Ayunda Faizatul Musyarrofah1 1 Department of Mathematics, Faculty of Mathematics and Natural Sciences, University of Brawijaya, Malang, East Java, Indonesia Abstract. Let G = (V,E) be a simple graph and (R,+, ·) be a ring with zero element 0R. The Wiener index of G, denoted by W (G), is defined as the sum of distances of every vertex u and v, or half of the sum of all entries of its distance matrix. The prime graph of R, denoted by PG(R), is defined as a graph with V (PG(R)) = R such that uv ∈ E(PG(R)) if and only if uRv = {0R} or vRu = {0R}. In this article, we determine the Wiener index of PG(Zn) in some cases n by constructing its distance matrix. We partition the set Zn into three types of sets, namely zero sets, nontrivial zero divisor sets, and unit sets. There are two objectives to be achieved. Firstly, we revise the Wiener index formula of PG(Zn) for n = p2 and n = p3 for prime number p and we compare this results with the results carried out by previous researchers. Secondly, we determine the Wiener index formula of PG(Zn) for n = pq, n = p2q, n = p2q2, and n = pqr for distinct prime numbers p, q, and r. 2020 Mathematics Subject Classifications: 05C09, 05C25. Key Words and Phrases: Distance matrix, prime graph, ring, Wiener index 1. Introduction A graph G is a system consisting of a finite non-empty vertex set and a finite edge set such that every element is identified with a pair of vertices [14]. The development of graph theory and its applications has been carried out by many researchers. One of the developments is the construction of graphs be related with algebraic structures. The study of graph theory for a commutative ring was began in 1988, when Beck in [11] introduced the notion of zero divisor of the graph. Other construction of graphs related to algebraic structures is zero divisor graphs ([4], [5], and [20]). Further development was carried out by Anderson and Badawi in 2008 by defining and discussing the properties of the total ∗Corresponding author. DOI: https://doi.org/10.29020/nybg.ejpam.v17i3.5166 Email addresses: noorh@ub.ac.id (N. Hidayat), virahari@ub.ac.id (V. H. Krisnawati), husnulkhu@gmail.com (M. H. Khuluq), farahmaulidya19@gmail.com (F. M. Fatimah), ayundafaiza02@gmail.com (A. F. Musyarrofah) https://www.ejpam.com 1659 © 2024 EJPAM All rights reserved. N. Hidayat et al / Eur. J. Pure Appl. Math, 17 (3) (2024), 1659-1673 1660 graph of the ring [6]. In 2010 Subhakar discussed about associate ring graph [37]. Ashrafi et al [7] investigated the basic properties of unit graph and given some characterization results regarding connectedness, chromatic, index, diameter, girth, and planarity of total graph. The development of prime graph was studied by Bhavanari et al in 2010 [12]. They presented several examples of prime graphs on rings Zn for n prime numbers. They also proved the relationship between a prime ring and a prime graph of the ring. Furthermore, Kalita and Patra in 2014 determined the chromatic number of prime graphs of a ring Zn [26]. Pawar and Joshi introduced prime graphs PG1(R) in 2017 [27] and PG2(R) in 2019 [19]. The application of graph theory has been carried out in many fields such as networks, cryptography, transportation, coding theory, chemistry, crystallography, and information systems (see [1], [2], [15], [21], [22], [23], [24], [29], [30], [31], [35], and [39]). The application of graph theory to the field of chemistry was first introduced by Wiener in 1947 to predict the boiling point of the paraffin molecular structure [40]. The value of that prediction is then known as Wiener index which is defined as the sum of the distances between vertices in a chemical graph representing non-hydrogen atoms in the molecule [13]. The highly anticipated physicochemical features of all sorts of alkanes are found using the distance-based topological indices known as the Wiener index [25]. The mathematical representation of the Wiener index is given by Hosoya as the sum of the distances of each pair of vertices in the graph [17]. Many researchers have developed the concept of the Wiener index for graphs of rings. Ramane et al [32] obtain the Wiener index of line graphs and some class of graphs. Suthar and Prakash provided the Wiener index formula for total graphs over the ring Zn [38]. The Wiener index formula for zero divisor graph of ring was given in ([3], [8], [28], [33], [34], and [36]). Asir et al [10] gave the Wiener index formula for unit graph of ring R. Furthermore, Joshi and Pawar [18] introduced the formula of Wiener index of the prime graph of the ring Zn, for n = p, n = p2 and n = p3 where p is a prime number. All Wiener index formulas that have been constructed for ring graphs (zero divisor graph, unit graph, total graph, and prime graph) can be seen in the survey results arranged by Asir et al [9]. In this article, we determine theWiener index of PG(Zn) for some cases n = p, p2, p3, pq, p2q, pqr, with distinct prime p, q, and r, using distance matrix method. We partition the set Zn into three types of sets, namely zero sets, nontrivial zero divisor sets, and unit sets. Wiener index is obtained from a half of the sum of all entries of the distance matrix. The discussion is divided into four sections. In the second section, we give a literature review to understand the theory which is used in this article. In the third section, we compare the Wiener index formula of PG(Zn) where n = p, p2, p3 for any prime number p with the results carried out by Joshi and Pawar [18] and we determine the Wiener index formula of PG(Zn) where n = pq, p2q, p2q2, pqr for distinct prime numbers p, q, and r. The last section concludes the contents of this article. N. Hidayat et al / Eur. J. Pure Appl. Math, 17 (3) (2024), 1659-1673 1661 2. Preliminaries The graph referred to in this article is a simple graph, that is, undirected graphs that have no loops and multiple edges. More contents on graph theory can be studied in [14], while topics on algebraic structure can be studied in [16]. A graph G = (V,E) is a system consisting of a finite non-empty vertex set V (G) and a finite edge set E(G), which is a subset of V (G)× V (G). The order and size of G, are the cardinality of V (G) and E(G), respectively. Generally, the edge (u, v) ∈ E(G) is written as uv or vu. Two vertex u and v are called adjacent if uv is an edge. The open neighborhood set of u ∈ V (G), denoted by N(u), is the set of vertices that are adjacent to u, and the cardinality of N(u) is called the degree of u, denoted by deg(u). A graph G is said to be connected if any two of its vertices are connected. The distance between vertices u and v in a connected graph, denoted as d(u, v), is defined as the size of the shortest path subgraph between vertices u and v. The distance matrix of a graph G, denoted D(G), is the matrix [dij ] defined as dij = d(vi, vj) for i ̸= j and dii = 0. The Wiener index of G is the sum of the distances of all pairs of vertices in G. The definition of the Wiener index can be related to the concept of the distance matrix as follows: Definition 1. [17] Let G be a graph, and D(G) be the distance matrix of G. The Wiener index of G, denoted W (G), is defined as W (G) = 1 2 n∑ i=1 n∑ j=1 dij . The definition and some properties of prime graphs of ring R as follows: Definition 2. [12] Let (R,+, ·) be a ring. The prime graph of ring R, denoted by PG(R), is a graph with V (PG(R)) = R and E(PG(R)) = {uv|uRv = {0R} or vRu = {0R} and u ̸= v}. The following Theorem 1 shows a property of a prime grphs of a ring. While other properties can be seen in [12]. Theorem 1. [12] Let (R,+, ·) be a ring and PG(R) be its prime graph. (i) Every non-zero vertex v ∈ R is adjacent to 0R. (ii) d(u, v) = 2 if and only if the vertices u and v are not adjacent. (iii) If R is commutative ring unity 1R, then the vertices u and v are adjacent if and only if uv = 0R. (iv) If R is a commutative ring with unity 1R, then u is only adjacent to 0R. (v) If R = Zp for p primes or p = 4, then PG(Zp) ∼= K1,p−1. N. Hidayat et al / Eur. J. Pure Appl. Math, 17 (3) (2024), 1659-1673 1662 The Wiener index of the prime graph of the ring Zn for n = p, n = p2, n = p3 with p a prime number, as obtained by Joshi and Pawar [18] as follows: Theorem 2. [18] If p is a prime number, then W (PG(Zp)) = (p− 1)2. Theorem 3. [18] If p is a prime number, then W (PG(Zp2)) = p(p− 1)(2p2 − 2p+ 1) 2 . Theorem 4. [18] If p is a prime number, then W (PG(Zp3)) = p(p− 1)(2p4 + 2p3 − 2p− 3) 2 . 3. Main Result In this section we will determine the Wiener index formula of PG(Zn) in several cases of n, especially for n = pq, n = p2q, n = p2q2, n = pqr, where p, q, r are prime numbers. However, firstly we determined theWiener index formula for the case n = p, n = p2, n = p3, although the formula for this case has been determined by Joshi and Pawar [18]. Theorem 5. If p is a prime, then W (PG(Zp)) = (p− 1)2. Proof. For prime p, it holds d(u, v) = 2 if u and v are not adjacent and d(u, v) = 1 if u and v are adjacent. Next we partition Zp into two sets, namely the zero set O = {0}, the unit set U = {x ∈ Zp|x is unit in ring Zp}. Based on Theorem 1, PG(Zp) ∼= K1,p−1 and the distance matrix of PG(Zp) is given as D(PG(Zp)) = ( O U O 0 11×(p−1) U 1(p−1)×1 2(Jp−1 − Ip−1) ) , where 1m×n is a matrix of order m× n with all entries 1 and Jn = 1n×n. We obtain W (PG(Zp)) = 1 2 ( 2(p− 1) + 2(p− 1)2 − 2(p− 1) ) = (p− 1)2. Thus, W (PG(Zp)) = (p− 1)2. We see that the Wiener index formula of PG(Zp) in Theorem 5 is equal to the formula in Theorem 2. Therefore, the result in Theorem 5 strengthen Theorem 2, considering that Theorem 2 does not provide analytical proof. The Wiener index formula of PG(Zp2) and PG(Zp3) with p prime numbers as follows: N. Hidayat et al / Eur. J. Pure Appl. Math, 17 (3) (2024), 1659-1673 1663 Theorem 6. If p is a prime number, then W (PG(Zp2)) = p(p− 1)(2p2 + 2p− 3) 2 . Proof. For every prime p, the ring Zp2 has p2 − p units and p − 1 nontrivial zero divisors. Next we partition Zp2 into three sets, namely the zero set O = {0}, the unit set U = {x ∈ Zp2 |x is unit in ring Zp2}, and the set of nontrivial zero divisors Zp2 are Z = {p, 2p, . . . , (p− 1)p} = ⟨p⟩ \ {0}. Based on Theorem 1, we obtain (i) Every vertex in O is adjacent to every vertex in Z and U . (ii) Every vertex in Z is adjacent to every vertex in O and Z. (iii) Every vertex in U is only adjcacent to every vertex in O. Thus, the distance matrix of PG(Zp2) is D(PG(Zp2)) =  O Z U O 0 11×(p−1) 11×p(p−1) Z 1(p−1)×1 Jp−1 − Ip−1 2(p−1)×p(p−1) U 1p(p−1)×1 2p(p−1)×(p−1) 2(Jp(p−1) − Ip(p−1)) . where 1m×n is a matrix of order m × n with all entries 1, 2m×n is a matrix of order m × n with all entries 2, and Jn = 1n×n. A half of the sum of all entries in the matrix D(PG(Zp2)) is W (PG(Zp2)) = 1 2 (2p4 − 2p2 − 2(p2 − 1)− (p− 1)2 + (p− 1)) = 2p4 − 5p2 + 3p 2 = p(p− 1)(2p2 + 2p− 3) 2 . Hence, W (PG(Zp2)) = p(p− 1)(2p2 + 2p− 3) 2 . Theorem 7. If p is prime, then W (PG(Zp3)) = p(p− 1)(2p4 + 2p3 + 2p2 − 4p− 1) 2 . Proof. For every prime p, the ring Zp3 has p3 − p2 units and p2 − 1 nontrivial zero divisors. The nontrivial zero divisors in Zp3 are Z = {p, 2p, . . . , (p− 1)p, p2, (p+ 1)p, . . . , 2(p− 1)p, 2p2, . . . , (p2 − 1)p}. N. Hidayat et al / Eur. J. Pure Appl. Math, 17 (3) (2024), 1659-1673 1664 Next, we partition Zp3 into three sets, namely the zero set O = {0}, the unit set U = {x ∈ Zp3 |x is unit in ring Zp3}, and the set of nontrivial zero divisors Zp3 are A = {p2, 2p2, . . . , (p− 1)p2} = ⟨p2⟩ \ {0}, |A| = p− 1, B = ⟨p⟩ \ ⟨p2⟩, |B| = p2 − p. Based on Theorem 1, the adjacency of every vertex in PG(Zp3) is as follows: (i) Every vertex in O is adjacent to every vertex in A,B, and U . (ii) Every vertex in A is adjacent to every vertex in O,A and B. (iii) Every vertex in B is adjacent to every vertex in O and A. (iv) Every vertex in U is only adjcacent to every vertex in O. So, we obtain the distance matrix of PG(Zp3) is D(PG(Zp3)) =  O A B U O 0 11×(p2−p) 11×(p−1) 11×(p3−p2) A 1(p2−p)×1 2(Jp2−p − Ip2−p) 1(p2−p)×(p−1) 2(p2−p)×(p3−p2) B 1(p−1)×1 1(p−1)×(p2−p) Jp−1 − Ip−1 2(p−1)×(p3−p2) U 1(p3−p2)×1 2(p3−p2)×(p2−p) 2(p3−p2)×(p−1) 2(Jp3−p2 − Ip3−p2) , where 1m×n is a matrix of order m × n with all entries 1, 2m×n is a matrix of order m × n with all entries 2, and Jn = 1n×n. A half of the sum of all entries in the matrix D(PG(Zp3)) is W (PG(Zp3)) = 1 2 (2p6 − 2p3 − 2(p3 − 1)− 2(p2 − p)(p− 1)− (p− 1)2 + (p− 1)) = 2p6 − 6p3 + 3p2 + p 2 = p(p− 1)(2p4 + 2p3 + 2p2 − 4p− 1) 2 . Thus, we obtain W (PG(Zp3)) = p(p− 1)(2p4 + 2p3 + 2p2 − 4p− 1) 2 . The Wiener index formulas of PG(Zn) in Theorem 6 and Theorem 7 are different from the formula in Theorem 3 and Theorem 4, respectively. We claim that Theorem 6 and Theorem 7 are correct. We give a simple example for p = 2. The prime graphs of PG(Z4) and PG(Z8) are given in Figure 1. N. Hidayat et al / Eur. J. Pure Appl. Math, 17 (3) (2024), 1659-1673 1665 Figure 1: (a). Prime graph of ring Z4, and (b). Prime graph of ring Z8 We compare the Wiener index formula of PG(Z4) resulting from Theorem 6 and The- orem 3 with Definition 1. Based on Theorem 3, we get W (PG(Z4)) = 5 and based on Theorem 6, we get W (PG(Z4)) = 9. However, by Definition 1, since d(0, 1) = d(0, 2) = d(0, 3) = 1, d(1, 2) = d(1, 3) = d(2, 3) = 2, the Wiener index of PG(Z4) isW (PG(Z4)) = 9. Now, we compare the Wiener index formula of PG(Z8) resulting from Theorem 7 and Theorem 4 with Definition 1. Based on Theorem 4, we get W (PG(Z8)) = 41 and based on Theorem 7, we get W (PG(Z8)) = 47. However, by Definition 1, the Wiener index of PG(Z8) is W (PG(Z8)) = 47. Next, we investigate the Wiener index formula for other cases of n, that is, for n = pq, n = pqr, n = p2q, and n = p2q2 where p, q, and r are different primes. The Wiener index formula for PG(Zpq) is as follows: Theorem 8. If p, q are two distinct prime numbers, then W (PG(Zpq)) = p2q2 − 3pq + p+ q. Proof. For every prime number p, q, the ring Zpq has u = (p − 1)(q − 1) units and p+ q − 2 nontrivial zero divisors. Next, we partition Zpq into three sets, namely the zero set O = {0}, the unit set U = {x ∈ Zpq|x is unit in ring Zpq}, and the set of nontrivial zero divisors Zpq are A = {q, 2q, . . . , (p− 1)q} = ⟨q⟩ \ {0}, |A| = p− 1, B = {p, 2p, . . . , (q − 1)p} = ⟨p⟩ \ {0}, |B| = q − 1. Based on Theorem 1, the adjacency of every vertex in PG(Zpq) is as follows: (i) Every vertex in O is adjacent to every vertex in A,B, and U . N. Hidayat et al / Eur. J. Pure Appl. Math, 17 (3) (2024), 1659-1673 1666 (ii) Every vertex in A is adjacent to every vertex in O and B. (iii) Every vertex in B is adjacent to every vertex in O and B. (iv) Every vertex in U is only adjacent to every vertex in O. Then, the distance matrix of PG(Zpq) is D(PG(Zpq)) =  O A B U O 0 11×(p−1) 11×(q−1) 11×u A 1(p−1)×1 2(Jp−1 − Ip−1) 1(p−1)×(q−1) 2(p−1)×u B 1(q−1)×1 1(q−1)×(p−1) 2(Jq−1 − Iq−1) 2(q−1)×u U 1u×1 2u×(p−1) 2u×(q−1) 2(Ju − Iu) , where 1m×n is a matrix of order m × n with all entries 1, 2m×n is a matrix of order m × n with all entries 2, and Jn = 1n×n. A half of the sum of all entries in the matrix D(PG(Zpq)) is W (PG(Zpq)) = 1 2 (2p2q2 − 2pq − 2(pq − 1)− 2(p− 1)(q − 1)) =p2q2 − 3pq + p+ q. Thus, we obtain W (PG(Zpq)) = p2q2 − 3pq + p+ q. Theorem 9. If p, q, and r are distinct prime numbers, then W (PG(Zpqr)) = p2q2r2 − 5pqr + 2(pq + qr + pr)− (p+ q + r) + 1. Proof. For every three distinct prime numbers p, q, and r, the ring Zpqr has u = (p− 1)(q− 1)(r− 1) = pqr− pq− qr− pr+ p+ q+ r− 1 units and pq+ qr+ pr− p− q− r nontrivial zero divisors. The nontrivial zero divisor of Zpqr is Z = (⟨p⟩ ∪ ⟨q⟩ ∪ ⟨r⟩) \ {0}. Next, we partition Zpqr into three sets, namely the zero set O = {0}, the unit set U = {x ∈ Zpqr|x is unit in ring Zpqr}, and the set of nontrivial zero divisors Zpqr are A = ⟨qr⟩ \ {0}, |A| = p− 1 = a, B = ⟨pr⟩ \ {0}, |B| = q − 1 = b, C = ⟨pq⟩ \ {0}, |C| = r − 1 = c, D = ⟨p⟩ \ (⟨pq⟩ ∪ ⟨pr⟩), |D| = qr − (q + r − 1) = d, E = ⟨q⟩ \ (⟨pq⟩ ∪ ⟨qr⟩), |E| = pr − (p+ r − 1) = e, F = ⟨r⟩ \ (⟨pr⟩ ∪ ⟨qr⟩), |F | = pq − (p+ q − 1) = f. Based on Theorem 1, the adjacency of every vertex in PG(Zpqr) is as follows: N. Hidayat et al / Eur. J. Pure Appl. Math, 17 (3) (2024), 1659-1673 1667 (i) Every vertex in O is adjacent to every vertex in A,B,C,D,E, F, and U . (ii) Every vertex in A is adjacent to every vertex in O,B, C, and D. (iii) Every vertex in B is adjacent to every vertex in O,A, C, and E. (iv) Every vertex in C is adjacent to every vertex in O,A, B, and F . (v) Every vertex in D is adjacent to every vertex in O and A. (vi) Every vertex in E is adjacent to every vertex in O and B. (vii) Every vertex in F is adjacent to every vertex in O and C. (viii) Every vertex in U is only adjacent to every vertex in O. The distance matrix D(PG(Zpqr)) can then be written as  O A B C D E F U O 0 11×a 11×b 11×c 11×d 11×e 11×f 11×u A 1a×1 2(Ja − Ia) 1a×b 1a×c 1a×d 2a×e 2a×f 2a×u B 1b×1 1b×a 2(Jb − Ib) 1b×c 2b×d 1b×e 2b×f 2b×u C 1c×1 1c×a 1c×b 2(Jc − Ic) 2c×d 2c×e 1c×f 2c×u D 1d×1 1d×a 2d×b 2d×c 2(Jd − Id) 2d×e 2d×f 2d×u E 1e×1 2e×a 1e×b 2e×c 2e×d 2(Je − Ie) 2e×f 2e×u F 1f×1 2f×a 2f×b 1f×c 2f×d 2f×e 2(Jf − If ) 2f×u U 1u×1 2u×a 2u×b 2u×c 2u×d 2u×e 2u×f 2(Ju − Iu)  , where 1m×n is a matrix of order m × n with all entries 1, 2m×n is a matrix of order m × n with all entries 2, and Jn = 1n×n. A half of the sum of all entries in the matrix D(PG(Zpqr)) is W (PG(Zpqr)) = 1 2 (2p2q2r2 − 2pqr − 2(pqr − 1)− 2(p− 1)(qr − 1)− 2(q − 1)(pr − p)) − 2(r − 1)(pq − p− q + 1) =p2q2r2 − 5pqr + 2(pq + qr + pr)− (p+ q + r) + 1. Thus, we obtain W (PG(Zpqr)) = p2q2r2 − 5pqr + 2(pq + qr + pr)− (p+ q + r) + 1. Theorem 10. If p, q are two distinct prime numbers, then W (PG(Zp2q)) = 2p4q2 − 8p2q + 3p2 + 4pq − p 2 . N. Hidayat et al / Eur. J. Pure Appl. Math, 17 (3) (2024), 1659-1673 1668 Proof. For every two distinct prime numbers p and q, the ring Zp2q has u = p(p − 1)(q − 1) = p2q − pq − p2 + p units and pq + p2 − p − 1 nontrivial zero divisors. Next, we partition Zp2q into three sets, namely the zero set O = {0}, the unit set U = {x ∈ Zp2q|x is unit in ring Zp2q}, and the set of nontrivial zero divisors Zp2q are A = {pq, 2pq, . . . , (p− 1)pq} = ⟨pq⟩ \ {0}, |A| = p− 1, B = {p2, 2p2, . . . , (q − 1)p2} = ⟨p2⟩ \ {0}, |B| = q − 1, C = ⟨q⟩ \ ⟨pq⟩, |C| = (p2 − 1)− (p− 1) = p2 − p, D = ⟨p⟩ \ (⟨pq⟩ ∪ ⟨p2⟩), |D| = (pq − 1)− (p+ q − 2) = pq − p− q + 1 = d. Based on Theorem 1, the adjacency of every vertex in PG(Zp2q) is as follows: (i) Every vertex in O is adjacent to every vertex in A,B,C,D, and U . (ii) Every vertex in A is adjacent to every vertex in O,A, B, and D. (iii) Every vertex in B is adjacent to every vertex in O,A and C. (iv) Every vertex in C is adjacent to every vertex in O and B. (v) Every vertex in D is adjacent to every vertex in O and A. (vi) Every vertex in U is only adjacent to every vertex in O. The distance matrix D(PG(Zp2q)) can then be written as  0 A B C D U 0 0 11×(p−1) 11×(q−1) 11×(p2−p) 11×d 11×u A 1(p−1)×1 Jp−1 − Ip−1 1(p−1)×(q−1) 2(p−1)×(p2−p) 1(p−1)×d 2(p−1)×u B 1(q−1)×1 1(q−1)×(p−1) 2(Jq−1 − Iq−1) 1(q−1)×(p2−p) 2(q−1)×d 2(q−1)×u C 1(p2−p)×1 2(p2−p)×(p−1) 1(p2−p)×(q−1) 2(Jp2−p − Ip2−p) 2(p2−p)×d 2(p2−p)×u D 1d×1 1d×(p−1) 2d×(q−1) 2d×(p2−p) 2(Jd − Id) 2d×u U 1u×1 2u×(p−1) 2u×(q−1) 2u×(p2−p) 2u×d 2(Ju − Iu)  , where 1m×n is a matrix of order m × n with all entries 1, 2m×n is a matrix of order m × n with all entries 2, and Jn = 1n×n. A half of the sum of all entries in the matrix D(PG(Zp2q)) is W (PG(Zp2q)) = 1 2 (2p4q2 − 2p2q − 2(p2q − 1)− (p− 1)2 + (p− 1)− 2(p− 1)(pq − p) − 2(p2 − p)(q − 1)) = 2p4q2 − 8p2q + 3p2 + 4pq − p 2 . Thus, we obtain W (PG(Zp2q)) = 2p4q2 − 8p2q + 3p2 + 4pq − p 2 . N. Hidayat et al / Eur. J. Pure Appl. Math, 17 (3) (2024), 1659-1673 1669 Theorem 11. If p, q are two distinct prime numbers, then W (PG(Zp2q2)) = 2p4q4 − 11p2q2 + 6p2q + 6pq2 − 3pq 2 . Proof. For every two distinct prime numbers p and q, the ring Zp2q2 has u = p(p − 1)q(q − 1) = p2q2 − pq2 − p2q + pq units and pq2 + p2q − pq − 1 nontrivial zero divisors. The nontrivial zero divisor of Zp2q2 is Z = (⟨p⟩ ∪ ⟨q⟩) \ ⟨0⟩. Next, we partition we partition Zp2q2 into three sets, namely the zero set O = {0}, the unit set U = {x ∈ Zp2q2 |x is unit in ring Zp2q2}, and the set of nontrivial zero divisors Zp2q2 are A = ⟨pq2⟩ \ {0}, |A| = p− 1 = a, B = ⟨p2q⟩ \ {0}, |B| = q − 1 = b, C = ⟨q2⟩ \ ⟨pq2⟩, |C| = p2 − p = c, D = ⟨p2⟩ \ ⟨p2q⟩, |D| = q2 − q = d, E = ⟨pq⟩ \ (⟨pq2⟩ ∪ ⟨p2q⟩), |E| = pq − p− q + 1 = e, F = ⟨p⟩ \ (⟨pq⟩ ∪ ⟨p2⟩), |F | = pq2 − q2 − pq + q = f, G = ⟨q⟩ \ (⟨pq⟩ ∪ ⟨q2⟩), |G| = p2q − p2 − pq + p = g. Based on Theorem 1, the adjacency of every vertex in PG(Zp2q2) is as follows: (i) Every vertex in O is adjacent to every vertex in A,B,C,D,E, F,G, and U . (ii) Every vertex in A is adjacent to every vertex in O, A, B, D, E, and F . (iii) Every vertex in B is adjacent to every vertex in O, A, B, C, E, and G. (iv) Every vertex in C is adjacent to every vertex in O, B and D. (v) Every vertex in D is adjacent to every vertex in O, A and C. (vi) Every vertex in E is adjacent to every vertex in O, A, B, and E. (vii) Every vertex in F is adjacent to every vertex in O and A. (viii) Every vertex in G is adjacent to every vertex in O and B. (ix) Every vertex in U is only adjacent to every vertex in O. N. Hidayat et al / Eur. J. Pure Appl. Math, 17 (3) (2024), 1659-1673 1670 The distance matrix of D(PG(Zp2q2)) can then be written as  0 A B C D E F G U 0 0 11×a 11×b 11×c 11×d 11×e 11×f 11×g 11×u A 1a×1 Ja − Ia 1a×b 2a×c 1a×d 1a×e 1a×f 2a×g 2a×u B 1b×1 1b×a Jb − Ib 1b×c 2b×d 1b×e 2b×f 1b×g 2b×u C 1c×1 2c×a 1c×b 2(Jc − Ic) 1c×d 2c×e 2c×f 2c×g 2c×u D 1d×1 1d×a 2d×b 1d×c 2(Jd − Id) 2d×e 2d×f 2d×g 2d×u E 1e×1 1e×a 1e×b 2e×c 2e×d Je − Ie 2e×f 2e×g 2e×u F 1f×1 1f×a 2f×b 2f×c 2f×d 2f×e 2(Jf − If ) 2f×g 2f×u G 1g×1 2g×a 1g×b 2g×c 2g×d 2g×e 2g×f 2(Jg − Ig) 2g×u U 1u×1 2u×a 2u×b 2u×c 2u×d 2u×e 2u×f 2u×g 2(Ju − Iu)  , where 1m×n is a matrix of order m × n with all entries 1, 2m×n is a matrix of order m × n with all entries 2, and Jn = 1n×n. A half of the sum of all entries in the matrix D(PG(Zp2q2)) is W (PG(Zp2q2)) = 1 2 (2p4q4 − 2p2q2 − 2(p2q2 − 1)− (p− 1)2 + (p− 1)− 2(p− 1)(pq2 − p) − (q − 1)2 + (q − 1)− 2(q − 1)(p2q − p− q + 1) − 2(p2 − p)(q2 − q)− (pq − p− q + 1)2 + (pq − p− q + 1)) = 2p4q4 − 11p2q2 + 6p2q + 6pq2 − 3pq 2 . Thus, we obtain W (PG(Zp2q2)) = 2p4q4 − 11p2q2 + 6p2q + 6pq2 − 3pq 2 . 4. Conclusion Based on the results and discussion above, we obtain the Wiener index formulas for prime graphs of the ring Zn where n = p, p2, p3, pq, p2q, p2q2, pqr for distinct prime numbers p, q, and r. The distance matrix is formed by partitioning the ring Zn into a zero set, a nontrivial zero divisor set, and a unit set. Next, the adjacency between the vertices of each set is determined, so that the distance between the vertices of Zn is obtained. Based on these results, for the next reseraches, we give some of the following open problems: (i) W (PG(Zpk)), with prime number p and natural number k > 3. (ii) W (PG(Zpkq)), with distinct prime numbers p, q and natural number k > 2. (iii) W (PG(Zpkqh)), with distinct prime numbers p, q and natural numbers k, h > 2. (iv) W (PG(Zp1p2...pn)), with distinct prime numbers p1, . . . , pn. REFERENCES 1671 Acknowledgements This research was funded by a ”Lector-Head Doctoral Grant” from Faculty of Mathe- matics and Natural Sciences University of Brawijaya with Contract Agreement Letter No: 4160.7/UN10.F09/PN/2023. References [1] M H Aftab, A Akgül, M B Riaz, M Hussain, K Jebreen, and H Kanj. Measuring the energy for the molecular graphs of antiviral agents: Hydroxychloroquine, chloroquine and remdesivir. South African Journal of Chemical Engineering, 47:333–337, 2024. [2] M H Aftab, I Siddique, J K K Asamoah, H A E W Khalifa, and M Hussain. Mul- tiplicative attributes derived from graph invariants for saztec4 diamond. Hindawi Journal of Mathematics, 2022:1–7, 2022. [3] M R Ahmadi and R Nezhad. Energy and wiener index of zero-divisor graphs. Iran. J. Math. Chem., 2(1):45–51, 2011. [4] S Akbari and A Mohammadian. On zero-divisor graphs of finite rings. Journal of Algebra, 314:168–184, 2007. [5] D F Anderson, M C Axtell, and J A Stickles. Zero-divisor graphs in commutative rings. Commutative algebra: Noetherian and non-Noetherian perspectives, pages 23– 46, 2011. [6] D F Anderson and A Badawi. The total graph of a commutative ring. Journal of Algebra, 320:2706–2719, 2008. [7] N Ashrafi, H R Maimani, M R Pournaki, and S Yassemi. Unit graphs associated with rings. Communications in Algebra, 38(8):2851–2871, 2010. [8] T Asir and V Rabikka. The wiener index of the zero-divisor graph of Zn. Discrete Appl. Math., 319:461–471, 2022. [9] T Asir, V Rabikka, M Anto, and N Shunmugapriya. Wiener index of graphs over rings: a survey. AKCE International Journal Of Graphs and Combinatorics, 19(3):316–324, 2022. [10] T Asir, V Rabikka, and H Su. On wiener index of unit graph associated with a commutative ring. Algebra Colloq., 29(2):221–230, 2022. [11] I Beck. Coloring of commutative rings. Journal of algebra, 116(1):208–226, 1988. [12] S Bhavanari, S Kuncham, and N Dasari. Prime graph of a ring. Journal of Combi- natorics, Information & System Sciences, 35(1-2):27–42, 2010. REFERENCES 1672 [13] S Brezovnik, N Tratnik, and P Z Pletersek. Weighted wiener indices of molecular graphs with application to alkenes and alkadienes. Mathematics, 9(153):2–16, 2021. [14] G Chartrand, L Lesniak, and P Zhang. Graphs and Digraphs. CRC Press, 2016. [15] S Derrible and C Kennedy. Applications of graph theory and network science to transit network design. Transp Rev, 31(4):495–519, 2011. [16] J A Gallian. Contemporary Abstract Algebra. Chapman Hall/CRC, 2021. [17] H Hosoya. Topological index: a newly proposed quantity characterizing the topolog- ical nature of structural isomers of saturated hydrocarbons. BCSJ, 19(3):2332–2339, 1971. [18] S S Joshi and K F Pawar. Energy, wiener index and line graph of prime graph of a ring. International J. Math. Combin, 3:74–80, 2018. [19] S S Joshi and K F Pawar. On prime graph PG2(R) of a ring. International Journal of Mathematical Combinatorics, 30:11–22, 2019. [20] S S Joshi and K F Pawar. Coloring of prime graph PG1(r) and PG2(r) of a ring. Palestine Journal of Mathematics, 9(1):97–104, 2020. [21] H Kanj, H Iqbal, M H Aftab, H Raza, K Jebreen, and M I Sowaity. Topologi- cal characterization of hexagonal network and non-kekulean benzenoid hydrocarbon. European Journal of Pure and Applied Mathematics, 16(4):2187–2197, 2023. [22] A Kumar and V Kumar. Application of graph labeling in crystallography. Mater Today Proc, 2020. [23] R Likaj, A Shala, MMehmetaj, P Hyseni, and X Bajrami. Application of graph theory to find optimal paths for the transportation problem. IFAC Proceedings Volumes, 46(8):235–240, 2013. [24] B Molnar and A Benczur. The application of directed hyper-graphs for analysis of models of information systems. Mathematics, 10(5):759–769, 2022. [25] M P Nayaki and E Simon-raj. The physical chemical characteristics of alkanes and wiener indices. Journal of Algebraic Statistics, 13(2):3338–3345, 22. [26] K Patra and S Kalita. Prime graph of the commutative ring Zn. MATEMATIKA: Malaysian Journal of Industrial and Applied Mathematics, 30(1):59–67, 2014. [27] K F Pawar and S S Joshi. The prime graph PG1(R) of a ring. Palestine Journal of Mathematics, 6(1):153–158, 2017. [28] S Pirzada, M Aijaz, and M I Bhat. On zero-divisor graphs of the rings Zn. Afr. Math., 31:727–737, 2020. REFERENCES 1673 [29] N L Prasanna, K Sravanthi, and N Sudhakar. Applications of graph labeling in communication networks. Oriental Journal of Computer Science and Technology, 7(1):139–145, 2014. [30] A Prathik, K Uma, and J Anuradha. An overview of application of graph theory. International Journal of ChemTech Research, 9(2):242–248, 2019. [31] G Raeisi and M Gholami. Edge coloring of graphs with applications in coding theory. China Communications, 18(1):181–195, 2021. [32] H S Ramane, D S Revankar, and A B Ganagi. On the wiener index of a graph. Journal of the Indonesian Mathematical Society, 18(1):57–66, 2012. [33] B S Reddy, R Jain, and N Laxmikanth. Eigenvalues and wiener index of the zero divisor graph γ(Zn). arXiv:1707.05083, 2017. [34] K Selvakumar, P Gangaeswari, and G Arunkumar. The wiener index of the zero- divisor graph of a finite commutative ring with unity. Discrete Applied Mathematics, 311:72–84, 2022. [35] D Sensarma and S S Sarma. Application of graphs in security. International Journal of Innovative Technology and Exploring Engineering, 8(10):2273–2279, 2019. [36] P Singh and V K Bhat. Adjacency matrix and wiener index of zero divisor graph γ(Zn). Journal of Applied Mathematics and Computing, 66:717–732, 2021. [37] M J Subhakar. Associate ring graphs. Mapana Journal of Sciences, 9(1):31–40, 2010. [38] S Suthar and O Prakash. Energy and wiener index of total graph over ring Zn. Electric Notes in Discrite Mathematics, 63:485–495, 2017. [39] M S Vinutha and P Arathi. Applications of graph coloring and labeling in com- puter science. International Journal on Future Revolution in Computer Science and Communication Engineering, 3(8):14–16, 2017. [40] H Wiener. Structural determination of paraffin boiling points. Contributions from Departement of Chemistry, 69:17–20, 1947.