# The Wiener index and the Wiener Complexity of the zero-divisor graph of a
ring

David Dolžana,

###### Abstract

We calculate the Wiener index of the zero-divisor graph of a finite semisimple
ring. We also calculate the Wiener complexity of the zero-divisor graph of a
finite simple ring and find an upper bound for the Wiener complexity in the
semisimple case.

##  1 Introduction

The Wiener index of a graph, introduced by Wiener in [33], turns out to be
among the most important of the graph indices. It is defined as
$W(\Gamma)=\frac{1}{2}\sum_{u,v\in V(\Gamma)}d(u,v)$. Wiener discovered that
the boiling points of alkanes and the sum of the distances between any pair of
vertices in its molecular structure graph have a close connection. Later, a
strong correlation between the Wiener index and the chemical properties of a
compound was found - for example, critical points in general (see [31]), the
density, the surface tension, and viscosity of compounds liquid phase (see
[15]) and the van der Waals surface area of the molecule (see [21]). Nowadays,
this index is used for the preliminary screening of drug molecules [1]. See
also [17] and the extensive list of references therein, as well as [22] for
the many applications of the Wiener index in chemistry.

A related notion to the Wiener index is the Wiener complexity of a graph which
was defined in [3, 4]. It denotes the number of different transmissions of
vertices in a graph and its importance stems from location theory where
vertices with extremal transmission are studied, since they are target
locations for facilities (see [10, 24, 30]).

In this paper, we study the Wiener index and the Wiener complexity of certain
graphs that arise from algebraic structures. Namely, our setting is the
(undirected) zero-divisor graph of a finite (possibly non-commutative) ring.
Zero-divisor graphs of various algebraic structures have proved to be very
useful in revealing the algebraic properties through the graph-theoretical
properties of the prescribed graphs. It all began in 1988, when Beck [11]
introduced the notion of the zero-divisor graph of a commutative ring. Later,
Anderson and Livingston [6] slightly adjusted the definition of the zero-
divisor graph in order to be able to investigate the zero-divisor structure of
commutative rings. The definition was later extended to study the non-
commutative rings in [2] and [27]. Different authors then further extended
this concept to semigroups [16], nearrings [13] and semirings [19]. Recently,
Wiener indices of some graphs arising from algebraical structures have been
studied (see [5] and [8] for a survey of the recent results). For example, the
Wiener index of the zero-divisor graph of a finite commutative ring was
studied in [28], while in [7, 29] it was studied in the special case of the
ring of integers modulo $n$. Furthermore, the Wiener index of the total graph
of the ring of integers modulo $n$ was studied in [32] and the Wiener index of
the unit graph was studied in [9]. The Wiener index of a compressed zero-
divisor graph was also studied in [26].

This paper is structured as follows. In the next section, we gather the
definitions and notations that we use throughout the paper. In Section 3, we
calculate the Wiener index and the Wiener complexity of a zero-divisor graph
of a simple finite ring (see Theorem 1 and Theorem 2). In the final section,
we use these results to study the zero-divisor graphs of semisimple finite
rings. We calculate the Wiener index (see Theorem 3) and find an upper bound
for the Wiener complexity (see Theorem 4).

##  2 Definitions and preliminaries

For a finite ring $R$, we denote by $R^{*}$ the group of units in $R$ and by
$Z(R)$ the set of zero-divisors in $R$, $Z(R)=\\{x\in R;$ there exists $0\neq
y\in R\text{ such that }xy=0\text{ or }yx=0\\}$. We denote by $\Gamma(R)$ the
(undirected) _zero-divisor graph_ of $R$, following the definition in [2]: the
vertex set $V(\Gamma(R))$ of $\Gamma(R)$ is the set of elements in
$Z(R)\setminus\\{0\\}$ and an unordered pair of vertices $x,y\in
V(\Gamma(R))$, $x\neq y$, is an edge $x-y$ in $\Gamma(R)$ if $xy=0$ or $yx=0$.
The sequence of edges $x_{0}-x_{1}$, $x_{1}-x_{2}$, …, $x_{k-1}-x_{k}$ in a
graph is called _a path of length $k$_. The _distance_ between vertices $x$
and $y$ is the length of the shortest path between them, denoted by $d(x,y)$.
The _diameter_ $\mathrm{diam}(\Gamma)$ is the longest distance between any two
vertices of the graph $\Gamma$. The _transmission_ of a vertex $u\in
V(\Gamma)$ is defined by $\mathrm{Tr}(u)=\sum_{v\in V(\Gamma)}d(u,v)$. The
_Wiener index_ of $\Gamma$ is defined as $W(\Gamma)=\frac{1}{2}\sum_{u,v\in
V(\Gamma)}d(u,v)=\frac{1}{2}\sum_{u\in V(\Gamma)}\mathrm{Tr}(u)$. Finally, the
_Wiener complexity_ of $\Gamma$ is defined as the number of all different
transmissions of vertices in $V(\Gamma)$ and it is denoted by $C_{W}(\Gamma)$.

For a commutative ring $R$, we denote by $M_{n}(R)$ the ring of all $n$-by-$n$
matrices with entries in $R$. We shall denote by $E_{ij}\in M_{n}(R)$ the
matrix with $1$ at entry $(i,j)$ and zeros elsewhere. For a matrix $A\in
M_{n}(R)$, we shall denote by $A_{ij}\in R$ the $(i,j)$-th entry of $A$ and we
shall denote the rank of matrix $A$ by $\mathrm{rk}(A)$.

For a finite ring $R$ and $x\in Z(R)$, we denote the degree of $x$ in
$\Gamma(R)$ by $\mathcal{D}(x)=|\\{y\in R\setminus\\{0,x\\};yx=0\text{ or
}xy=0\\}|$. We sometimes also denote $\mathcal{D}(x)=0$ for $x\in R$ that is
not a zero divisor. Furthermore, we shall denote the annihilator of $x$ in $R$
by $\mathrm{Ann}(x)=\\{y\in R;yx=0\text{ or }xy=0\\}$, as well as
$\mathrm{Ann}_{L}(x)=\\{y\in R;yx=0\\}$ and analogously,
$\mathrm{Ann}_{R}(x)=\\{y\in R;xy=0\\}$.

We shall limit ourselves to studying the zero-divisor graphs of finite rings
due to the following Lemma.

######  Lemma 1.

([20, 23]) If $R$ is a ring with $m$ zero divisors, $2\leq m<\infty$, then $R$
is a finite ring with $|R|\leq m^{2}$.

##  3 Simple rings

In this section, we shall study the Wiener index and the Wiener complexity of
a simple finite ring. We shall need the following lemmas.

######  Lemma 2.

([12, Corollary 4.1.]) Let $F$ be a field and $n\geq 2$. Then
$\mathrm{diam}(\Gamma(M_{n}(F)))=2$.

######  Lemma 3.

([25, p. 6]) Let $F$ be a finite field of cardinality $q$ and $n\geq 2$. For
every $k\in\\{0,1,\ldots,n\\}$ there are exactly
$\prod_{j=0}^{k-1}{\frac{(q^{n}-q^{j})^{2}}{q^{k}-q^{j}}}$ matrices in
$M_{n}(F)$ of rank $k$.

This immediately yields the following.

######  Lemma 4.

Let $F$ be a finite field of cardinality $q$ and $n\geq 2$. Then
$|V(\Gamma(M_{n}(F)))|=|Z(M_{n}(F))|-1=q^{n^{2}}-q^{n\choose
2}\prod_{j=1}^{n}(q^{j}-1)-1$.

###### Proof.

By Lemma 3, there are exactly $\prod_{j=0}^{n-1}{(q^{n}-q^{j})}=q^{n\choose
2}\prod_{j=0}^{n-1}(q^{n-j}-1)=q^{n\choose 2}\prod_{j=1}^{n}(q^{j}-1)$
invertible matrices in $M_{n}(F)$. Since all nonzero noninvertible matrices
are in $V(\Gamma(M_{n}(F)))$, we immediately get the desired equation,
$|V(\Gamma(M_{n}(F)))|=q^{n^{2}}-q^{n\choose 2}\prod_{j=1}^{n}(q^{j}-1)-1$. ∎

The following lemma can be deduced from [2].

######  Lemma 5.

Let $F$ be a finite field of cardinality $q$ and $n\geq 2$. Suppose $A\in
M_{n}(F)$ is a matrix of rank $k$ for some $k\in\\{1,2,\ldots,n\\}$. Then
$|\mathrm{Ann}(A)|=2q^{n(n-k)}-q^{(n-k)^{2}}$ and
$\mathcal{D}(A)=2q^{n(n-k)}-q^{(n-k)^{2}}-\epsilon$, where $\epsilon=1$ if
$A^{2}\neq 0$ and $\epsilon=2$ otherwise.

###### Proof.

The statement follows directly from [2, Lemma 14]. ∎

Next, we shall need to find the number of square zero matrices of a specified
rank.

######  Lemma 6.

Let $F$ be a finite field of cardinality $q$ and $n\geq 2$. Then $|\\{0\neq
A\in M_{n}(F);A\text{ is a matrix }\text{of rank }k\text{ with
}A^{2}=0\\}|=\frac{\prod_{j=0}^{2k-1}\left(q^{n}-q^{j}\right)}{q^{k^{2}}\prod_{j=0}^{k-1}\left(q^{k}-q^{j}\right)}$.

###### Proof.

If $A^{2}=0$ for some $A\in M_{n}(F)$ of rank $k$ then $\dim_{F}(A(F^{n}))=k$
and $\dim_{F}(A^{2}(F^{n}))=0$. We can now deduce from Remark 3.2 in [14] that
$|\\{0\neq A\in M_{n}(F);A\text{ is a matrix of rank }k\text{ with
}A^{2}=0\\}|={n\choose k}_{q}\prod_{j=1}^{k}{\left(q^{n-k}-q^{j-1}\right)}$,
where${n\choose k}_{q}$ denotes the number of $k$-dimensional subspaces in
$F^{n}$. To find the number of subspaces of dimension $k$, we have to count
the number of ways one can choose $k$ independent vectors in $F^{n}$. The
first vector can be chosen in $q^{n}-1$ ways, the second vector can be chosen
in $q^{n}-q$ ways, and so on. However, some of these pickings generate the
same vector space, so to arrive at the number of distinct vector spaces, we
have to divide this by the number of different bases for a $k$ dimensional
vector space, which we proceed to calculate by the same procedure as above.
Therefore, $|\\{0\neq A\in M_{n}(F);A\text{ is a matrix of rank }k\text{ with
}A^{2}=0\\}|=\frac{\left(q^{n}-1\right)\left(q^{n}-q\right)\ldots\left(q^{n}-q^{k-1}\right)}{\left(q^{k}-1\right)\left(q^{k}-q\right)\ldots\left(q^{k}-q^{k-1}\right)}\prod_{j=1}^{k}{\left(q^{n-k}-q^{j-1}\right)}=\frac{\prod_{j=0}^{2k-1}\left(q^{n}-q^{j}\right)}{q^{k^{2}}\prod_{j=0}^{k-1}\left(q^{k}-q^{j}\right)}$.
∎

Now, we have everything ready to prove the first theorem of this section.

######  Theorem 1.

Let $F$ be a finite field of cardinality $q$ and $n\geq 2$. Then

$W(\Gamma(M_{n}(F)))=\\\
|Z(M_{n}(F))|^{2}-\frac{5}{2}|Z(M_{n}(F))|+\frac{3}{2}+\\\
\frac{1}{2}\sum_{k=1}^{n-1}\left(\prod_{j=0}^{k-1}{\frac{q^{n}-q^{j}}{q^{k}-q^{j}}}\left(\prod_{j=0}^{k-1}\left(q^{n-k}-q^{j}\right)-(2q^{n(n-k)}-q^{(n-k)^{2}})\prod_{j=0}^{k-1}(q^{n}-q^{j})\right)\right),$

where $|Z(M_{n}(F))|=q^{n^{2}}-q^{n\choose 2}\prod_{j=1}^{n}(q^{j}-1)$.

###### Proof.

For $i=1,2$ denote $D_{i}=|\\{(a,b);a,b\in V(\Gamma(M_{n}(F)))\text{ such that
}d(a,b)=i\\}|$. We know by Lemma 2 that for every pair of (distinct) vertices
$A,B\in V(\Gamma(M_{n}(F)))$, we either have $d(A,B)=1$ or $d(A,B)=2$, so
$D_{1}+D_{2}=|V(\Gamma(M_{n}(F)))|(|V(\Gamma(M_{n}(F)))|-1)=(|Z(M_{n}(F))|-1)(|Z(M_{n}(F))|-2)$.
Therefore
$W(\Gamma(M_{n}(F)))=\frac{1}{2}(D_{1}+2D_{2})=\frac{1}{2}(D_{1}+2((|Z(M_{n}(F))|-1)(|Z(M_{n}(F))|-2)-D_{1}))=(|Z(M_{n}(F))|-1)(|Z(M_{n}(F))|-2)-\frac{1}{2}D_{1}$.
By using Lemmas 3, 4, 5 and 6, we arrive at

$W(\Gamma(M_{n}(F)))=(|Z(M_{n}(F))|-1)(|Z(M_{n}(F))|-2)-\\\
\frac{1}{2}\sum_{k=1}^{n-1}\prod_{j=0}^{k-1}{\frac{(q^{n}-q^{j})^{2}}{q^{k}-q^{j}}}(2q^{n(n-k)}-q^{(n-k)^{2}})+\\\
\frac{1}{2}(|Z(M_{n}(F))|-1)+\frac{1}{2}\sum_{k=1}^{n-1}\frac{\prod_{j=0}^{2k-1}\left(q^{n}-q^{j}\right)}{q^{k^{2}}\prod_{j=0}^{k-1}\left(q^{k}-q^{j}\right)}=\\\
|Z(M_{n}(F))|^{2}-\frac{5}{2}|Z(M_{n}(F))|+\frac{3}{2}+\\\
\frac{1}{2}\sum_{k=1}^{n-1}\left(\prod_{j=0}^{k-1}{\frac{q^{n}-q^{j}}{q^{k}-q^{j}}}\left(\prod_{j=0}^{k-1}\left(q^{n-k}-q^{j}\right)-(2q^{n(n-k)}-q^{(n-k)^{2}})\prod_{j=0}^{k-1}(q^{n}-q^{j})\right)\right)=\\\
|Z(M_{n}(F))|^{2}-\frac{5}{2}|Z(M_{n}(F))|+\frac{3}{2}+\\\
\frac{1}{2}\sum_{k=1}^{n-1}\left(\prod_{j=0}^{k-1}{\frac{q^{n}-q^{j}}{q^{k}-q^{j}}}\left(\prod_{j=0}^{k-1}\left(q^{n-k}-q^{j}\right)-(2q^{n(n-k)}-q^{(n-k)^{2}})\prod_{j=0}^{k-1}(q^{n}-q^{j})\right)\right).$

Finally, by Lemma 4, we have $|Z(M_{n}(F))|=q^{n^{2}}-q^{n\choose
2}\prod_{j=1}^{n}(q^{j}-1)$. ∎

Not unexpectedly, the formula for the Wiener index is quite a convoluted one.
To illustrate Theorem 1, let us examine the simpler case $n=2$ separately,
where the formula is of course significantly more simple.

######  Example 1.

Direct application of Theorem 1 and some calculations that we shall omit here,
immediately yield that
$W(\Gamma(M_{2}(F)))=|F|^{6}+|F|^{5}-\frac{3}{2}|F|^{4}-3|F|^{3}-\frac{1}{2}|F|^{2}+2|F|+1$.
In particular for example, $W(\Gamma(M_{2}(\mathbb{Z}_{2})))=51$.

As a final result in this section, we can completely determine the Wiener
complexity of a zero divisor graph of a simple finite ring. It turns out that
the Wiener complexity is dependent only on the size of matrices and not on the
size of the underlying field. Specifically, we get the following theorem.

######  Theorem 2.

Let $F$ be a finite field and $n\geq 2$. Then

$C_{W}(\Gamma(M_{n}(F)))=2(n-1).$

###### Proof.

Choose $0\neq A\in Z(M_{n}(F))$. Then by Lemma 2, we have
$\mathrm{Tr}(A)=\mathcal{D}(A)+2(|V(\Gamma(M_{n}(F)))|-1-\mathcal{D}(A))=2(|Z(M_{n}(F))|-2)-\mathcal{D}(A)$.
This implies that for $0\neq A,B\in Z(M_{n}(F))$ we have
$\mathrm{Tr}(A)=\mathrm{Tr}(B)$ if and only if
$\mathcal{D}(A)=\mathcal{D}(B)$.

Obviously, Lemma 5 implies that if $\mathrm{rk}(A)=\mathrm{rk}(B)$ then
$\mathcal{D}(A)=\mathcal{D}(B)$ if and only if either $A^{2}=B^{2}=0$ or
$A^{2},B^{2}\neq 0$.

On the other hand, suppose that $\mathrm{rk}(A)\neq\mathrm{rk}(B)$. Denote
$k=\mathrm{rk}(A)$, $l=\mathrm{rk}(B)$ and $q=|F|$ and observe that by Lemma
5, $\mathcal{D}(A)=2q^{n(n-k)}-q^{(n-k)^{2}}-\epsilon$ and
$\mathcal{D}(B)=2q^{n(n-l)}-q^{(n-l)^{2}}-\varphi$ for some
$\epsilon,\varphi\in\\{1,2\\}$. Therefore
$2q^{n(n-k)}-2q^{n(n-l)}+q^{(n-k)^{2}}-q^{(n-l)^{2}}=\epsilon-\varphi\in\\{-1,0,1\\}$.
Since $1\leq k,l\leq n-1$, the left hand of the equation is divisible by $q$,
therefore $\epsilon-\varphi=0$. Since $k\mapsto 2q^{n(n-k)}-q^{(n-k)^{2}}$ is
a strictly decreasing function, we can conclude that
$\mathcal{D}(A)\neq\mathcal{D}(B)$.

Since for any $k$ from $1$ to $n-1$, we can find a matrix in $M_{n}(F)$ that
is square-zero as well as one that is not, we see that there are exactly
$2(n-1)$ different transmissions in the zero-divisor graph. Thus, we have
proved that $C_{W}(\Gamma(M_{n}(F)))=2(n-1)$. ∎

##  4 Semisimple rings

In this section, we examine the Wiener index and the Wiener complexity of a
zero divisor graph of a semisimple finite ring. Of course, the Wedderburn-
Artin theorem implies that every finite semisimple ring is isomorphic to a
direct product of matrix rings over some fields. Let us firstly prove the
following lemma.

######  Lemma 7.

Let $l\in\mathbb{N}$ and $R=R_{1}\times R_{2}\times\ldots\times R_{l}$ be a
direct product of finite rings. Then $Z(R)=R\setminus R_{1}^{*}\times
R_{2}^{*}\times\ldots\times R_{l}^{*}$ and $\mathrm{diam}(\Gamma(R))\leq 3$.
Furthermore, for any
$a=(a_{1},a_{2},\ldots,a_{l}),b=(b_{1},b_{2},\ldots,b_{l})\in\Gamma(R)$ we
have $d(a,b)=3$ if and only if for every $i\in\\{1,2,\ldots,l\\}$ we have
either $a_{i}\in R_{i}^{*}$ or $b_{i}\in R_{i}^{*}$ and there exists
$j\in\\{1,2,\ldots,l\\}$ such that $a_{j}\neq 0$ and $b_{j}\neq 0$.

###### Proof.

It is well known that in a finite ring every element is either invertible or a
zero-divisor. The first statement then follows from the fact that an element
$(x_{1},x_{2},\ldots,x_{l})\in R_{1}\times R_{2}\times\ldots\times R_{l}$ is
invertible if and only if $x_{i}\in R_{i}$ is invertible for every
$i=1,2,\ldots,l$, while the fact that $\mathrm{diam}(\Gamma(R))\leq 3$ follows
from [18, Theorem 3.1].

Now, choose arbitrary $a=(a_{1},a_{2},\ldots,a_{l})$ and
$b=(b_{1},b_{2},\ldots,b_{l})$ in $Z(R)$. By the above paragraph, there exists
$i\in\\{1,2,\ldots,l\\}$ such that $a_{i}\in Z(R_{i})$. If $b_{i}\in Z(R_{i})$
then there exists a path $a_{i}-x_{i}-b_{i}$ of distance at most 2 in
$\Gamma(R_{i})$ by Lemma 2, so we have a path
$a-(0,0,\ldots,0,x_{i},0,\ldots,0)-b$ in $\Gamma(R)$, thus $d(a,b)\leq 2$.

Therefore, we can now suppose that for every $i\in\\{1,2,\ldots,l\\}$ we have
either $a_{i}\in R_{i}^{*}$ or $b_{i}\in R_{i}^{*}$. Obviously, in this case
we have $ab=ba=0$ if and only if $a_{j}=0$ or $b_{j}=0$ for every
$j\in\\{1,2,\ldots,l\\}$ and in this case $d(a,b)=1$. So, suppose now that
there exists $x=(x_{1},x_{2},\ldots,x_{l})\in Z(R)$ such that $a-x-b$ is a
path in $\Gamma(R)$. Since for every $i\in\\{1,2,\ldots,l\\}$ either $a_{i}$
or $b_{i}$ is not a zero-divisor, this implies $x_{i}=0$ for every
$i\in\\{1,2,\ldots,l\\}$, a contradiction. Therefore $d(a,b)=3$ in this case
if and only if there exists $j\in\\{1,2,\ldots,l\\}$ such that $a_{j}\neq 0$
and $b_{j}\neq 0$. ∎

This now gives us the necessary tools to calculate the number of vertices that
are at distance $3$ in the zero-divisor graph of a direct product of finite
rings.

######  Lemma 8.

Let $l\in\mathbb{N}$ and $R=R_{1}\times R_{2}\times\ldots\times R_{l}$ be a
direct product of finite rings. Then $|\\{(a,b);a,b\in V(\Gamma(R))\text{ such
that }d(a,b)=3\\}|=\left(T(R)-2^{l}+2\right)\prod_{i=1}^{l}{|R_{i}^{*}|}$,
where $T(R)=\sum_{\Lambda\subseteq\\{1,2,\ldots,l\\},|\Lambda|\geq
2}(2^{|\Lambda|}-2)\prod_{i=1}^{l}{k_{i}}$, where $k_{i}=|Z(R_{i})|$ if
$i\in\Lambda$ and $k_{i}=|R_{i}^{*}|$ otherwise.

###### Proof.

By Lemma 7, we know that for any elements
$a=(a_{1},a_{2},\ldots,a_{l}),b=(b_{1},b_{2},\ldots,b_{l})\in\Gamma(R)$ we
have $d(a,b)=3$ if and only if for every $i\in\\{1,2,\ldots,l\\}$ we have
either $a_{i}\in R_{i}^{*}$ or $b_{i}\in R_{i}^{*}$ and there exists
$j\in\\{1,2,\ldots,l\\}$ such that $a_{j}\neq 0$ and $b_{j}\neq 0$. Denote
$\Omega(\Gamma(R))=\\{(a,b);a,b\in V(\Gamma(R))\text{ and for every
}j\in\\{1,2,\ldots,l\\},\text{ we have }a_{j}\in R_{j}^{*}\text{ or }b_{j}\in
R_{j}^{*}\\}$. Since $a,b\in V(\Gamma(R))$, at least one of the components of
$a$ and $b$ has to be a zero-divisor. Denote
$\Lambda_{a}=\\{j\in\\{1,2,\ldots,l\\};a_{j}\text{ is a zero-divisor}\\}$ and
similarly $\Lambda_{b}=\\{j\in\\{1,2,\ldots,l\\};b_{j}\text{ is a zero-
divisor}\\}$. Observe that $\Lambda_{a},\Lambda_{b}\neq\emptyset$ and
$\Lambda_{a}\cap\Lambda_{b}=\emptyset$. It is well known that every element of
a finite ring is either a unit or a zero-divisor. This implies that $a_{j}\in
R_{j}^{*}$ for every $j\notin\Lambda_{a}$ and $b_{j}\in R_{j}^{*}$ for every
$j\notin\Lambda_{b}$. Therefore,
$|\Omega(\Gamma(R))|=\sum_{\emptyset\neq\Lambda_{a},\Lambda_{b}\subseteq\\{1,2,\ldots,l\\},\Lambda_{a}\cap\Lambda_{b}=\emptyset}\prod_{i=1}^{l}{k_{i}|R_{i}^{*}|}$,
where $k_{i}=|Z(R_{i})|$ if $i\in\Lambda_{a}\cup\Lambda_{b}$ and
$k_{i}=|R_{i}^{*}|$ otherwise. Denote $\Lambda=\Lambda_{a}\cup\Lambda_{b}$ and
observe that $|\Lambda|\geq 2$ and that every $\Lambda$ can be obtained from
$\Lambda_{a}$ and $\Lambda_{b}$ in $\sum_{t=1}^{|\Lambda|-1}{|\Lambda|\choose
t}=2^{|\Lambda|}-2$ ways. Thus,
$|\Omega(\Gamma(R))|=T(R)\prod_{i=1}^{l}{|R_{i}^{*}|}$, for
$T(R)=\sum_{\Lambda\subseteq\\{1,2,\ldots,l\\},|\Lambda|\geq
2}(2^{|\Lambda|}-2)\prod_{i=1}^{l}{k_{i}}$, where $k_{i}=|Z(R_{i})|$ if
$i\in\Lambda$ and $k_{i}=|R_{i}^{*}|$ otherwise. In order to find the number
of elements at distance $3$, we now have to subtract the number of all
elements from $|\Omega(\Gamma(R))|$ that are at distance $1$. So, choose
$a=(a_{1},a_{2},\ldots,a_{l}),b=(b_{1},b_{2},\ldots,b_{l})\in\Gamma(R)$ such
that $(a,b)\in\Omega(\Gamma(R))$ and that $d(a,b)=1$. Observe that this time
we have $\Lambda_{a},\Lambda_{b}\neq\emptyset$,
$\Lambda_{a}\cap\Lambda_{b}=\emptyset$ and
$\Lambda_{a}\cup\Lambda_{b}=\\{1,2,\ldots,l\\}$. By observing that the set
$\\{1,2,\ldots,l\\}$ can be obtained as a union of $\Lambda_{a}$ and
$\Lambda_{b}$ in $\sum_{t=1}^{l-1}{l\choose t}=2^{l}-2$ ways, we deduce that
the number of elements from $\Omega(\Gamma(R))$ that are at distance $1$ is
equal to $(2^{l}-2)\prod_{i=1}^{l}{|R_{i}^{*}|}$ and thus the result follows.
∎

Next, we shall need to calculate the sizes of left and right annihilators of
matrices in a simple finite ring.

######  Lemma 9.

Let $F$ be a finite field of cardinality $q$ and $n\geq 1$. Suppose $A\in
M_{n}(F)$ is a matrix of rank $k$ for some $k\in\\{0,1,\ldots,n\\}$. Then
$|\mathrm{Ann}_{L}(A)|=|\mathrm{Ann}_{R}(A)|=q^{n(n-k)}$ and furthermore
$|\mathrm{Ann}_{L}(A)\cap\mathrm{Ann}_{R}(A)|=q^{(n-k)^{2}}$.

###### Proof.

Since $A$ is a matrix of rank $k$, there exist invertible matrices
(corresponding to a suitable changes in bases) $P,Q\in M_{n}(F)$ such that
$PAQ=\left[\begin{matrix}I_{k}&0\\\ 0&0\end{matrix}\right]$, where $I_{k}$
denotes the identity matrix of size $k$. Note that any matrix with the first
$k$ rows equal to zero is in $\mathrm{Ann}_{L}(PAQ)$, so
$|\mathrm{Ann}_{L}(PAQ)|=q^{n(n-k)}$. Furthermore, for any matrix $B\in
M_{n}(F)$, we have $BA=0$ if and only if $(BP^{-1})(PAQ)=0$. Since the mapping
$B\mapsto BP^{-1}$ is a bijection on $M_{n}(F)$, we get
$|\mathrm{Ann}_{L}(A)|=q^{n(n-k)}$. The proof for $|\mathrm{Ann}_{R}(A)|$ is
symmetrical. Also, for any $C\in M_{n}(F)$, we have $CA=AC=0$ if and only if
$(Q^{-1}CP^{-1})(PAQ)=(PAQ)(Q^{-1}CP^{-1})=0$. Since the mapping $C\mapsto
Q^{-1}CP^{-1}$ is also a bijection on $M_{n}(F)$, we conclude that
$|\mathrm{Ann}_{L}(A)\cap\mathrm{Ann}_{R}(A)|=|\mathrm{Ann}_{L}(PAQ)\cap\mathrm{Ann}_{R}(PAQ)|=q^{(n-k)^{2}}$.
∎

Now, let us examine the degrees of matrices in $\Gamma(R)$ in the semisimple
case.

######  Lemma 10.

Let $n_{1},n_{2},\ldots,n_{l}\geq 1$ be integers, $F_{1},F_{2},\ldots,F_{l}$
finite fields of cardinalities $q_{1},q_{2},\ldots,q_{l}$ respectively, and
$R=M_{n_{1}}(F_{1})\times M_{n_{2}}(F_{2})\times\ldots\times
M_{n_{l}}(F_{l})$. Suppose $A=(A_{1},A_{2},\ldots,A_{l})\in R\setminus\\{0\\}$
where $A_{i}$ is of rank $k_{i}$ for every $i=1,2,\ldots,l$. Then
$\mathcal{D}(A)=\prod_{i=1}^{l}{q_{i}^{(n_{i}-k_{i})^{2}}}\left(2\prod_{i=1}^{l}{q_{i}^{k_{i}(n_{i}-k_{i})}}-1\right)-\epsilon$,
where $\epsilon=1$ if $A^{2}\neq 0$ and $\epsilon=2$ if $A^{2}=0$.

###### Proof.

If $A$ is not a zero-divisor, then $\mathcal{D}(A)=0$ by definition and note
that our formula yields $\mathcal{D}(A)=1-\epsilon$, where $\epsilon=1$, since
$A^{2}\neq 0$, therefore the statement holds in this case. Suppose therefore
that $A$ is a zero-divisor, so there exists $B=(B_{1},B_{2},\ldots,B_{l})\in
R$ such that $AB=0$ or $BA=0$. Then $A_{i}B_{i}=0$ for every
$i\in\\{1,2,\ldots,l\\}$ or $B_{i}A_{i}=0$ for every $i\in\\{1,2,\ldots,l\\}$.
Therefore by the principle of inclusion and exclusion,
$\mathcal{D}(A)=\prod_{i=1}^{l}{|\mathrm{Ann}_{L}(A_{i})|}+\prod_{i=1}^{l}{|\mathrm{Ann}_{R}(A_{i})|}-\prod_{i=1}^{l}{|\mathrm{Ann}_{L}(A_{i})\cap\mathrm{Ann}_{R}(A_{i})|}-\epsilon$,
where $\epsilon=1$ if $A^{2}\neq 0$ ($0$ is not a vertex in $\Gamma(R)$) and
$\epsilon=2$ if $A^{2}=0$ (there exists no edge between $A$ and $A$). Lemma 9
now yields

$\mathcal{D}(A)=2\prod_{i=1}^{l}{q_{i}^{n_{i}(n_{i}-k_{i})}}-\prod_{i=1}^{l}{q_{i}^{(n_{i}-k_{i})^{2}}}-\epsilon=\\\
\prod_{i=1}^{l}{q_{i}^{(n_{i}-k_{i})^{2}}}\left(2\prod_{i=1}^{l}{q_{i}^{k_{i}(n_{i}-k_{i})}}-1\right)-\epsilon.$

∎

Now, we have everything ready to calculate the Wiener index in the semisimple
case.

######  Theorem 3.

Let $n_{1},n_{2},\ldots,n_{l}\geq 1$ be integers, $F_{1},F_{2},\ldots,F_{l}$
finite fields of cardinalities $q_{1},q_{2},\ldots,q_{l}$ respectively, and
$R=M_{n_{1}}(F_{1})\times M_{n_{2}}(F_{2})\times\ldots\times
M_{n_{l}}(F_{l})$. Then

$W(\Gamma(R))=|Z(R)|^{2}-\frac{5}{2}|Z(R)|+\frac{3}{2}+\\\
\left(\frac{T(R)}{2}-2^{l-1}+1\right)\prod_{i=1}^{l}{q_{i}^{n_{i}\choose
2}\prod_{j_{i}=1}^{n_{i}}(q_{i}^{j_{i}}-1)}-\\\
\frac{1}{2}\sum_{k_{1},\ldots,k_{l}=0}^{n_{1},\ldots,n_{l}}\left[\prod_{i=1}^{l}\left(\prod_{j_{i}=0}^{k_{i}-1}{\frac{(q_{i}^{n_{i}}-q_{i}^{j_{i}})^{2}}{q_{i}^{k_{i}}-q_{i}^{j_{i}}}}\right){\prod_{i=1}^{l}q_{i}^{(n_{i}-k_{i})^{2}}}\left(2\prod_{i=1}^{l}{q_{i}^{k_{i}(n_{i}-k_{i})}}-1\right)\right]\\\
+\frac{1}{2}\prod_{i=1}^{l}{q_{i}^{n_{i}^{2}}}+\frac{1}{2}\prod_{i=1}^{l}\prod_{j_{i}=0}^{n_{i}-1}{(q_{i}^{n_{i}}-q_{i}^{j_{i}})}+\frac{1}{2}|N_{2}(R)|,$

where the following equations hold:
$|Z(R)|=\prod_{i=1}^{l}q_{i}^{n_{i}^{2}}-\prod_{i=1}^{l}q_{i}^{n_{i}\choose
2}\prod_{j_{i}=1}^{n_{i}}(q_{i}^{j_{i}}-1)$,
$|N_{2}(R)|=\sum_{k_{1}=0}^{n_{1}-1}\sum_{k_{2}=0}^{n_{2}-1}\ldots\sum_{k_{l}=0}^{n_{l}-1}\prod_{i=1}^{l}\left(\frac{\prod_{j_{i}=0}^{2k_{i}-1}\left(q_{i}^{n_{i}}-q_{i}^{j_{i}}\right)}{q_{i}^{k_{i}^{2}}\prod_{j_{i}=0}^{k_{i}-1}\left(q_{i}^{k_{i}}-q_{i}^{j_{i}}\right)}\right)-1$
and
$T(R)=\sum_{\Lambda\subseteq\\{1,2,\ldots,l\\},|\Lambda|\geq
2}(2^{|\Lambda|}-2)\prod_{i=1}^{l}{\omega_{i}}$, where we have
$\omega_{i}=q_{i}^{n_{i}^{2}}-q_{i}^{n_{i}\choose
2}\prod_{j_{i}=1}^{n_{i}}(q_{i}^{j_{i}}-1)$ if $i\in\Lambda$ and
$\omega_{i}=q_{i}^{n_{i}\choose 2}\prod_{j_{i}=1}^{n_{i}}(q_{i}^{j_{i}}-1)$
otherwise.

###### Proof.

For $i=1,2,3$ denote $D_{i}=|\\{(a,b);a,b\in V(\Gamma(R))\text{ such that
}d(a,b)=i\\}|$ and observe that by Lemma 7, for every pair of (distinct)
vertices $A,B\in V(\Gamma(R))$, we either have $d(A,B)=1$, $d(A,B)=2$ or
$d(A,B)=3$, so $D_{1}+D_{2}+D_{3}=|V(\Gamma(R))|(|V(\Gamma(R))|-1)$. Therefore
$W(\Gamma(R))=\frac{1}{2}(D_{1}+2D_{2}+3D_{3})=\frac{1}{2}(D_{1}+3D_{3}+2(|V(\Gamma(R))|(|V(\Gamma(R))|-1)-D_{1}-D_{3}))=|Z(R)|^{2}-3|Z(R)|+2+\frac{1}{2}(D_{3}-D_{1})$.

Furthermore, we apply Lemma 8, and get

$D_{3}=\left(T(R)-2^{l}+2\right)\prod_{i=1}^{l}{|R_{i}^{*}|}=\left(T(R)-2^{l}+2\right)\prod_{i=1}^{l}{q_{i}^{n_{i}\choose
2}\prod_{j_{i}=1}^{n_{i}}(q_{i}^{j_{i}}-1)},$

where $T(R)=\sum_{\Lambda\subseteq\\{1,2,\ldots,l\\},|\Lambda|\geq
2}(2^{|\Lambda|}-2)\prod_{i=1}^{l}{\omega_{i}}$ and furthermore
$\omega_{i}=q_{i}^{n_{i}^{2}}-q_{i}^{n_{i}\choose
2}\prod_{j_{i}=1}^{n_{i}}(q_{i}^{j_{i}}-1)$ if $i\in\Lambda$ and
$\omega_{i}=q_{i}^{n_{i}\choose 2}\prod_{j_{i}=1}^{n_{i}}(q_{i}^{j_{i}}-1)$
otherwise. On the other hand, $D_{1}=\sum_{0\neq A\in
M_{n}(R)}\mathcal{D}(A)$, so Lemmas 3 and 10 yield (we have to sum over all
matrices $A=(A_{1},A_{2},\ldots,A_{l})$, where at least one of the $A_{i}$ is
non-zero and at least one of the $A_{i}$ is not of full rank)

$D_{1}=\sum_{k_{1},\ldots,k_{l}=0}^{n_{1},\ldots,n_{l}}\left[\prod_{i=1}^{l}\left(\prod_{j_{i}=0}^{k_{i}-1}{\frac{(q_{i}^{n_{i}}-q_{i}^{j_{i}})^{2}}{q_{i}^{k_{i}}-q_{i}^{j_{i}}}}\right){\prod_{i=1}^{l}q_{i}^{(n_{i}-k_{i})^{2}}}\left(2\prod_{i=1}^{l}{q_{i}^{k_{i}(n_{i}-k_{i})}}-1\right)\right]\\\
-\prod_{i=1}^{l}{q_{i}^{n_{i}^{2}}}-\prod_{i=1}^{l}\prod_{j_{i}=0}^{n_{i}-1}{(q_{i}^{n_{i}}-q_{i}^{j_{i}})}-(|Z(R)|-1)-|N_{2}(R)|,$

where $N_{2}(R)=\\{0\neq A\in R;A^{2}=0\\}$. Obviously, for
$A=(A_{1},A_{2},\ldots,A_{l})$ we have $A^{2}=0$ if and only if $A_{i}^{2}=0$
for every $i=1,2,\ldots,l$. With the use of Lemma 6, we quickly see that

$|N_{2}(R)|=\sum_{k_{1},\ldots,k_{l}=0}^{n_{1}-1,\ldots,n_{l}-1}\prod_{i=1}^{l}\left(\frac{\prod_{j_{i}=0}^{2k_{i}-1}\left(q_{i}^{n_{i}}-q_{i}^{j_{i}}\right)}{q_{i}^{k_{i}^{2}}\prod_{j_{i}=0}^{k_{i}-1}\left(q_{i}^{k_{i}}-q_{i}^{j_{i}}\right)}\right)-1.$

If we collect all this together, we finally arrive at

$W(\Gamma(R))=|Z(R)|^{2}-\frac{5}{2}|Z(R)|+\frac{3}{2}+\left(\frac{T(R)}{2}-2^{l-1}+1\right)\prod_{i=1}^{l}{q_{i}^{n_{i}\choose
2}\prod_{j_{i}=1}^{n_{i}}(q_{i}^{j_{i}}-1)}-\\\
\frac{1}{2}\sum_{k_{1},\ldots,k_{l}=0}^{n_{1},\ldots,n_{l}}\left[\prod_{i=1}^{l}\left(\prod_{j_{i}=0}^{k_{i}-1}{\frac{(q_{i}^{n_{i}}-q_{i}^{j_{i}})^{2}}{q_{i}^{k_{i}}-q_{i}^{j_{i}}}}\right)\prod_{i=1}^{l}{q_{i}^{(n_{i}-k_{i})^{2}}}\left(2\prod_{i=1}^{l}{q_{i}^{k_{i}(n_{i}-k_{i})}}-1\right)\right]\\\
+\frac{1}{2}\prod_{i=1}^{l}{q_{i}^{n_{i}^{2}}}+\frac{1}{2}\prod_{i=1}^{l}\prod_{j_{i}=0}^{n_{i}-1}{(q_{i}^{n_{i}}-q_{i}^{j_{i}})}+\frac{1}{2}|N_{2}(R)|.$

Finally, by Lemma 4, we also have

$|Z(R)|=|R|-|R^{*}|=\prod_{i=1}^{l}q_{i}^{n_{i}^{2}}-\prod_{i=1}^{l}q_{i}^{n_{i}\choose
2}\prod_{j_{i}=1}^{n_{i}}(q_{i}^{j_{i}}-1),$

which proves the assertion of this theorem. ∎

Let us illustrate the above theorem in a special case of product of two matrix
rings of size $2$.

######  Example 2.

Let $F_{1},F_{2}$ be finite fields and denote $x=|F_{1}|$ and $y=|F_{2}|$.
Then Theorem 3 together with some tedious calculations yield that
$W(\Gamma(M_{2}(F_{1})\times
M_{2}(F_{2})))=x^{8}y^{6}+3x^{7}y^{7}+x^{6}y^{8}+2x^{8}y^{5}+2x^{5}y^{8}-x^{8}y^{4}-9x^{7}y^{5}-x^{6}y^{6}-9x^{5}y^{7}-x^{4}y^{8}-2x^{8}y^{3}+3x^{7}y^{4}-2x^{6}y^{5}-2x^{5}y^{6}+3x^{4}y^{7}-2x^{3}y^{8}+x^{8}y^{2}+6x^{7}y^{3}+x^{6}y^{4}+22x^{5}y^{5}+x^{4}y^{6}+6x^{3}y^{7}+x^{2}y^{8}-3x^{7}y^{2}+2x^{6}y^{3}-10x^{5}y^{4}-10x^{4}y^{5}+2x^{3}y^{6}-3x^{2}y^{7}-x^{6}y^{2}-12x^{5}y^{3}-\frac{5}{2}x^{4}y^{4}-12x^{3}y^{5}-x^{2}y^{6}+9x^{5}y^{2}+8x^{4}y^{3}+8x^{3}y^{4}+9x^{2}y^{5}-x^{5}y-x^{4}y^{2}+6x^{3}y^{3}-x^{2}y^{4}-xy^{5}-x^{4}y-6x^{3}y^{2}-6x^{2}y^{3}-xy^{4}+\frac{5}{2}x^{2}y^{2}+xy+1$.
In particular, we can calculate for example that
$W(\Gamma(M_{2}(\mathbb{Z}_{2})\times M_{2}(\mathbb{Z}_{2})))=49005$ and
$W(\Gamma(M_{2}(\mathbb{Z}_{6})))=1089421$.

Finally, let us also examine the Wiener complexity in the semisimple case.
Note that this bound is again dependent only on the size of matrices and not
on the size of the underlying fields.

######  Theorem 4.

Let $n_{1},n_{2},\ldots,n_{l}\geq 1$ be integers, $F_{1},F_{2},\ldots,F_{l}$
finite fields and $R=M_{n_{1}}(F_{1})\times M_{n_{2}}(F_{2})\times\ldots\times
M_{n_{l}}(F_{l})$. Then

$C_{W}(\Gamma(R))\leq\prod_{i=1}^{l}n_{i}+\prod_{i=1}^{l}(n_{i}+1)-3.$

###### Proof.

Choose $0\neq A\in Z(R)$. Denote $D_{3}(A)=|\\{B\in Z(R);d(A,B)=3\\}|$. Then
by Lemma 7, we have
$\mathrm{Tr}(A)=\mathcal{D}(A)+2(|V(\Gamma(R))|-1-\mathcal{D}(A)-D_{3}(A))+3D_{3}(A)=2(|Z(R)|-2)-\mathcal{D}(A)+D_{3}(A)$.
Let $A=(A_{1},A_{2},\ldots,A_{l})$ with $\mathrm{rk}(A_{i})=k_{i}$ for every
$i=1,2,\ldots,l$. Suppose firstly that there exists $i\in\\{1,2,\ldots,l\\}$
such that $1\leq k_{i}\leq n_{i}-1$. Let us denote $q_{i}=|F_{i}|$ for
$i=1,2,\ldots,l$. Observe that by Lemma 3 and Lemma 7,
$D_{3}(A)=\prod_{i=1}^{l}\omega_{i}$, where $\omega_{i}=q_{i}^{n_{i}^{2}}$ if
$k_{i}=n_{i}$ and
$\omega_{i}=\prod_{j_{i}=0}^{n_{i}-1}{\frac{(q_{i}^{n_{i}}-q_{i}^{j_{i}})^{2}}{q_{i}^{n_{i}}-q_{i}^{j_{i}}}}$
otherwise. On the other hand, if $k_{i}\in\\{0,n_{i}\\}$ for every
$i\in\\{1,2,\ldots,l\\}$, then let
$\Lambda_{1}=\\{i\in\\{1,2,\ldots,l\\};k_{i}=0\\}$ and
$\Lambda_{2}=\\{1,2,\ldots,\l\\}\setminus\Lambda_{1}$. Observe that in this
case,
$D_{3}(A)=\left(\prod_{i\in\Lambda_{1}}\prod_{j_{i}=0}^{n_{i}-1}{\frac{(q_{i}^{n_{i}}-q_{i}^{j_{i}})^{2}}{q_{i}^{n_{i}}-q_{i}^{j_{i}}}}\right)\left(-1+\prod_{i\in\Lambda_{2}}{q_{i}^{n_{i}^{2}}}\right)$.
Furthermore, by Lemma 10,
$\mathcal{D}(A)=\prod_{i=1}^{l}{q_{i}^{(n_{i}-k_{i})^{2}}}\left(2\prod_{i=1}^{l}{q_{i}^{k_{i}(n_{i}-k_{i})}}-1\right)-\epsilon$,
where $\epsilon=1$ if $A^{2}\neq 0$, and $\epsilon=2$ if $A^{2}=0$. This
implies that $\mathrm{Tr}(A)$ is dependent only on the numbers
$k_{1},k_{2},\ldots,k_{l}$ and the on the fact whether $A^{2}$ is zero or not.
Since $A\in Z(R)\setminus\\{0\\}$, at least one of the numbers
$k_{1},k_{2},\ldots,k_{l}$ has to be non-zero and there has to exist
$i\in\\{1,2,\ldots,l\\}$ such that $k_{i}\leq n_{i}-1$. Since $A^{2}=0$
implies $A_{i}^{2}=0$ for every $i\in\\{1,2,\ldots,l\\}$, and since for every
vector $(k_{1},k_{2},\ldots,k_{l})\neq 0^{l}$ such that $k_{i}\leq n_{i}-1$
for every $i$ there exist matrices
$B=(B_{1},B_{2},\ldots,B_{l}),C=(C_{1},C_{2},\ldots,C_{l})\in
Z(R)\setminus\\{0\\}$ such that $\mathrm{rk}(B_{i})=\mathrm{rk}(C_{i})=k_{i}$
for every $i\in\\{1,2,\ldots,l\\}$ and $B^{2}=0$, while $C^{2}\neq 0$, this
implies that $C_{W}(\Gamma(R))\leq
2\left(\prod_{i=1}^{l}n_{i}-1\right)+S(R)-1$, where $S(R)$ denotes the number
of different vectors $(k_{1},k_{2},\ldots,k_{l})\in\mathbb{N}^{l}$ such that
$k_{i}\geq 0$ for every $i\in\\{1,2,\ldots,l\\}$ and there exists
$j\in\\{1,2,\ldots,l\\}$ such that $k_{j}=n_{j}$. Let us calculate $S(R)$.
Denote $x_{i}=n_{i}+1$ for every $i\in\\{1,2,\ldots,l\\}$ and observe that by
the inclusion-exclusion principle we have
$S(R)=e_{l-1}(x_{1},x_{2},\ldots,x_{l})-e_{l-2}(x_{1},x_{2},\ldots,x_{l})+\ldots+(-1)^{l-2}e_{1}(x_{1},x_{2},\ldots,x_{l})+(-1)^{l-1}$,
where $e_{i}(x_{1},x_{2},\ldots,x_{l})$ denotes the $i$-th elementary
symmetrical polynomial in variables $x_{1},x_{2},\ldots,x_{l}$. We further
calculate that
$S(R)=(-1)^{l-1}((-1)^{l-1}e_{l-1}(x_{1},x_{2},\ldots,x_{l})+(-1)^{l-2}e_{l-2}(x_{1},x_{2},\ldots,x_{l})+\ldots+(-1)^{1}e_{1}(x_{1},x_{2},\ldots,x_{l})+1)=(-1)^{l-1}((-1)^{l}e_{l}(x_{1},x_{2},\ldots,x_{l})+\\\
(-1)^{l-1}e_{l-1}(x_{1},x_{2},\ldots,x_{l})+(-1)^{l-2}e_{l-2}(x_{1},x_{2},\ldots,x_{l})+\ldots+\\\
(-1)^{1}e_{1}(x_{1},x_{2},\ldots,x_{l})+1)+e_{l}(x_{1},x_{2},\ldots,x_{l})$.
By the well known identity for the symmetric polynomials, this yields

$S(R)=(-1)^{l-1}\prod_{i=1}^{l}(1-x_{i})+e_{l}(x_{1},x_{2},\ldots,x_{l})=-\prod_{i=1}^{l}n_{i}+\prod_{i=1}^{l}(n_{i}+1).$

This finally gives us
$C_{W}(\Gamma(R))\leq\prod_{i=1}^{l}n_{i}+\prod_{i=1}^{l}(n_{i}+1)-3$. ∎

Acknowledgment: The author acknowledges the financial support from the
Slovenian Research Agency (research core funding No. P1-0222).

## References

  * [1] V. K. Agrawal, Bano S., Mathur K. C., and Khadikar P. V., _Novel application of wiener visa-vis szeged indices: Antitubercular activities of quinolones_ , Proc. Indian Acad. Sci. (Chem. Sci.) 112 (2000), 137–146.
  * [2] S. Akbari and A. Mohammadian, _Zero-divisor graphs of non-commutative rings_ , J. Algebra 296 (2006), no. 2, 462–479. MR 2201052
  * [3] Yaser Alizadeh, Vesna Andova, Sandi Klavžar, and Riste Škrekovski, _Wiener dimension: fundamental properties and $(5,0)$-nanotubical fullerenes_, MATCH Commun. Math. Comput. Chem. 72 (2014), no. 1, 279–294. MR 3241721
  * [4] Yaser Alizadeh and Sandi Klavžar, _Complexity of topological indices: the case of connective eccentric index_ , MATCH Commun. Math. Comput. Chem. 76 (2016), no. 3, 659–667. MR 3615816
  * [5] David F. Anderson, T. Asir, Ayman Badawi, and T. Tamizh Chelvam, _Graphs from rings_ , Springer, Cham, [2021] ©2021. MR 4385024
  * [6] David F. Anderson and Philip S. Livingston, _The zero-divisor graph of a commutative ring_ , J. Algebra 217 (1999), no. 2, 434–447. MR 1700509
  * [7] T. Asir and V. Rabikka, _The Wiener index of the zero-divisor graph of $\mathbb{Z}_{n}$_, Discrete Appl. Math. 319 (2022), 461–471. MR 4457815
  * [8] T. Asir, V. Rabikka, A. M. Anto, and N. Shunmugapriya, _Wiener index of graphs over rings: a survey_ , AKCE Int. J. Graphs Comb. 19 (2022), no. 3, 316–324. MR 4517984
  * [9] T. Asir, V. Rabikka, and Huadong Su, _On Wiener Index of Unit Graph Associated with a Commutative Ring_ , Algebra Colloq. 29 (2022), no. 2, 221–230. MR 4414151
  * [10] Kannan Balakrishnan, Boštjan Brešar, Manoj Changat, Sandi Klavžar, Matjaž Kovše, and Ajitha R. Subhamathi, _Computing median and antimedian sets in median graphs_ , Algorithmica 57 (2010), no. 2, 207–216. MR 2587551
  * [11] István Beck, _Coloring of commutative rings_ , J. Algebra 116 (1988), no. 1, 208–226. MR 944156
  * [12] Ivana Božić and Zoran Petrović, _Zero-divisor graphs of matrices over commutative rings_ , Comm. Algebra 37 (2009), no. 4, 1186–1192. MR 2510978
  * [13] G. Alan Cannon, Kent M. Neuerburg, and Shane P. Redmond, _Zero-divisor graphs of nearrings and semigroups_ , Nearrings and nearfields, Springer, Dordrecht, 2005, pp. 189–200. MR 2177522
  * [14] M. C. Crabb, _Counting nilpotent endomorphisms_ , Finite Fields Appl. 12 (2006), no. 1, 151–154. MR 2190192
  * [15] B. C. Crafford D. H. Rouvray, _The dependence of physical-chemical properties on topological factors_ , South Africa J. Sci. 72 (1976), 47–51.
  * [16] F. R. DeMeyer, T. McKenzie, and K. Schneider, _The zero-divisor graph of a commutative semigroup_ , Semigroup Forum 65 (2002), no. 2, 206–214. MR 1911724
  * [17] Andrey A. Dobrynin, Roger Entringer, and Ivan Gutman, _Wiener index of trees: theory and applications_ , Acta Appl. Math. 66 (2001), no. 3, 211–249. MR 1843259
  * [18] David Dolžan and Polona Oblak, _The zero-divisor graphs of rings and semirings_ , Internat. J. Algebra Comput. 22 (2012), no. 4, 1250033, 20\. MR 2946298
  * [19] Shahabaddin Ebrahimi Atani, _The zero-divisor graph with respect to ideals of a commutative semiring_ , Glas. Mat. Ser. III 43(63) (2008), no. 2, 309–320. MR 2460702
  * [20] N. Ganesan, _Properties of rings with a finite number of zero divisors_ , Math. Ann. 157 (1964), 215–218. MR 169870
  * [21] I. Gutman and T. Kortvelyesi, _Wiener indices and molecular surfaces_ , Z. Naturforsch. 50a (1995), 669–671.
  * [22] Dušanka Janežič, Ante Miličević, Sonja Nikolić, and Nenad Trinajstić, _Graph-theoretical matrices in chemistry_ , second ed., CRC Press, Boca Raton, FL, 2015. MR 3381136
  * [23] Kwangil Koh, _On “Properties of rings with a finite number of zero divisors”_ , Math. Ann. 171 (1967), 79–80. MR 207753
  * [24] Matjaž Krnc and Riste Škrekovski, _Centralization of transmission in networks_ , Discrete Math. 338 (2015), no. 12, 2412–2420. MR 3373345
  * [25] Kent E. Morrison, _Integer sequences and matrices over finite fields_ , J. Integer Seq. 9 (2006), no. 2, Article 06.2.1, 28. MR 2217227
  * [26] B. Surendranath Reddy, Rupali S. Jain, and N. Laxmikanth, _Characteristic polynomial and Wiener index of the compressed zero divisor graph $\Gamma_{E}[\mathbb{Z}_{p^{n}}]$_, Serdica Math. J. 46 (2020), no. 1, 61–72. MR 4124061
  * [27] Shane P. Redmond, _The zero-divisor graph of a non-commutative ring_ , Commutative rings, Nova Sci. Publ., Hauppauge, NY, 2002, pp. 39–47. MR 2037657
  * [28] K. Selvakumar, P. Gangaeswari, and G. Arunkumar, _The Wiener index of the zero-divisor graph of a finite commutative ring with unity_ , Discrete Appl. Math. 311 (2022), 72–84. MR 4377155
  * [29] Pradeep Singh and Vijay Kumar Bhat, _Adjacency matrix and Wiener index of zero divisor graph $\Gamma(Z_{n})$_, J. Appl. Math. Comput. 66 (2021), no. 1-2, 717–732. MR 4257055
  * [30] Christian Smart and Peter J. Slater, _Center, median, and centroid subgraphs_ , vol. 34, 1999, Centrality concepts in network location, pp. 303–311. MR 1730763
  * [31] L. I. Stiel and G. Thodos, _The normal boiling points and critical constants of saturated aliphatic hydrocarbons_ , Am. Inst. Chem. Engin. 8 (1962), 527–529.
  * [32] Sheela Suthar and Om Prakash, _Energy and Wiener index of total graph over ring $\mathbb{Z}_{n}$_, International Conference on Current Trends in Graph Theory and Computation, Electron. Notes Discrete Math., vol. 63, Elsevier Sci. B. V., Amsterdam, 2017, pp. 485–495. MR 3754839
  * [33] H. Wiener, _Structural determination of paraffin boiling points_ , J. Am. Chem. Soc. 69 (1947), no. 1, 17–20.