apaGraph.Communities.GreedyAgglomerative(Edges, Layout, ShowInfo)
=apaGraph.Communities.GreedyAgglomerative(Edges, Layout, ShowInfo)Result
Returns greedy agglomerative modularity communities. The algorithm starts with singleton communities and repeatedly merges the pair with the highest modularity gain. Returns one row per node, including the layout coordinates.
Syntax
Edges: edge list; the first two columns contain the node indices, the third column the distance
Layout: node layout; the first column contains the x coordinates, the second column the y coordinates
ShowInfo: TRUE to show additional columns with community and node information: 1) average internal strength of the community, 2) internal strength of the node within the community, 3) external strength of the node
Remarks
Edge strengths are the inverse distances of the third column of Edges. At each step, the two communities a and b with the largest modularity gain ΔQ = W(a,b)/m - S(a)·S(b)/(2m²) are merged, where W(a,b) is the total strength of the edges between the two communities, S(a) and S(b) the total strengths of their nodes and m the total strength of all edges. The partition with the highest modularity along the merge path is returned; if several partitions have the same modularity, the one with fewer communities is chosen.
