normalized_laplacian#

tangles.util.graph.normalized_laplacian(adj: spmatrix | ndarray) csr_matrix | ndarray | None#

Compute the normalized laplacian \(L' = I - D^{-1/2} A D^{-1/2}\), where \(A\) is the adjacency matrix of a graph \(G\) and \(D\) is the diagonal matrix containing the degrees of \(G\).

Parameters#

adjsparse.spmatrix or np.ndarray

Adjacency matrix.

Returns#

scipy.sparse.csr_matrix or np.ndarray

The normalized laplacian matrix.