sp_eigen_adj: Eigen decomposition of matrices associated with graphs

Description Usage Arguments Details Value

View source: R/graph_eigen.R

Description

Eigen decomposition of matrices associated with graphs

Usage

1
2
3
4
5
6
7
sp_eigen_adj(
  x,
  k,
  type = c("adj", "adj_sym", "adj_left", "lap", "lap_sym", "lap_left"),
  check = c("all", "symmetric", "isolates", "none"),
  set_diag_zero = FALSE
)

Arguments

x

adjacency matrix (or affiliation matrix) of a graph; must be a Matrix::sparseMatrix and symmetric

k

number of eigenparis to extract (largest algebraic values for adjacency matrix and smallest algebraic values for Laplacian matrix)

type

string that is either "adj", "adj_sym", "adj_left", "lap", "lap_sym", "lap_left", standing for, respectively, the adjacency matrix (x), the normalized (symmetric) adjacency matrix, the (left) normalized adjacency matrix, the Laplacian, the normalized (symmetric) Laplacian, or the (left) normalized Laplacian.

check

string of ether "all" (default), "isolates," "symmetric," or "none." Checks whether there are dangling nodes or whether x is asymmetric (or both/none), and throws error if so

set_diag_zero

if TRUE, the diagonals of x are set to zero before computing decomposition

Details

Let A be the adjacency matrix associated with graph G. The Laplacian is given as

L = D - A

, where D is a diagonal matrix containing the degrees. Let I be the identity matrix of same dimensions as A. Then the different versions of normalized adjacency and Laplacian matrices are defined as follows:

Normalized (symmetric) adjacency matrix:

A_{s} = D^{-1/2}AD^{-1/2}

(Left) normalized adjacency matrix:

A_{l} = D^{-1}A

Normalized (symmetric) Laplacian:

L_{s} = I - A_{s}

(Left) normalized Laplacian:

L_{l} = I - A_{l}

Value

returns the k largest/smallest eigenpairs of the requested matrix. Eigenvalues, and their corresponding eigenvectors, are ordered in decreasing order for adjacency matrices and in increasing order for Laplacian matrices.


baruuum/btoolbox documentation built on Aug. 17, 2020, 1:29 a.m.