Class BalancedFastGreedy<U>
java.lang.Object
es.uam.eps.ir.relison.sna.community.detection.modularity.balanced.BalancedFastGreedy<U>
- Type Parameters:
U
- Type of the users.
- All Implemented Interfaces:
CommunityDetectionAlgorithm<U>
public class BalancedFastGreedy<U> extends java.lang.Object implements CommunityDetectionAlgorithm<U>
Community detection algorithm for obtaining balanced communities, based on the FastGreedy algorithm
by M.E.J. Newman.
References:
- M.E.J. Newman. Fast Algorithm for detecting community structure in networks. Physical Review E 69(6): 066133 (2004)
- Huang, M., Nguyen, Q. A Fast Algorithm For Balanced Graph Clustering. 11th International IEEE Conference on Information Visualization (IV 2007), Zurich, Switzerland (2007)
-
Field Summary
Fields Modifier and Type Field Description private int
commSize
Maximum community size. -
Constructor Summary
Constructors Constructor Description BalancedFastGreedy(int commSize)
Constructor. -
Method Summary
Modifier and Type Method Description private Communities<U>
cluster(Graph<U> graph, java.util.Set<U> users)
Applies the clustering algorithm to a large group of nodes.Communities<U>
detectCommunities(Graph<U> graph)
Computes the communities for a certain graph.
-
Field Details
-
commSize
private final int commSizeMaximum community size.
-
-
Constructor Details
-
BalancedFastGreedy
public BalancedFastGreedy(int commSize)Constructor.- Parameters:
commSize
- Maximum community size.
-
-
Method Details
-
detectCommunities
Description copied from interface:CommunityDetectionAlgorithm
Computes the communities for a certain graph.- Specified by:
detectCommunities
in interfaceCommunityDetectionAlgorithm<U>
- Parameters:
graph
- The full graph.- Returns:
- The communities if everything went OK, null if not.
-
cluster
Applies the clustering algorithm to a large group of nodes.- Parameters:
graph
- The graph.users
- The large group of nodes.- Returns:
- A community partition if everything went OK, null if not.
-