Learn R Programming

BioGSP (version 1.0.0)

cal_laplacian: Calculate Graph Laplacian Matrix

Description

Compute unnormalized, normalized, or random-walk Laplacian from an adjacency matrix.

Usage

cal_laplacian(W, type = c("unnormalized", "normalized", "randomwalk"))

Value

Laplacian matrix of the same class as input.

Arguments

W

A square adjacency matrix (can be dense or sparse).

type

Type of Laplacian to compute: "unnormalized", "normalized", or "randomwalk".

Examples

Run this code
# \donttest{
W <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), nrow = 3)
cal_laplacian(W, type = "normalized")
# }

Run the code above in your browser using DataLab