getCommunityConnectedness function

Calculate Community Connectedness or Modularity

Calculate Community Connectedness or Modularity

This function returns a measure of how relatively outwardly or inwardly connected a community is.

getCommunityConnectedness(x, clusterids = 1:x$numbers[3], conn = "conn", normalise = TRUE, verbose = FALSE)

Arguments

  • x: An object of class linkcomm.
  • clusterids: An integer vector of community IDs. Defaults to all communities.
  • conn: A character string naming the connectedness measure to use. Can be one of "conn" or "mod" (see Details below). Defaults to "conn".
  • normalise: Logical, whether to normalise community connectedness measures by the number of nodes in individual communities. Defaults to TRUE.
  • verbose: Logical, whether to display the progress of the calculation on the screen. Defaults to FALSE.

Details

The connectedness and modularity of different communities indicates whether a particular community is bridging several other communities, or existing as a relatively isolated module. The modularity of community i is

Mi=(ew(i)ni(ni1)/2).(eb(i)nid^)1M(i)=(ew(i)/ni(ni1)/2).(eb(i)/nid)1 M_{i}=\left(\frac{e_{w}(i)}{n_{i}(n_{i}-1)/2}\right).\left(\frac{e_{b}(i)}{n_{i}\hat{d}}\right)^{-1}M(i) = (e_{w}(i)/n_{i}(n_{i}-1)/2).(e_{b}(i)/n_{i}*d)^-1

where ew(i)e_{w}(i) is the number of edges within community i, eb(i)e_{b}(i) is the number of edges community i makes to other communities, nin_{i} is the number of nodes in community i, and d^\hat{d} is the average degree in the network. Community connectedness is the inverse of this value.

Returns

A named numerical vector, where the names are community IDs and the numbers are community connectedness or modularity scores.

References

Kalinka, A.T. and Tomancak, P. (2011). linkcomm: an R package for the generation, visualization, and analysis of link communities in networks of arbitrary size and type. Bioinformatics 27 , 2011-2012.

Author(s)

Alex T. Kalinka alex.t.kalinka@gmail.com

See Also

getCommunityCentrality

Examples

## Generate graph and extract link communities. g <- swiss[,3:4] lc <- getLinkCommunities(g) ## Get community connectedness. cc <- getCommunityConnectedness(lc, normalise = FALSE)
  • Maintainer: Alex T. Kalinka
  • License: GPL (>= 2)
  • Last published: 2021-02-04