Module org.jgrapht.core
Package org.jgrapht.alg.clustering
Class NaiveGreedyModularityAlgorithm<V,E>
java.lang.Object
org.jgrapht.alg.clustering.NaiveGreedyModularityAlgorithm<V,E>
- Type Parameters:
V- the graph vertex typeE- the graph edge type
- All Implemented Interfaces:
ClusteringAlgorithm<V>
A naive implementation of greedy modularity maximization for community detection.
The algorithm partitions the vertices of an undirected graph into communities by greedily maximizing the modularity of possible communities. Greedy modularity maximization begins with each node in its own community and repeatedly joins the pair of communities that lead to the largest modularity until no further increase in modularity is possible (a maximum).
This implementation is simple but computationally expensive, with a worst-case complexity of O(n^4). It is intended as an easy-to-understand reference implementation rather than a performance-optimized solution.
- Author:
- Antonia Tsiftsi
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jgrapht.alg.interfaces.ClusteringAlgorithm
ClusteringAlgorithm.Clustering<V>, ClusteringAlgorithm.ClusteringImpl<V> -
Constructor Summary
ConstructorsConstructorDescriptionNaiveGreedyModularityAlgorithm(Graph<V, E> graph) Create a new Naive Greedy clustering algorithm. -
Method Summary
Modifier and TypeMethodDescriptionComputes a clustering.
-
Constructor Details
-
NaiveGreedyModularityAlgorithm
Create a new Naive Greedy clustering algorithm.- Parameters:
graph- the graph
-
-
Method Details
-
getClustering
Description copied from interface:ClusteringAlgorithmComputes a clustering.- Specified by:
getClusteringin interfaceClusteringAlgorithm<V>- Returns:
- a clustering
-