CommunityAlgorithm Class

Comuna.NET

CommunityAlgorithm Class

Implements the "Louvain method" for finding communities in large networks as described in [1]. The code corresponds to a c# adaptation of the c++ code in https://sites.google.com/site/findcommunities/. A feature was added so that multiple updates to the underlying network connections (graph links) is supported, i.e., it allows the analysis of the evolution of communities in a network.
Inheritance Hierarchy
SystemObject  ComunaCommunityAlgorithm

Namespace:  Comuna
Assembly:  Comuna (in Comuna.dll) Version: 1.0.0
Syntax
C#
public class CommunityAlgorithm : IDisposable
Request Example View Source

The CommunityAlgorithm type exposes the following members.

Constructors
  NameDescription
Public methodCommunityAlgorithm
Creates a new CommunityAlgorithm according to the provided graph.
Top
Properties
  NameDescription
Public propertyCommunities
Gets the set of nodes belonging to each community.
Public propertyMinModularity
Gets the minimal modularity difference between passes. If 0, even a minor increase is enough to perform one more pass.
Public propertyNetwork
Gets the network graph used to compute communities.
Public propertyNodesCommunities
Gets the community of each node.
Public propertyNumPasses
Gets the number of passes for one level computation. If -1, the algorithm computes as many passes as needed to increase modularity.
Public propertySize
Gets the number of nodes in the network and size of all vectors.
Top
Methods
  NameDescription
Public methodDisplayCommunities
Displays the nodes belonging to each community.
Public methodDisplayCommunityGraph
Displays the graph of the existing communities, i.e., without the nodes.
Public methodDisplayNodesCommunities
Displays the community that each node in the network belongs to.
Public methodDisplayPartition
Displays the current partition (with communities renumbered from 0 to k-1).
Public methodDispose
Releases all resources used by the CommunityAlgorithm
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetCommunityNetwork
Generates a Network of the existing communities, i.e., without the nodes.
Public methodGetHashCode (Inherited from Object.)
Public methodGetModularity
Gets the modularity of the current community partition.
Public methodGetNumberCommunities
Gets the number of active communities, i.e., the communities with one or more elements belonging to it.
Public methodGetType (Inherited from Object.)
Public methodLoadFromFile
Initializes the community partition with the information stored in the given file.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRenumberCommunities
Renumbers each community according to the total number of communities (larger first) and by changing their ID to the lowest one possible. Tries to keep communities IDs if possible to avoid renumbering.
Public methodToString (Inherited from Object.)
Public methodUpdate
Computes communities in the graph iteratively until there are changes in any node's community or the changes in modularity are large enough.
Top
Extension Methods
  NameDescription
Public Extension MethodToD3GraphFile
Saves the network of the given CommunityAlgorithm to a d3.js graph file.
(Defined by D3Extensions.)
Public Extension MethodToGraphvizFile
Saves the given Network to an image file.
(Defined by Extensions.)
Top
Remarks
[1] - Blondel, V. D., Guillaume, J. L., Lambiotte, R., & Lefebvre, E. (2008). Fast unfolding of communities in large networks. Journal of statistical mechanics: theory and experiment, 2008(10), Bristol: IOP Publishing Ltd.
See Also