NormalizedLaplacian: Construct and use the Normalized Laplacian

View source: R/NormalizedLaplacian.R

NormalizedLaplacianR 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 L(A) of an n by n graph adjacency matrix A as

L[ij] = A[ij] / sqrt(d^out[i] d^in[j])

where

d^out[i] = sum_j abs(A[ij])

and

d^in[j] = sum_i abs(A[ij]).

When A[ij] denotes the present of an edge from node i to node j, which is fairly standard notation, d^out[i] denotes the (absolute) out-degree of node i and d^in[j] denotes the (absolute) in-degree of node j.

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)


invertiforms documentation built on Nov. 25, 2022, 5:05 p.m.