Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 5 years ago

FrédéricC gravatar image

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())]
click to hide/show revision 2
No.2 Revision

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.