degree sequence

164 days ago by Buyan

n=8 t=5 L=list(graphs(n)) R=[] for g in L: if g.is_connected() and g.degree_sequence()[0]==t and g.degree_sequence()[n-1]==1: w=0 for i in range(1,n): if g.degree_sequence()[i-1]-g.degree_sequence()[i]<2: w=w+1 if w==n-1: R.append(g) print 'R has been constructed' 
       
R has been constructed
R has been constructed
graphs_list.show_graphs(R) 
       






































for g in R: print g.degree_sequence() 
       
WARNING: Output truncated!  
full_output.txt



[5, 4, 3, 2, 1, 1, 1, 1]
[5, 4, 3, 2, 2, 2, 1, 1]
[5, 4, 3, 2, 1, 1, 1, 1]
[5, 4, 3, 3, 2, 1, 1, 1]
[5, 4, 3, 2, 2, 2, 1, 1]
[5, 4, 3, 3, 2, 1, 1, 1]
[5, 4, 3, 3, 2, 1, 1, 1]
[5, 4, 3, 3, 2, 1, 1, 1]
[5, 4, 3, 2, 2, 2, 1, 1]
[5, 4, 3, 3, 3, 2, 1, 1]
[5, 4, 3, 3, 2, 2, 2, 1]
[5, 4, 3, 2, 2, 2, 1, 1]
[5, 4, 3, 3, 3, 2, 1, 1]
[5, 4, 3, 2, 2, 2, 1, 1]
[5, 4, 4, 3, 2, 2, 1, 1]
[5, 4, 4, 3, 2, 2, 1, 1]
[5, 4, 3, 2, 2, 2, 1, 1]
[5, 4, 4, 3, 2, 2, 1, 1]
[5, 4, 3, 3, 3, 2, 1, 1]
[5, 5, 4, 3, 3, 2, 1, 1]
[5, 5, 4, 3, 3, 2, 1, 1]
[5, 4, 4, 4, 3, 2, 1, 1]
[5, 4, 3, 3, 3, 2, 1, 1]
[5, 4, 3, 3, 3, 2, 1, 1]
[5, 4, 4, 3, 2, 2, 1, 1]
[5, 5, 4, 3, 3, 2, 1, 1]
[5, 4, 3, 3, 3, 2, 1, 1]
[5, 4, 3, 3, 3, 2, 1, 1]
[5, 4, 3, 3, 3, 2, 1, 1]
[5, 4, 4, 3, 2, 2, 1, 1]
[5, 4, 3, 3, 3, 2, 1, 1]
[5, 5, 4, 3, 3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3, 2, 2, 2, 1]
[5, 5, 4, 3, 2, 2, 2, 1]
[5, 4, 3, 3, 2, 2, 2, 1]
D=[] d=[] max=0 min=100000 for g in R: E=g.edges() sum=0 for e in E: sum=sum+abs(g.degree(e[0])-g.degree(e[1])) 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 graphs_list.show_graphs(D) print min graphs_list.show_graphs(d) 
       
32
10
32
10

for g in d: print g.degree_sequence() 
       
[5, 4, 4, 4, 4, 3, 3, 2, 1]
[5, 4, 4, 4, 4, 3, 3, 2, 1]
[5, 4, 4, 4, 4, 3, 3, 2, 1]
[5, 4, 4, 4, 4, 3, 2, 1, 1]
[5, 4, 4, 4, 4, 3, 3, 2, 1]
[5, 4, 4, 4, 4, 3, 3, 2, 1]
[5, 4, 4, 4, 4, 3, 3, 2, 1]
[5, 4, 4, 4, 4, 3, 3, 2, 1]
[5, 4, 4, 4, 4, 3, 2, 1, 1]
[5, 4, 4, 4, 4, 3, 3, 2, 1]
n=9 t=4 L=list(graphs(n)) R=[] for g in L: if g.is_connected() and g.degree_sequence()[0]==t and g.degree_sequence()[n-1]==1: w=0 for i in range(1,n): if g.degree_sequence()[i-1]-g.degree_sequence()[i]<2: w=w+1 if w==n-1: R.append(g) print 'R has been constructed' 
       
R has been constructed
R has been constructed
D=[] d=[] max=0 min=100000 for g in R: E=g.edges() sum=0 for e in E: sum=sum+abs(g.degree(e[0])-g.degree(e[1])) 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 graphs_list.show_graphs(D) print min graphs_list.show_graphs(d) 
       
22
4
22
4