Comuna.NET - A community analysis, tracking and graphing library for social networks written in C#
![]() | 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.

Namespace: Comuna
Assembly: Comuna (in Comuna.dll) Version: 1.0.0

The CommunityAlgorithm type exposes the following members.

Name | Description | |
---|---|---|
![]() | CommunityAlgorithm |
Creates a new CommunityAlgorithm according to the provided graph.
|

Name | Description | |
---|---|---|
![]() | Communities |
Gets the set of nodes belonging to each community.
|
![]() | MinModularity |
Gets the minimal modularity difference between passes. If 0, even a minor increase is enough to perform one more
pass.
|
![]() | Network |
Gets the network graph used to compute communities.
|
![]() | NodesCommunities |
Gets the community of each node.
|
![]() | NumPasses |
Gets the number of passes for one level computation. If -1, the algorithm computes as many passes as needed to
increase modularity.
|
![]() | Size |
Gets the number of nodes in the network and size of all vectors.
|

Name | Description | |
---|---|---|
![]() | DisplayCommunities |
Displays the nodes belonging to each community.
|
![]() | DisplayCommunityGraph |
Displays the graph of the existing communities, i.e., without the nodes.
|
![]() | DisplayNodesCommunities |
Displays the community that each node in the network belongs to.
|
![]() | DisplayPartition |
Displays the current partition (with communities renumbered from 0 to k-1).
|
![]() | Dispose | Releases all resources used by the CommunityAlgorithm |
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetCommunityNetwork |
Generates a Network of the existing communities, i.e., without the nodes.
|
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetModularity |
Gets the modularity of the current community partition.
|
![]() | GetNumberCommunities |
Gets the number of active communities, i.e., the communities with one or more elements belonging to it.
|
![]() | GetType | (Inherited from Object.) |
![]() | LoadFromFile |
Initializes the community partition with the information stored in the given file.
|
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | RenumberCommunities |
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.
|
![]() | ToString | (Inherited from Object.) |
![]() | Update |
Computes communities in the graph iteratively until there are changes in any node's community or the changes in
modularity are large enough.
|

Name | Description | |
---|---|---|
![]() | ToD3GraphFile |
Saves the network of the given CommunityAlgorithm to a d3.js graph file.
(Defined by D3Extensions.) |
![]() | ToGraphvizFile |
Saves the given Network to an image file.
(Defined by Extensions.) |

[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.
