public class OptimizerModularity
Optimizer for a generalization of Newman and Girvan's Modularity measure,
for computing graph clusterings.
The Modularity measure is generalized to arbitrary node weights;
it is recommended to set the weight of each node to its degree,
i.e. the total weight of its edges, as Newman and Girvan did.
For more information on the (used version of the) Modularity measure, see
M. E. J. Newman: "Analysis of weighted networks",
Physical Review E 70, 056131, 2004.
For the relation of Modularity to the LinLog energy model, see
"Modularity clustering is force-directed layout",
Preprint arXiv:0807.4052, 2008.
public java.util.Map<Node,java.lang.Integer> execute(java.util.List<Node> nodes,
Computes a clustering of a given graph by maximizing the Modularity.
nodes - weighted nodes of the graph.
It is recommended to set the weight of each node to the sum
of the weights of its edges. Weights must not be negative.
edges - weighted edges of the graph.
Omit edges with weight 0.0 (i.e. non-edges).
For unweighted graphs use weight 1.0 for all edges.
Weights must not be negative.
Weights must be symmetric, i.e. the weight
from node n1 to node n2 must be equal to
the weight from node n2 to node n1.
ignoreLoops - set to true to use an adapted version
of Modularity for graphs without loops (edges whose start node
equals the end node)
clustering with large Modularity,
as map from graph nodes to cluster IDs.