Default resolution parameter.
Default number of iterations.
Resolution parameter.
Random number generator.
Number of iterations.
Returns the resolution parameter.
Resolution parameter
Sets the resolution parameter.
Resolution parameter
Calculates the quality of a clustering using the CPM quality function.
The CPM quality function is given by
1 / (2 * m) * sum(d(c[i], c[j]) * (a[i][j] - resolution * n[i] *
n[j])),
where a[i][j]
is the weight of the edge between nodes i
and j
,
n[i]
is the weight of node i
, m
is the total edge weight, and
resolution
is the resolutionparameter. The function d(c[i], c[j])
equals 1 if nodes i
and j
belong to the same cluster and 0 otherwise.
The sum is taken over all pairs of nodes i
and j
.
Modularity can be expressed in terms of CPM by setting n[i]
equal to
the total weight of the edges between node i
and its neighbors and by
rescaling the resolution parameter by 2 * m
.
Network
Clustering
Quality of the clustering
Removes a cluster from a clustering by merging the cluster with another cluster. If a cluster has no connections with other clusters, it cannot be removed.
Network
Clustering
Cluster to be removed
Cluster with which the cluster to be removed has been merged, or -1 if the cluster could not be removed
Removes small clusters from a clustering. Clusters are merged until each cluster contains at least a certain minimum number of nodes.
Network
Clustering
Minimum number of nodes per cluster
Boolean indicating whether any clusters have been removed
Removes small clusters from a clustering. Clusters are merged until each cluster has at least a certain minimum total node weight.
The total node weight of a cluster equals the sum of the weights of the nodes belonging to the cluster.
Network
Clustering
Minimum total node weight of a cluster
Boolean indicating whether any clusters have been removed
Initializes a fast local merging algorithm.
Random number generator
Initializes a fast local merging algorithm for a specified resolution parameter and number of iterations.
Resolution parameter
Number of iterations
Random number generator
Clones the algorithm.
Cloned algorithm
Initializes an incremental CPM clustering algorithm with a specified resolution parameter.
Resolution parameter
Finds a clustering of the nodes in a network.
The clustering is obtained by calling improveClustering and by providing a singleton clustering as input to this method.
Network
Clustering
Initializes an iterative CPM clustering algorithm with a specified resolution parameter and number of iterations.
Resolution parameter
Number of iterations
Returns the number of iterations.
Number of iterations
Sets the number of iterations.
Number of iterations
Improves a clustering of the nodes in a network.
If the number of iterations nIterations
is positive, the clustering is
improved by making nIterations
calls to
improveClusteringOneIteration. If nIterations
equals 0, calls to
{@link #improveClusteringOneIteration} continue to be made until there has
been a call that did not result in an improvement of the clustering.
Network
Clustering
Boolean indicating whether the clustering has been improved
Improves a clustering by performing one iteration of the fast local moving algorithm.
The fast local moving algorithm first adds all nodes in a network to a queue. It then removes a node from the queue. The 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. If the node is moved to a different cluster, the neighbors of the node that do not belong to the node's new cluster and that are not yet in the queue are added to the queue. The algorithm continues removing nodes from the queue until the queue is empty.
Network
Clustering
Boolean indicating whether the clustering has been improved
Constructs a fast local moving algorithm.
Generated using TypeDoc
Fast local moving algorithm.
The fast local moving algorithm first adds all nodes in a network to a queue. It then removes a node from the queue. The 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. If the node is moved to a different cluster, the neighbors of the node that do not belong to the node's new cluster and that are not yet in the queue are added to the queue. The algorithm continues removing nodes from the queue until the queue is empty.
The fast local moving algorithm provides a fast variant of the StandardLocalMovingAlgorithm.