def laplacian_spectrum(G, weight='weight'):
 from scipy.linalg import eigvalsh
 return eigvalsh(nx.laplacian_matrix(G, weight=weight).todense())

def laplacian_spectrum ( G , weight = 'weight' ) : from scipy . linalg import eigvalsh return eigvalsh ( nx . laplacian_matrix ( G , weight = weight ) . todense ( ) )
return eigenvalues of the laplacian of g parameters g : graph a networkx graph weight : string or none .