Network.laplacian

Network.laplacian(weight=None, reduced: bool = False, return_as: str = 'csr') scipy.sparse.base.spmatrix[source]

Get the (weighted) Laplacian matrix L.

Parameters
weightfloat or np.ndarray, optional

If None, unit weight is assumed for all edges. If float, all edges have the same weight.

reducedbool, default=False

Whether to return the reduced form, i.e., without first row and first column.

return_asstr, default=’csr’

Return format for sparse matrix.

Returns
Lspmatrix

Laplacian matrix of shape (n, n) if reduced is False, else of shape (n-1, n-1). Type of return matrix is determined by parameter return_as.

References

1

https://en.wikipedia.org/wiki/Laplacian_matrix