View source: R/centrality-batch7.R
| centrality_modularity_vitality | R Documentation |
Contribution of a node to the modularity of a fixed partition (Magelinski, Bartulovic & Carley 2021):
V_Q(i) = Q(G, C) - Q(G - i,\; C \setminus \{i\}),
the drop in Newman modularity when node i is deleted and the
remaining nodes keep their communities. Positive values mark community
hubs (removing them weakens the modular structure); negative values mark
bridges (removing them sharpens it). Weighted graphs use edge weights;
directed graphs use the Leicht-Newman directed modularity, as igraph
does.
centrality_modularity_vitality(x, membership = NULL, ...)
x |
Network input (matrix, igraph, network, cograph_network, tna object). |
membership |
Community labels, one per node (integer, factor, or
character). Required; without it the function warns and returns
|
... |
Additional arguments passed to |
All n vitalities are computed in closed form from one matrix
product, without recomputing modularity n times.
Named numeric vector, one value per node. NaN where
deleting the node leaves a graph with no edges.
Raises an error of class cograph_bad_membership when
membership is not one non-missing label per node.
Magelinski, T., Bartulovic, M., & Carley, K. M. (2021). Measuring node contribution to community structure with modularity vitality. IEEE Transactions on Network Science and Engineering, 8(1), 707-723.
centrality_participation,
centrality_within_module_z,
detect_communities.
# Two triangles joined by one bridge edge (C -- D)
adj <- matrix(0, 6, 6)
adj[cbind(c(1, 1, 2, 4, 4, 5, 3), c(2, 3, 3, 5, 6, 6, 4))] <- 1
adj <- adj + t(adj)
rownames(adj) <- colnames(adj) <- LETTERS[1:6]
centrality_modularity_vitality(adj, membership = c(1, 1, 1, 2, 2, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.