Skip to contents

Compute sparse α-lazy random-walk normalized graph Laplacian `L = I - α D⁻¹ W`

Usage

compute_graph_laplacian_sparse(W_sparse, alpha = 0.93, degree_type = "abs")

Arguments

W_sparse

A sparse, symmetric adjacency matrix (`Matrix::dgCMatrix`, `V_p x V_p`). Symmetry is verified using Matrix::isSymmetric() (tolerance 1e-8); the function stops with an error if the matrix is not symmetric.

alpha

Numeric, the laziness parameter. Default is 0.93. Will be clamped to `[epsilon, 1]` range if outside `(0,1]`.

degree_type

Character string, how to calculate node degrees if `W_sparse` has negative values. One of `"abs"` (default, sum of absolute weights), `"positive"` (sum of positive weights only), or `"signed"` (sum of raw weights). Documented for clarity.

Value

A sparse, symmetric graph Laplacian matrix (`Matrix::dgCMatrix`, `V_p x V_p`).