Class GirvanNewman<U>
java.lang.Object
es.uam.eps.ir.relison.sna.community.detection.modularity.GirvanNewman<U>
- Type Parameters:
U- type of the users.
- All Implemented Interfaces:
CommunityDetectionAlgorithm<U>,DendogramCommunityDetectionAlgorithm<U>
public class GirvanNewman<U> extends java.lang.Object implements CommunityDetectionAlgorithm<U>, DendogramCommunityDetectionAlgorithm<U>
Implementation of the Girvan-Newman community detection algorithm, based on removing edges with the highest
betweenness value.
Reference: M. Girvan, M.E.J. Newman. Community structure in social and biological networks, Proc. Natl. Acad. Sci. USA 99, 7821–7826 (2002)
-
Field Summary
Fields Modifier and Type Field Description private intoptimalNumCommsThe optimal number of communities. -
Constructor Summary
Constructors Constructor Description GirvanNewman() -
Method Summary
Modifier and Type Method Description Communities<U>detectCommunities(Graph<U> graph)Computes the communities for a certain graph.Dendogram<U>detectCommunityDendogram(Graph<U> graph)Computes the community dendogram for a certain graph.
-
Field Details
-
optimalNumComms
private int optimalNumCommsThe optimal number of communities.
-
-
Constructor Details
-
GirvanNewman
public GirvanNewman()
-
-
Method Details
-
detectCommunities
Description copied from interface:CommunityDetectionAlgorithmComputes the communities for a certain graph.- Specified by:
detectCommunitiesin interfaceCommunityDetectionAlgorithm<U>- Parameters:
graph- The full graph.- Returns:
- The communities if everything went OK, null if not.
-
detectCommunityDendogram
Description copied from interface:DendogramCommunityDetectionAlgorithmComputes the community dendogram for a certain graph.- Specified by:
detectCommunityDendogramin interfaceDendogramCommunityDetectionAlgorithm<U>- Parameters:
graph- The full graph.- Returns:
- The dendogram if everything went OK, null if not.
-