Computing Energy and Some Topological Indices of
Mohammad Javad Nikmehr^{1,}^{ *}, Najmeh Soleimani^{2}
^{1}Faculty of Mathematics, K. N. Toosi University of Technology, Tehran, Iran
^{2}Young Researchers and Elite Club, Karj Branch, Islamic Azad University, Karaj, Iran
Email address:
To cite this article:
Mohammad Javad Nikmehr, Najmeh Soleimani. Computing Energy and Some Topological Indices of . Mathematics and Computer Science. Vol. 1, No. 4, 2016, pp. 101-107. doi: 10.11648/j.mcs.20160104.15
Received: September 3, 2016; Accepted: November 16, 2016; Published: December 20, 2016
Abstract: For a commutative ring , the total graph of which denoted by , is a graph with all elements of R as vertices, and two distinct vertices are adjacent if and only if , where denotes the set of zero-divisors of R. In an earlier study, we computed Wiener, hyper-Wiener, reverse Wiener, Randi, Zagreb, and indices of zero-divisor graph. In this study, some computer programs are prepared to calculate the zero-divisors and adjacency matrix of the given graph which, apply these programs to compute the energy and first edge-Wiener, sum-connectivity, harmonic, augmented Zagreb and hyper-Zagreb indices.
Keywords: Ring, Zero-Divisor Graph, MATLAB Program, Energy, Topological Indices
1. Introduction
A graph consists of a set of vertices and a set of edges . The number of vertices and edges in a graph will be denoted by and , respectively. The graph is connected if each pair of the vertices in belongs to a path. The degree of the vertex, written as , is the number of edges with as an end vertex. For two vertices we define their distance as the length of any shortest path connecting and in . A regular graph is a graph where each vertex has the same number of neighbors. A regular graph with vertices of degree is called a -regular graph or regular graph of degree . Let be a commutative ring with identity. The total graph of denoted by , is a graph with the vertex set such that two vertices and are adjacent if and only if . We denote the set of zero-divisors and unit elements of by and , respectively. This concept was firstly introduced in [1] by Anderson and Badawi. Also, the zero-divisor graph of , denoted as . Throughout this study, let that be a positive integer, where for , , is a distinct prime number and and suppose that for some positive integer . Mathematical calculations are absolutely necessary to explore important concepts in chemistry. In chemical graph theory, there are many molecular descriptors (or topological indices) for a connected graph, that have very useful properties to study of chemical molecules. The use of topological indices as structural descriptors is important in proper and optimal nanostructure design. In a series of studies some topological indices are computed for nanostructures and some graphs [2-7]. This article is the continuation of the work [8], which were provided MATLAB programs, to calculate the energy and first edge-Wiener, sum-connectivity, harmonic, augmented Zagreb and hyper-Zagreb index of the given zero-divisor graph.
2. Methods
In this section, we recall some algebraic definitions related to the topological indices chosen for the present study. Chemical graph theory interdisciplinary science that applies graph theory to the study of molecular structures. The molecules or chemical compounds are modeled by an undirected graph named molecular graphs.
Equivalence between chemical and graph theoretical terms:
Atom Vertex
Molecule Molecular graph
Covalent bond Edge
Valency of an atom Vertex degree
Skeletal structure Hydrogen-depleted graph
Topological matrix Adjacency matrix
Energy level Eigenvalue
Example 2.1 In order to make it easier for readers to understand the molecular graph, an example is given on a hydrocarbon, together with its hydrogen-depressed graph as shown in Figure 1.
Figure 1. Structural formula and molecular graph of benzene, .
The adjacency matrix of a molecular graph with vertices is an matrix defined by: , if vertices and are connected by an edge and, , otherwise. The energy of a graph , often denoted , is defined to be the sum of the absolute value of the eigenvalues of its adjacency matrix. Hence if is the adjacency matrix of , and are the eigenvalues of A(G), then . In chemistry the energy of a graph is extensively studied since it can be used to approximate the total -electron energy of the molecule represented by that graph, for more details see [9, 10]. A topological index is a numerical parameter mathematically derived from the graph structure. The topological indices of molecular graphs are widely used for establishing correlations between the structure of a molecular compound and its physic-chemical properties or biological activity (e.g., pharmacology).
The Wiener index is the oldest and one of the most studied distance-based topological indices in chemistry. It was introduced by Harold Wiener [11], equal to the sum of distances between all pairs of vertices of the graph under consideration. Other much studied distance-based topological indices are edge Wiener indices. Let. Set and
The first edge-Wiener index ( was introduced by Iranmanesh et al. [12] as follow:
(1)
Also, vertex-degree-based topological indices discussed in this study:
Sum-connectivity (X), [13]: (2)
Harmonic (H), [14]: (3)
Augmented Zagreb (AZI), [15]: (4)
Hyper-Zagreb (HM), [16]: (5)
Example 2.2 Let be a defect carbon nanocone. To obtain topological indices, starting from molecular structure, viewed as a graph, and considering the number of the vertices and edges. Obviously, for (see Figure ) and . Now, it is easy to see that has vertices and edges. We can see that the edge set of graph can be dividing to three partitions edges with endpoints , edges with endpoints and edges with endpoints . By use an algebraic method we obtain , and .
Figure 2. The graph of defect carbon nanocone, with and .
Now, we calculate the Sum-connectivity index, Harmonic index, Augmented Zagreb index and hyper-Zagreb index for the molecular graph of Figure 2 by use an algebraic method:
a. .
b. .
c. .
d. .
3. Results and Discussion
The goal of this section is to compute the topological indices of the zero-divisor graph . Begin with several properties of the zero-divisor graph, which will be helpful to express of main results.
Theorem 3.1 [17] Let and be a natural number. If , then the followings hold:
a. If is prime, then , ().
b. If is odd and not a prime number, then
c. If is even, then and is -regular.
The following result is a consequence of Theorem 3.1.
Corollary 3.1 For a positive integer , we have:
Note 3.1 For some values of the is not connected. Indeed, is not connected if and only if , where is prime and . The following figures give examples of , for some values of .
Example 3.1 The following figures represent some zero-divisor graphs in which Figure 3 and 4 are connected.
Figure 3. .
Figure 4. .
Example 3.2 The following figures represent some zero-divisor graphs in which Figure 5 and 6 are not connected.
Figure 5. .
Figure 6. .
First MATLAB program is introducing a particular commutative ring and we will discuss the value for . Since for the calculation of topological indices the graph should be connected, therefore , is prime and .
Program 3.1 A MATLAB program for checking different values of :
function [flag, Primes, Powers, N]=CHECK()
N=input('Input an integer: ');
IsPrime=isprime(1: N);
Primes=find(IsPrime);
Powers=zeros(size(Primes));
M=N;
for k=1: numel(Primes)
while mod(M, Primes(k))==0
Powers(k)=Powers(k)+1;
M=M/Primes(k);
end
end
if (sum(Powers~=0)>1)
flag=true;
else
flag=false;
end
Program 3.2 A MATLAB program compute the set zero divisors for , which is very useful in the other programs:
function [m]=ZeroDivisor(N, Powers, Primes)
m=[];
m(1)=0;
if((numel(Primes)>1)&&(sum(Powers~=0)>1))
for i=1: numel(Primes)
n=1;
if(Powers(i)>0)
while Primes(i)*n<N
if(m~=Primes(i)*n)
m=[m, Primes(i)*n];
end
n=n+1;
end
end
end
end
m=sort(m);
end
Theorem 3.2 [18] Let be an arbitrary graph. Then
Remark 3.1 By a well-known result on the subject of graph energy,
,
for -vertex -regular graph .
Theorem 3.3 Let be a zero-divisor graph. Then the followings hold:
a. If is prime, then .
b. If is odd and not a prime number, then
c. If n is even, then
Proof. By Corollary 3.1, Theorem 3.2 and Remark 3.1, we are done.
Program 3.3 A MATLAB program for finding adjacency matrix of :
function A=ADJACENCYMATIRX(m, N)
A=zeros(N);
for i=1: N
for j=i+1: N
if sum(m==i-1)==1
if sum(m==j-1)==1
jam=i+j-2;
if (sum(m==jam )==1|| jam==N || sum(m==jam-N)==1)
A(i, j)=1;
end
else
jam=i+j-2;
if (sum(m==jam )==1|| jam==N || sum(m==jam-N)==1)
A(i, j)=1;
end
end
else
jam=i+j-2;
if (sum(m==jam )==1|| jam==N || sum(m==jam-N)==1)
A(i, j)=1;
end
end
end
end
for r=N:-1:1
for i=N-1:-1:1
A(r, i)=A(i, r);
end
end
end
We apply Program 3.3 to compute the energy, first edge-Wiener index and vertex-degree-based topological indices of the zero-divisor graph .
Program 3.4 A MATLAB program for computing the energy of :
clc;
clear;
[flag, Primes, Powers, N]=CHECK();
if(flag)
[m]=ZeroDivisor(N, Powers, Primes);
disp(['The number of zero divisors=', num2str(numel(m))]);
A=ADJACENCYMATIRX(m, N);
e=eig(A)
energy=sum(abs(e));
disp(['Energy=', num2str(sum(abs(e)))]);
else
disp('wrong input');
end
Using this program, we have:
Table 1. The Values of for .
Program 3.5 A MATLAB program for finding distance matrix of :
function D=dismat(m, N)
D=zeros(N);
m=sort(m);
for i=1: N
for j=i+1: N
if sum(m==i-1)==1
if sum(m==j-1)==1
jam=i+j-2;
if (sum(m==jam )==1|| jam==N || sum(m==jam-N)==1)
D(i, j)=1;
else
D(i, j)=2;
end
else
jam=i+j-2;
if (sum(m==jam )==1|| jam==N || sum(m==jam-N)==1)
D(i, j)=1;
else
D(i, j)=2;
end
end
else
jam=i+j-2;
if (sum(m==jam )==1|| jam==N || sum(m==jam-N)==1)
D(i, j)=1;
else
D(i, j)=2;
end
end
end
end
for r=N:-1:1
for i=N-1:-1:1
D(r, i)=D(i, r);
end
end
end
Program 3.6 A MATLAB program for finding minimum of a vector of numbers:
function [k]=mini(V)
[m, n]=size(V);
k=V(1);
for i=2: n
if V(i)<k
k=V(i);
end
end
end
Program 3.7 The program compute the first edge-Wiener index of . This program includes several sub programs:
clc;
clear;
[flag, Primes, Powers, N]=CHECK();
c=1;
for i=1: numel(Primes)
if Powers(i)~=0
primes2(c)=Primes(i);
c=c+1;
end
end
if(flag)
[m]=ZeroDivisor(N, Powers, Primes);
A=ADJACENCYMATIRX(m, N);
D=dismat(m, N);
k=0; We=0; We0=0;
for i=1: size(A, 1)
for j=1: size(A, 1)
if i < j & A(i, j)==1
k=k+1;
x(k)=i;
y(k)=j;
end
end
end
for i=1: k
for j=1: k
if i~=j
F=[D(x(i), x(j)), D(x(i), y(j)), D(y(i), x(j)), D(y(i), y(j))];
We(i, j)=mini(F)+1;
else
We(i, j)=0;
end
end
end
for i=1: k
for j=1: k
We0=We0+(We(i, j)/2);
end
end
disp(['first edge-Wiener index=', num2str(We0)]);
else
disp('wrong input');
end
Lemma 3.1 Let be an arbitrary graph. Then is -regular if and only if one of the followings holds:
a. .
b. .
c. .
d. .
Proof. The proof is clear.
In order to provide a unified approach to the results discussed in next theorem, we express the following notation.
Note 3.2 Let be an arbitrary edge. Three cases may occur:
(i)
Since the degree of a vertex is , then the number of is .
(ii) and .
Since the degree of a vertex is , the number of unit vertices adjacent to a vertex is . So, the coefficient of is
(iii) .
Similar to the previous cases, we have
Now, we calculate the sum-connectivity index, harmonic index, augmented Zagreb index and hyper-Zagreb index of by use an algebraic method.
Theorem 3.4 It holds that:
a.
b.
c.
d.
Proof. The formulas follow immediately from apply the precedent definitions, Lemma 3.1 and Note 3.2.
Program 3.8 A MATLAB program for finding degree of a vertex:
function [z]=degv(A, m)
z=0;
for a=A(m,:)
z=z+a;
end
end
Program 3.9 We offer a MATLAB program for calculating vertex-degree-based topological indices of :
clc;
clear;
[flag, Primes, Powers, N]=CHECK();
c=1;
for i=1: numel(Primes)
if Powers(i)~=0
primes2(c)=Primes(i);
c=c+1;
end
end
if(flag)
[m]=ZeroDivisor(N, Powers, Primes);
A=ADJACENCYMATIRX(m, N);
k=0; X=0; H=0; AZI=0; HM=0;
for i=1: size(A, 1)
for j=1: size(A, 1)
if i < j & A(i, j)==1
k=k+1;
x(k)=i;
y(k)=j;
end
end
end
for i=1: k
X=X+(1/sqrt((degv(A, x(i))+degv(A, y(i)))));
H=H+(2/(degv(A, x(i))+degv(A, y(i))));
AZI=AZI+((degv(A, x(i))*degv(A, y(i)))/(degv(A, x(i))+degv(A, y(i))-2))^3;
HM=HM+((degv(A, x(i))+degv(A, y(i)))^2);
end
disp(['Sum-connectivity index=', num2str(X)]);
disp(['Harmonic index=', num2str(H)]);
disp(['Augmented Zagreb index=', num2str(AZI)]);
disp(['Hyper-Zagreb index=', num2str(HM)]);
else
disp('wrong input');
end
To investigate the efficiency of Program 3.7 and Program 3.9, we consider two graphs which depicted in Figure 3 and 4.
Example 3.3 The values of and for are as follows:
Table 2. Some values of the topological indices of .
4. Conclusion
In fact, we made a connection between commutative ring theory, graph theory and topological indices. The main purpose of this study is to extend some results given in [8]. We have mentioned here some MATLAB programs, to calculate the adjacency matrix of the given graphs. Then we compute the energy and some topological indices by these programs.
Acknowledgments
The authors would like to thank the anonymous referee for his/her helpful comments that have improved the presentation of results in this article.
References