Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Like that

[G for G in graphs.nauty_geng("8 -c")
if all(f.degree() <= 1 for f, d in G.laplacian_matrix().charpoly().factor())]

Like that

L = [G for G in graphs.nauty_geng("8 -c")
 if all(f.degree() <= 1 for f, d in G.laplacian_matrix().charpoly().factor())]

Then you have a list of graphs. You can then use

graphics_array([G.plot() for G in L])

or any other way to display them.