difference of randic and harmonic indices

572 days ago by Buyan

n=8 L=list(graphs(n)) D=[] d=[] max=0 min=1000 R=[] for g in L: if g.is_connected(): R.append(g) print 'R has been constructed' for g in R: V=g.vertices() sum=0 for v in V: for u in V: if g.has_edge(v,u): sum=sum+((g.degree(v))*(g.degree(u)))^(-1/2)-2/(g.degree(v)+g.degree(u)) if max<sum: max=sum D=[];D.append(g) else: if max==sum: D.append(g) if min>sum: min=sum d=[];d.append(g) else: if min==sum: d.append(g) print max/2 graphs_list.show_graphs(D) print min/2 graphs_list.show_graphs(d) 
       
R has been constructed
sqrt(7) - 7/4
0
R has been constructed
sqrt(7) - 7/4
0