| 1 | initial version |
The following code tells that the max absolute value of determinant is 9 and there are 4 such graphs achieving it:
maxdet = 0
res = []
for G in graphs.nauty_geng('-c 10 12'):
if G.is_bipartite() or G.matching_polynomial()[0]!=-1:
continue
d = abs(G.adjacency_matrix().det())
if d>maxdet:
res = []
maxdet = d
if d==maxdet:
res.append(G)
print('Max:',maxdet)
print('#graphs:', len(res))
| 2 | No.2 Revision |
The following code tells that the max absolute value of determinant is 9 and there are 4 such graphs achieving it:
maxdet = 0
res = []
for G in graphs.nauty_geng('-c 10 12'):
if G.is_bipartite() or G.matching_polynomial()[0]!=-1:
abs(G.matching_polynomial()[0])!=1:
continue
d = abs(G.adjacency_matrix().det())
if d>maxdet:
res = []
maxdet = d
if d==maxdet:
res.append(G)
print('Max:',maxdet)
print('#graphs:', len(res))
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.