nd.centrality {NetworkDistance} | R Documentation |
Centrality is a core concept in studying the topological structure of
complex networks, which can be either defined for each node or edge.
nd.centrality
offers 3 distance measures on node-defined centralities.
See this Wikipedia page for more
on network/graph centrality.
nd.centrality(
A,
out.dist = TRUE,
mode = c("Degree", "Close", "Between"),
directed = FALSE
)
A |
a list of length |
out.dist |
a logical; |
mode |
type of node centrality definitions to be used. |
directed |
a logical; |
a named list containing
an (N\times N)
matrix or dist
object containing pairwise distance measures.
an (N\times M)
matrix where rows are node centralities for each graph.
Roy M, Schmid S, TrĂ©dan G (2014). “Modeling and Measuring Graph Similarity: The Case for Centrality Distance.” In FOMC 2014, 10th ACM International Workshop on Foundations of Mobile Computing, 53.
## load example data
data(graph20)
## use 3 types of centrality measures
out1 <- nd.centrality(graph20, out.dist=FALSE,mode="Degree")
out2 <- nd.centrality(graph20, out.dist=FALSE,mode="Close")
out3 <- nd.centrality(graph20, out.dist=FALSE,mode="Between")
## visualize
opar = par(no.readonly=TRUE)
par(mfrow=c(1,3), pty="s")
image(out1$D[,20:1], main="Degree", col=gray(0:32/32), axes=FALSE)
image(out2$D[,20:1], main="Close", col=gray(0:32/32), axes=FALSE)
image(out3$D[,20:1], main="Between", col=gray(0:32/32), axes=FALSE)
par(opar)