R igraph 手册页

如果您从 R 中使用 igraph,请使用此选项

scg_semi_proj {igraph}R 文档

半投影算子

描述

一个计算给定顶点划分的 LR 半投影算子的函数。

用法

scg_semi_proj(
  groups,
  mtype = c("symmetric", "laplacian", "stochastic"),
  p = NULL,
  norm = c("row", "col"),
  sparse = igraph_opt("sparsematrices")
)

参数

groups

一个长度为 nrow(X)vcount(X) 的整数向量,给出划分中每个顶点的组标签。

mtype

半投影算子的类型。目前,“symmetric”、“laplacian” 和 “stochastic” 可用。

p

一个长度为 length(gr) 的概率向量。当 mtype = “stochastic” 时,p 是马尔可夫链的平稳概率分布。在所有其他情况下,此参数将被忽略。

norm

“row” 或 “col”。如果设置为 “row”,则拉普拉斯矩阵的行总和为零,而随机矩阵的行总和为 1;否则为列。

sparse

逻辑标量,是否返回稀疏矩阵。

详细信息

三种类型的半投影算子定义如下。设 \gamma(j) 标记所有顶点的划分中顶点 j 的组。

对称半投影算子定义为

L_{\alpha j}=R_{\alpha j}=

\frac{1}{\sqrt{|\alpha|}}\delta_{\alpha\gamma(j)},

(行) 拉普拉斯半投影算子定义为

L_{\alpha j}=\frac{1}{|\alpha|}\delta_{\alpha\gamma(j)}\,\,\,\,

\textrm{和}\,\,\,\, R_{\alpha j}=\delta_{\alpha\gamma(j)},

和 (行) 随机半投影算子定义为

L_{\alpha j}=\frac{p_{1}(j)}{\sum_{k\in\gamma(j)}p_{1}(k)}\,\,\,\,

\textrm{和}\,\,\,\, R_{\alpha j}=\delta_{\alpha\gamma(j)\delta_{\alpha\gamma(j)}},

其中 p_1 是与随机矩阵的特征值 1 相关的 (左) 特征向量。 当 norm = col 时,LR 以对称方式定义。 所有这些半投影算子都验证了参考文献中描述的各种属性。

L

半投影算子 L

R

半投影算子 R

作者

David Morton de Lachapelle, http://people.epfl.ch/david.morton.

参考

D. Morton de Lachapelle, D. Gfeller, and P. De Los Rios, Shrinking Matrices while Preserving their Eigenpairs with Application to the Spectral Coarse Graining of Graphs. Submitted to SIAM Journal on Matrix Analysis and Applications, 2008. http://people.epfl.ch/david.morton

参见

scg-method 获取详细介绍. scg, scg_eps, scg_group

示例


library(Matrix)
# compute the semi-projectors and projector for the partition
# provided by a community detection method
g <- sample_pa(20, m = 1.5, directed = FALSE)
eb <- cluster_edge_betweenness(g)
memb <- membership(eb)
lr <- scg_semi_proj(memb)
#In the symmetric case L = R
tcrossprod(lr$R)  # same as lr$R %*% t(lr$R)
P <- crossprod(lr$R)  # same as t(lr$R) %*% lr$R
#P is an orthogonal projector
isSymmetric(P)
sum( (P %*% P-P)^2 )

## use L and R to coarse-grain the graph Laplacian
lr <- scg_semi_proj(memb, mtype="laplacian")
L <- laplacian_matrix(g)
Lt <- lr$L %*% L %*% t(lr$R)
## or better lr$L %*% tcrossprod(L,lr$R)
rowSums(Lt)


[包 igraph 版本 1.3.5 索引]