Ask Your Question

Revision history [back]

click to hide/show revision 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))

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))