nd.centrality {NetworkDistance} | R Documentation |
Centrality Distance
Description
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.
Usage
nd.centrality(
A,
out.dist = TRUE,
mode = c("Degree", "Close", "Between"),
directed = FALSE
)
Arguments
A |
a list of length |
out.dist |
a logical; |
mode |
type of node centrality definitions to be used. |
directed |
a logical; |
Value
a named list containing
- D
an
(N\times N)
matrix ordist
object containing pairwise distance measures.- features
an
(N\times M)
matrix where rows are node centralities for each graph.
References
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.
Examples
## 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)