public abstract class IterativeCPMClusteringAlgorithm extends IncrementalCPMClusteringAlgorithm
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_N_ITERATIONS
Default number of iterations.
|
protected int |
nIterations
Number of iterations.
|
DEFAULT_RESOLUTION, resolution
Constructor and Description |
---|
IterativeCPMClusteringAlgorithm()
Constructs an iterative CPM clustering algorithm.
|
IterativeCPMClusteringAlgorithm(double resolution,
int nIterations)
Constructs an iterative CPM clustering algorithm with a specified
resolution parameter and number of iterations.
|
Modifier and Type | Method and Description |
---|---|
int |
getNIterations()
Returns the number of iterations.
|
boolean |
improveClustering(Network network,
Clustering clustering)
Improves a clustering of the nodes in a network.
|
protected abstract boolean |
improveClusteringOneIteration(Network network,
Clustering clustering)
Improves a clustering by performing one iteration of an iterative
clustering algorithm.
|
void |
setNIterations(int nIterations)
Sets the number of iterations.
|
findClustering
calcQuality, clone, getResolution, removeCluster, removeSmallClustersBasedOnNNodes, removeSmallClustersBasedOnWeight, setResolution
public static final int DEFAULT_N_ITERATIONS
protected int nIterations
public IterativeCPMClusteringAlgorithm()
public IterativeCPMClusteringAlgorithm(double resolution, int nIterations)
resolution
- Resolution parameternIterations
- Number of iterationspublic int getNIterations()
public void setNIterations(int nIterations)
nIterations
- Number of iterationspublic boolean improveClustering(Network network, Clustering clustering)
If the number of iterations nIterations
is positive, the
clustering is improved by making nIterations
calls to improveClusteringOneIteration(Network network, Clustering clustering)
.
If nIterations
equals 0, calls to improveClusteringOneIteration(Network network, Clustering clustering)
continue to be made until there has been a call that did not result in
an improvement of the clustering.
network
- Networkclustering
- Clusteringprotected abstract boolean improveClusteringOneIteration(Network network, Clustering clustering)
network
- Networkclustering
- Clustering