Title: | Fast Network Modularity and Roles Computation by Simulated Annealing (Rgraph C Library Wrapper for R) |
---|---|
Description: | Provides functions to compute the modularity and modularity-related roles in networks. It is a wrapper around the rgraph library (Guimera & Amaral, 2005, <doi:10.1038/nature03288>). |
Authors: | Daniel B. Stouffer [cre, aut, ths] (Maintainer), Guilhem Doulcier [aut] (R bindings, current implementation of the simulated annealing algorithm), Roger Guimera [ctb] (Author of the original rgraph library) |
Maintainer: | Daniel B. Stouffer <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.2.6 |
Built: | 2024-11-07 06:37:38 UTC |
Source: | CRAN |
Compute modularity and modularity roles for graphs using simulated annealing
netcarto( web, seed = as.integer(floor(runif(1, 1, 100000001))), iterfac = 1, coolingfac = 0.995, bipartite = FALSE )
netcarto( web, seed = as.integer(floor(runif(1, 1, 100000001))), iterfac = 1, coolingfac = 0.995, bipartite = FALSE )
web |
network either as a square adjacency matrix or a list describing E interactions a->b: the first (resp. second) element is the vector of the labels of a (resp. b), the third (optional) is the vector of interaction weights. |
seed |
Seed for the random number generator: Must be a positive integer. |
iterfac |
At each temperature of the simulated annealing (SA), the program performs fN^2 individual-node updates (involving the movement of a single node from one module to another) and fN collective updates (involving the merging of two modules and the split of a module). The number "f" is the iteration factor. |
coolingfac |
Temperature cooling factor. |
bipartite |
If True use the bipartite definition of modularity. |
A list. The first element is a dataframe with the name, module, z-score, and participation coefficient for each row of the input matrix. The second element is the modularity of this partition.
# Generate a simple random network a = matrix(as.integer(runif(100)<.3), ncol=10) a[lower.tri(a)] = 0 # Find an optimal partition for modularity using netcarto. netcarto(a)
# Generate a simple random network a = matrix(as.integer(runif(100)<.3), ncol=10) a[lower.tri(a)] = 0 # Find an optimal partition for modularity using netcarto. netcarto(a)