Skip to main content

laplacian

Function laplacian 

Source
pub fn laplacian(
    g: &Graph,
    normed: bool,
    use_out_degree: bool,
) -> (Vec<Vec<f64>>, Vec<f64>)
Expand description

The Laplacian L = D − A of a weighted graph, as a dense matrix, and the degrees (SciPy’s laplacian). A is the weighted adjacency matrix (parallel edges summed, loops ignored) and D the diagonal of degrees: the in-degrees (column sums) by default, the out-degrees (row sums) with use_out_degree; the two agree for undirected graphs. With normed, the symmetric normalisation I − D^{−1/2} A D^{−1/2}, with isolated vertices left at 0 on the diagonal; the returned degrees are then their square roots (1 for isolated vertices), as SciPy returns them.