NetworkX

Previous topic

networkx.linalg.spectrum.adj_matrix

Next topic

networkx.linalg.spectrum.normalized_laplacian

networkx.linalg.spectrum.laplacian

networkx.linalg.spectrum.laplacian(G, nodelist=None)

Return the Laplacian matrix of G.

The graph Laplacian is the matrix L = D - A, where A is the adjacency matrix and D is the diagonal matrix of node degrees.

Parameters :

G : graph

A NetworkX graph

nodelist : list, optional

The rows and columns are ordered according to the nodes in nodelist. If nodelist is None, then the ordering is produced by G.nodes().

Returns :

L : NumPy matrix

Laplacian of G.