NormalizedLaplacian {invertiforms} | R Documentation |
Construct and use the Normalized Laplacian
Description
A convenience function to create NormalizedLaplacian S4 objects, which are useful for finding the normalized Laplacian of the adjacency matrix of a graph.
Usage
NormalizedLaplacian(A)
## S4 method for signature 'NormalizedLaplacian,sparseMatrix'
transform(iform, A)
## S4 method for signature 'NormalizedLaplacian,sparseMatrix'
inverse_transform(iform, A)
Arguments
A |
A matrix to transform. |
iform |
An Invertiform object describing the transformation. |
Details
We define the normalized Laplacian of an
graph adjacency matrix
as
where
and
When denotes the present of an edge from node
to node
, which is fairly standard notation,
denotes the (absolute) out-degree of node
and
denotes the (absolute) in-degree
of node
.
Note that this documentation renders most clearly at https://rohelab.github.io/invertiforms/.
Value
-
NormalizedLaplacian()
creates a NormalizedLaplacian object. -
transform()
returns the transformed matrix, typically as a Matrix. -
inverse_transform()
returns the inverse transformed matrix, typically as a Matrix.
Examples
library(igraph)
library(igraphdata)
data("karate", package = "igraphdata")
A <- get.adjacency(karate)
iform <- NormalizedLaplacian(A)
L <- transform(iform, A)
A_recovered <- inverse_transform(iform, L)
all.equal(A, A_recovered)