public class StandardLocalMovingAlgorithm extends IncrementalCPMClusteringAlgorithm
The standard local moving algorithm iterates over the nodes in a network. A node is moved to the cluster that results in the largest increase in the quality function. If the current cluster assignment of the node is already optimal, the node is not moved. The algorithm continues iterating over the nodes in a network until no more nodes can be moved.
A fast variant of the standard local moving algorithm is provided by the
FastLocalMovingAlgorithm
.
Modifier and Type | Field and Description |
---|---|
protected java.util.Random |
random
Random number generator.
|
DEFAULT_RESOLUTION, resolution
Constructor and Description |
---|
StandardLocalMovingAlgorithm()
Constructs a standard local moving algorithm.
|
StandardLocalMovingAlgorithm(double resolution,
java.util.Random random)
Constructs a standard local moving algorithm for a specified resolution
parameter.
|
StandardLocalMovingAlgorithm(java.util.Random random)
Constructs a standard local moving algorithm.
|
Modifier and Type | Method and Description |
---|---|
boolean |
improveClustering(Network network,
Clustering clustering)
Improves a clustering of the nodes in a network using the standard local
moving algorithm.
|
findClustering
calcQuality, clone, getResolution, removeCluster, removeSmallClustersBasedOnNNodes, removeSmallClustersBasedOnWeight, setResolution
public StandardLocalMovingAlgorithm()
public StandardLocalMovingAlgorithm(java.util.Random random)
random
- Random number generatorpublic StandardLocalMovingAlgorithm(double resolution, java.util.Random random)
resolution
- Resolution parameterrandom
- Random number generatorpublic boolean improveClustering(Network network, Clustering clustering)
The standard local moving algorithm iterates over the nodes in a network. A node is moved to the cluster that results in the largest increase in the quality function. If the current cluster assignment of the node is already optimal, the node is not moved. The algorithm continues iterating over the nodes in a network until no more nodes can be moved.
network
- Networkclustering
- Clustering