nd_centrality function

Centrality Distance

Centrality Distance

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 )

Arguments

  • A: a list of length NN containing (M×M)(M\times M) adjacency matrices.
  • out.dist: a logical; TRUE for computed distance matrix as a dist object.
  • mode: type of node centrality definitions to be used.
  • directed: a logical; FALSE as symmetric, undirected graph.

Returns

a named list containing

  • D: an (N×N)(N\times N) matrix or dist object containing pairwise distance measures.
  • features: an (N×M)(N\times M) matrix where rows are node centralities for each graph.

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)

References

Rdpack::insert_ref(key="roy_modeling_2014",package="NetworkDistance")

  • Maintainer: Kisung You
  • License: MIT + file LICENSE
  • Last published: 2021-08-21

Useful links