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())]
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.