aryagraph.algorithms.matrix.laplacian_matrix#

aryagraph.algorithms.matrix.laplacian_matrix(g: Any, weight: str | Callable[[Hashable, Hashable, dict], float] | None = None, *, normalized: bool = False, nodes: list[Hashable] | None = None) → ndarray[source]#

Graph Laplacian L = D - A (or I - D^-1/2 A D^-1/2 when normalized).

Directed graphs are symmetrised first (an arc in either direction links the pair); self-loops are ignored, matching the usual combinatorial definition.