Defined in File Assortativity.hpp
public NetworKit::Algorithm (Class Algorithm)
Assortativity computes a coefficient that expresses the correlation of a node attribute among connected pairs of nodes.
For a partition of the node set (a nominal attribute), the coefficient is computed from the mixing matrix e, where e_ij is the fraction of edge counts from nodes in subset i to nodes in subset j. In undirected graphs, each edge {u, v} with u != v is counted once in each direction and each self-loop is counted once, and the mixing matrix is normalized by the total of these counts (2m minus the number of self-loops). In directed graphs, each edge is counted once and the matrix is normalized by m.
Public Functions
Initialize Assortativity with a graph G and an array of numerical node values.
G – The graph.
attribute – numerical node value array
Initialize Assortativity with a graph G and a partition of the node set
G – The graph.
partition – partition of the node set
Runs the algorithm. The algorithm is not parallel.
Return the assortativity coefficient.