_{5}

_{7}

_{5}

_{7}

In this paper we give a GAP program for computing the Szeged and the PI indices of any graph. Also we compute the Szeged and PI indices of _{5}_{7} [ _{5}_{7} [

One of the main distinctive characteristics of modern chemistry is the use of theoretical tools for the molecular modeling of physicochemical processes, chemical reaction, medicinal and toxicological events, etc., in which chemicals are involved. The success of the molecular modeling is judged by the insights that it offers on the nature of the processes studied, which permit better comprehension and a their rational modification. These properties, measured experimentally, are almost invariably expressed in quantitative terms, for instance boiling point, refraction index, transition state energy, percentage of inhibition of some enzymatic activity, lethal dose, and so forth. The paradigm for the modeling of such properties is the relationship that exists between them and the molecular structure of chemical. This fact highlights the first challenge for molecular modeling: the properties are expressed as number while the molecular structure is not. The way to solve this problem is by using molecular descriptors, which are numbers representing information about different molecular features, to describe quantitatively the properties under study. These models are known as quantitative structure-property (

Topological indices of nanotubes are numerical descriptors that are derived from graphs of chemical compounds. Such indices based on the distances in a graph are widely used for establishing relationships between the structure of nanotubes and their physicochemical properties. Usage of topological indices in biology and chemistry began in 1947, when the chemist Harold Wiener [_{1} (_{2} (

The number of elements of _{1} (_{2} (_{1}(_{2} (

The Szeged index of the graph

For the reason of the coincidence of Wiener and Szeged indices in case of trees the authors in [

Applications of the PI index to QSRP/QSAR were studied in [

The computation of Szeged and PI indices seems straightforward, but this is not entirely true. For computing the Szeged (or PI) index of any graph, we must obtain _{1} (_{2} (

In this section, we give an algorithm that enables us to compute the Szeged and PI indices of any graph. For this purpose, the following algorithm is presented:

1-We assign one number to any vertex.

2-We determine all of adjacent vertices set of the vertex

The set of vertices that their distance to vertex _{i, t} and considering _{i}_{, 0} = {

_{t}_{≥0} _{i}_{,}_{t}

(_{i}_{,}_{t}_{j}_{,}_{t}_{j}_{,}_{t}_{−1} ∪ _{j}_{,}_{t}_{+1}),

(_{i,t}_{j,t−1}_{2} (_{i.t}_{j,t+1}_{1} (

(_{i}_{,1} ∪{_{j}_{,1} ∪{ _{1} (_{j}_{,1} ∪{ _{i}_{,1} ∪{_{2} (

According to the above relations, by determining _{i}_{,}_{t}_{1} (_{2} (_{i}_{,}_{t}

3- The distance between vertex _{i,1} = N(i). For each _{i}_{,}_{t}_{i}_{,}_{t}_{i}_{,}_{t−}_{1}) and the vertex

According to the above equation we can obtain _{i}_{,}_{t}

4- At the start of program we set SZ and PI equal to zero and T equal to empty set. At the end of program the values SZ and PI are equal to the Szeged and PI indices of the graph G respectively. For each vertex _{1} (_{2} (_{1} (_{2} (_{1} (_{2} (

GAP stands for Groups, Algorithms and Programming [_{k}_{,}_{d}

The Wiener index of tree dendrimers _{k,d}, _{k}_{,}_{d}

The following results are obtained in [

For every _{k}_{,}_{d}

and its Szeged index is equal to Wiener index, i.e.

For computation of the Szeged and PI indices of _{k, d}

The following program computes the Szeged and PI indices of the _{k,d}

d:=3; k:=3;#(For example)

n:=1+(d/(d-2))*((d-1)^k - 1);

N:=[];

K1:=[2..d+1];

N[1]:=K1;

for i in K1 do

if k=1 then N[i]:=[1];

else

N[i]:=[(d-1)*i+4-d..(d-1)*i+2];

Add(N[i],1);fi;

od;

K2:=[d+2..1+(d/(d-2))*((d-1)^(k-1) - 1)];

for i in K2 do

N[i]:=[(d-1)*i+4-d..(d-1)*i+2];

Add(N[i],Int((i-4+d)/(d-1)));

od;

K3:=[2+(d/(d-2))*((d-1)^(k-1) - 1)..n];

for i in K3 do

if k=1 then N[i]:=[1];

else

N[i]:=[Int((i-4+d)/(d-1))]; fi;

od;

# (Part2)

D:=[];

for i in [1..n] do

D[i]:=[];

u:=[i];

D[i][1]:=N[i];

u:=Union(u,D[i][1]);

s:=1;

t:=1;

while s<>0 do

D[i][t+1]:=[];

for j in D[i][t] do

for m in Difference(N[j],u) do

AddSet(D[i][t+1],m);

od;

od;

u:=Union(u,D[i][t+1]);

if D[i][t+1]=[] then

s:=0;

fi;

t:=t+1;

od;

od;

T:=[];

sz:=0;

pi:=0;

for i in [1..n-1] do

N1:=[];

for j in Difference(N[i],T) do

N2:=[];

N1[j]:=Union(Difference(N[i],Union([j],N[j])),[i]);

N2[i]:=Union(Difference(N[j],Union([i],N[i])),[j]);

for t in [2..Size(D[i])-1] do

for x in Difference(D[i][t],Union(D[j][t],[j])) do

if not x in D[j][t-1] then

AddSet(N1[j],x);

elif x in D[j][t-1] then

AddSet(N2[i],x);

fi;

od;

od;

sz:=sz+Size(N1[j])*Size(N2[i]);

pi:=pi+Size(N1[j])+Size(N2[i]);

od;

Add(T,i);

od;

sz;# (The value of sz is equal to Szeged index of the graph)

pi; # (The value of pi is equal to PI index of the graph)

A C_{5}C_{7} net is a trivalent decoration made by alternating C_{5} and C_{7}. It can cover either a cylinder or a torus. In this section we compute the Szeged and PI indices of _{5}C_{7}[p,q]

We denote the number of pentagons in the first row by p, in this nanotube the four first rows of vertices and edges are repeated alternatively, we denote the number of this repetition by

We partition the vertices of the graph to the following sets:

_{1}

The vertices of the first row whose number is 6

_{2}

The vertices of the first row in each period except the first one whose number is 6

_{3}

The vertices of the second rows in each period whose number is 2

_{4}

The vertices of the third row in each period whose number is 6

_{5}

The vertices of the fourth row in each period whose number is 2

_{6}

The last vertices of the graph whose number is3

We write a program to obtain the adjacent vertices set to each vertex in the sets _{i}

The following program computes the Szeged and PI indices of _{5}C_{7}[p,q]

p:=4; q:=2; # (for example)

n:=16*p*q+3*p;

N:=[];

K1:=[1..6*p];

V1:=[2..6*p -1];

for i in V1 do

if i mod 6=1 then N[i]:=[i-1,i+1,i+8*p];

elif i mod 6 in [0,2,4] then N[i]:=[i-1,i+1];

elif i mod 6=3 then N[i]:=[i-1,i+1,(1/3)*(i-3)+6*p+1];

elif i mod 6=5 then N[i]:=[i-1,i+1,(1/3)*(i-5)+6*p +2];fi;

N[1]:=[2,6*p,8*p+1];

N[6*p]:=[6*p-1,1];

od;

K:=[6*p+1..16*p*q];

K2:=Filtered(K,i->i mod (16*p) in [1..6*p]);

for i in K2 do

x:= i mod (16*p);

if x mod 6=1 then N[i]:=[i-1,i+1,i+8*p];

elif x mod 6=2 then N[i]:=[i-1,i+1,(1/3)*(x-2)+2+i-x-2*p];

elif x mod 6=3 then N[i]:=[i-1,i+1,(1/3)*(x-3)+1+i-x+6*p];

elif x mod 6=4 then N[i]:=[i-1,i+1,i-8*p];

elif x mod 6=5 then N[i]:=[i-1,i+1,(1/3)*(x-5) +2+i-x+6*p];

elif x mod 6=0 then N[i]:=[i-1,i+1,(1/3)*x +1+i-x-2*p];fi;

if x=1 then N[i]:=[i+1,i-1+6*p,i+8*p];fi;

if x=6*p then N[i]:=[i-1,i- 6*p+1,i- 8*p+1];fi;

od;

K3:=Filtered(K,i->i mod (16*p) in [6*p+1..8*p]);

for i in K3 do

x:=(i-6*p) mod (16*p);

if x mod 2=0 then N[i]:=[i-1,3*(x-2)+5+i-x- 6*p,3*(x-2)+5+i-x+2*p];

else N[i]:=[i+1,2*x+i- 6*p,2*x+i+2*p];fi;

od;

K4:=Filtered(K,i->i mod (16*p) in [8*p+1..14*p]);

for i in K4 do

x:=(i- 8*p) mod (16*p);

if x mod 6=1 then N[i]:=[i-1,i+1,i- 8*p];

elif x mod 6=2 then N[i]:=[i-1,i+1,(1/3)*(x-2)+2+i-x+6*p];

elif x mod 6=3 then N[i]:=[i-1,i+1,(1/3)*(x-3)+1+i-x-2*p];

elif x mod 6=4 then N[i]:=[i-1,i+1,i+8*p];

elif x mod 6=5 then N[i]:=[i-1,i+1,(1/3)*(x-5)+2+i-x- 2*p];

elif x mod 6=0 then N[i]:=[i-1,i+1,(1/3)*x+1+i-x+6*p];fi;

if x=1 then N[i]:=[i-8*p,i+1,i+6*p-1];fi;

if x=6*p then N[i]:=[i-1,i-6*p+1,i+1];fi;

od;

K5:=Filtered(K,i->i mod (16*p) in Union([14*p+1..16*p-1],[0]));

for i in K5 do

x:=(i-14*p) mod (16*p);

if x mod 2=1 then N[i]:=[i+1,3*(x-1)+i-x-6*p,3*(x-1)+i-x+2*p];

else N[i]:=[i-1,3*(x-2)+2+i-x-6*p,3*(x-2)+2+i-x+2*p];fi;

if x=1 then N[i]:=[i+1,i-1,i-1+8*p];fi;

if x=2*p then N[i]:=[i-1,3*(x-2)+2+i-x-6*p,3*(x-2)+2+i-x+2*p];fi;

od;

K6:=[16*p*q+1..n];

for i in K6 do

x:=i mod (16*p);

if x mod 3=1 then y:= (2/3)*(x-1)+2+i-x- 2*p;

elif x mod 3=2 then y:=i+x- 8*p;

elif x mod 3=0 then y:=(2/3)*(x- 3)+3+i-x-2*p;fi;

if x=3*p then y:=i- 5*p+1;fi;

N[i]:=[y];

N[y][3]:=i;

od;

D:=[];

for i in [1..n] do

D[i]:=[];

u:=[i];

D[i][1]:=N[i];

u:=Union(u,D[i][1]);

s:=1;

t:=1;

while s<>0 do

D[i][t+1]:=[];

for j in D[i][t] do

for m in Difference(N[j],u) do

AddSet(D[i][t+1],m);

od;

od;

u:=Union(u,D[i][t+1]);

if D[i][t+1]=[] then

s:=0;

fi;

t:=t+1;

od;

od;

T:=[];

sz:=0;

pi:=0;

for i in [1..n-1] do

N1:=[];

for j in Difference(N[i],T) do

N2:=[];

N1[j]:=Union(Difference(N[i],Union([j],N[j])),[i]);

N2[i]:=Union(Difference(N[j],Union([i],N[i])),[j]);

for t in [2..Size(D[i])-1] do

for x in Difference(D[i][t],Union(D[j][t],[j])) do

if not x in D[j][t-1] then

AddSet(N1[j],x);

elif x in D[j][t-1] then

AddSet(N2[i],x);

fi;

od;

od;

sz:=sz+ Size(N1[j])*Size(N2[i]);

pi:=pi+ Size(N1[j])+Size(N2[i]);

od;

Add(T,i);

od;

sz; # (The value of sz is equal to Szeged index of the graph)

pi; # (The value of pi is equal to PI index of the graph)

In this section we compute the Szeged and PI indices of _{5}_{7}_{5}_{7}

We denote the number of heptagons in the first row by p. In this nanotube the four first rows of vertices and edges are repeated alternatively; we denote the number of this repetition by q. In each period there are

The following program is the same as the last program. In this program, value of x is the number of vertex

p:=6;q:=7;# (for example)

n:=16*p*q+2*p;

N:=[];

for i in [1..5*p] do

if i mod 5=1 then N[i]:=[i-1,i+1,(3/5)*(i-1)+1+5*p];

elif i mod 5 in [0,2] then N[i]:=[i-1,i+1];

elif i mod 5=3 then N[i]:=[i-1,i+1,(3/5)*(i-3)+2+5*p];

elif i mod 5=4 then N[i]:=[i-1,i+1,(3/5)*(i-4)+3+5*p];fi;

N[1]:=[2,5*p,5*p+1];

N[5*p]:=[1,5*p-1];

od;

K:=[5*p+1..16*p*q];

K1:=Filtered(K,i->i mod (16*p) in [1..5*p]);

for i in K1 do

x:=(i) mod (16*p);

if x mod 5=1 then N[i]:=[i-1,i+1,(3/5)*(x-1)+1+i-x+5*p];

elif x mod 5=2 then N[i]:=[i-1,i+1,(3/5)*(x-2)+1+i-x-3*p];

elif x mod 5=3 then N[i]:=[i-1,i+1,(3/5)*(x-3)+2+i-x+5*p];

elif x mod 5=4 then N[i]:=[i-1,i+1,(3/5)*(x-4)+3+i-x+5*p];

elif x mod 5=0 then N[i]:=[i-1,i+1,(3/5)*x+i-x-3*p];fi;

if x=1 then N[i]:=[i+1,i-1+5*p,i+(5*p)];fi;

if x=5*p then N[i]:=[i-1,i-5*p,i+1-5*p];fi;

od;

K2:=Filtered(K,i->i mod (16*p) in[5*p+1..8*p]);

for i in K2 do

x:=(i- 5*p) mod (16*p);

if x mod 3 =1 then N[i]:=[i-1,i+1,(5/3)*(x-1)+1+i-x- 5*p];

elif x mod 3 =2 then N[i]:=[i-1,(5/3)*(x-2)+3+i-x- 5*p,(5/3)*(x-2)+3+i-x+3*p];

elif x mod 3 =0 then N[i]:=[i+1,(5/3)*x-1+i-x- 5*p,(5/3)*x +i-x+3*p];fi;

if x=3*p then N[i]:=[i-3*p+1,(5/3)*x-1+i-x- 5*p,(5/3)*x +i-x+3*p];fi;

if x=1 then N[i]:=[i-5*p,i+1,i-1+3*p];fi;

od;

K3:=Filtered(K,i->i mod (16*p) in [8*p+1..13*p]);

for i in K3 do

x:=(i- 8*p) mod (16*p);

if x mod 5=1 then N[i]:=[i-1,i+1,(3/5)*(x-1) +i-x+5*p];

elif x mod 5=2 then N[i]:=[i-1,i+1,(3/5)*(x-2)+1+i-x+5*p];

elif x mod 5=3 then N[i]:=[i-1,i+1,(3/5)*(x-3)+2+i-x-3*p];

elif x mod 5=4 then N[i]:=[i-1,i+1,(3/5)*(x-4)+2+i-x+5*p];

elif x mod 5=0 then N[i]:=[i-1,i+1,(3/5)*x +i-x-3*p];fi;

if x=1 then N[i]:=[i+1,i-1+5*p,i-1+8*p];fi;

if x=5*p then N[i]:=[i-1,i-5*p,i+1-5*p];fi;

od;

K4:=Filtered(K,i->i mod (16*p) in Union([13*p+1..16*p-1],[0]));

for i in K4 do

x:=(i-13*p) mod (16*p);

if x mod 3=1 then N[i]:=[i+1,(5/3)*(x-1)+2+i-x-5*p,(5/3)*(x-1)+2+i-x+3*p];

elif x mod 3=2 then N[i]:=[i-1,i+1,(5/3)*(x-2)+4+i-x-5*p];

elif x mod 3=0 then N[i]:=[i-1,(5/3)*x+1+i-x-5*p,(5/3)*x+i-x+3*p];fi;

if x=3*p then N[i]:=[i-1,i+1-8*p,(5/3)*x+i-x+3*p]; fi;

od;

K5:=[16*p*q+1..n];

for i in K5 do

x:=i mod(16*p);

if x mod 2=0 then y:=(3/2)*x+i-x-3*p;

else y:=(3/2)*(x-1)+1+i-x-3*p;fi;

N[i]:=[y];

N[y][3]:=i;

od;

D:=[];

for i in [1..n] do

D[i]:=[];

u:=[i];

D[i][1]:=N[i];

u:=Union(u,D[i][1]);

s:=1;

t:=1;

while s<>0 do

D[i][t+1]:=[];

for j in D[i][t] do

for m in Difference(N[j],u) do

AddSet(D[i][t+1],m);

od;

od;

u:=Union(u,D[i][t+1]);

if D[i][t+1]=[] then

s:=0;

fi;

t:=t+1;

od;

od;

T:=[];

sz:=0;

pi:=0;

for i in [1..n-1] do

N1:=[];

for j in Difference(N[i],T) do

N2:=[];

N1[j]:=Union(Difference(N[i],Union([j],N[j])),[i]);

N2[i]:=Union(Difference(N[j],Union([i],N[i])),[j]);

for t in [2..Size(D[i])-1] do

for x in Difference(D[i][t],Union(D[j][t],[j])) do

if not x in D[j][t-1] then

AddSet(N1[j],x);

elif x in D[j][t-1] then

AddSet(N2[i],x);

fi;

od;

od;

sz:=sz+Size(N1[j])*Size(N2[i]);

pi:=pi+Size(N1[j])+Size(N2[i]);

od;

Add(T,i);

od;

sz;# (The value of sz is equal to Szeged index of the graph)

pi;# (The value of pi is equal to PI index of the graph)

It takes a long time to compute the Szeged and PI indices of a graph theoretically, especially when the graph has many vertices. According to the algorithm presented in this paper and using the GAP program, we can write a program to compute these indices quickly. This method has been used here for the first time. We teste the algorithm to calculate the Szeged and PI indices of denderimers _{k,d}_{5}_{7} [ _{5}_{7} [

This research is supported by Payame Noor University.

_{5}

_{7}

_{5}

_{7}

_{4}

_{8}

_{4}

_{8}

_{4}C

_{8}(S)

Molecular graphs of dendrimers _{k,d}

_{5}_{7}

Rows of m-th period.

HC_{5}C_{7} [