Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
157 views
ubuntu2004
Kernel: SageMath 9.8
for n in range(3, 9): for m in range(n, n+1): L=list(graphs(n, size=m)) C=[] for g in L: if g.is_connected(): C.append(g) print('(n, m)=(', n,',', m, ') ') D=[] max=0 for g in C: E=g.edges() sum=0 for e in E: sum=sum+(1/(g.degree(e[0]))^2+1/(g.degree(e[1]))^2)^(1/2) if max<sum: max=sum D=[];D.append(g) else: if max==sum: D.append(g) print('maximum value=',max) print('All the extremal (',n,',',m,')-graphs with maximum BSO are') graphs_list.show_graphs(D)
(n, m)=( 3 , 3 ) maximum value= 3*sqrt(1/2) All the extremal ( 3 , 3 )-graphs with maximum BSO are
/tmp/ipykernel_525/2545000740.py:12: DeprecationWarning: parameter 'sort' will be set to False by default in the future See https://trac.sagemath.org/27408 for details. E=g.edges()
Image in a Jupyter notebook
(n, m)=( 4 , 4 ) maximum value= 1/3*sqrt(13) + 1/3*sqrt(10) + sqrt(1/2) All the extremal ( 4 , 4 )-graphs with maximum BSO are
Image in a Jupyter notebook
(n, m)=( 5 , 5 ) maximum value= 1/2*sqrt(17) + 1/2*sqrt(5) + sqrt(1/2) All the extremal ( 5 , 5 )-graphs with maximum BSO are
/tmp/ipykernel_525/2545000740.py:12: DeprecationWarning: parameter 'sort' will be set to False by default in the future See https://trac.sagemath.org/27408 for details. E=g.edges()
Image in a Jupyter notebook
(n, m)=( 6 , 6 ) maximum value= 1/5*sqrt(29) + 3/5*sqrt(26) + sqrt(1/2) All the extremal ( 6 , 6 )-graphs with maximum BSO are
Image in a Jupyter notebook
(n, m)=( 7 , 7 ) maximum value= 2/3*sqrt(37) + 2/3*sqrt(5/2) + sqrt(1/2) All the extremal ( 7 , 7 )-graphs with maximum BSO are
Image in a Jupyter notebook
(n, m)=( 8 , 8 ) maximum value= 1/7*sqrt(53) + 25/7*sqrt(2) + sqrt(1/2) All the extremal ( 8 , 8 )-graphs with maximum BSO are
Image in a Jupyter notebook
n=4 R=[] L=list(graphs(n)) for g in L: E=g.edges() s=0 if g.is_connected(): for e in E: if abs(g.degree(e[0])-g.degree(e[1]))==2: s=s+1 if s==g.size(): R.append(g) graphs_list.show_graphs(R)
/tmp/ipykernel_536/13688642.py:5: DeprecationWarning: parameter 'sort' will be set to False by default in the future See https://trac.sagemath.org/27408 for details. E=g.edges()
Image in a Jupyter notebook
n=6 m=6 R=[] L=list(graphs(n, size=m)) for g in L: if g.is_connected(): R.append(g) graphs_list.show_graphs(R)
Image in a Jupyter notebook