A power-law distribution describes a network where many nodes have small degree values and relatively few nodes have very large values. In a directed network, inspect incoming and outgoing connections separately. section 5.1.1
A degree distribution becomes useful when its summary statistics are read alongside a visualization:
- The Twitter subgraph has an average out-degree of about 7, but a median of 2; half of the nodes have two or fewer outgoing connections. section 5.1.1
- More than 1,000 nodes have zero outgoing connections, most have fewer than 10 links, and the maximum out-degree is 143. section 5.1.1
- Incoming connections show the same unequal shape: more than half of the users have no incoming connections, while one user has 540. section 5.1.1
Measure an out-degree distribution
Use Neo4j and APOC to count each user's outgoing FOLLOWS relationships, then return aggregate statistics. Compare the mean, median, percentiles, and maximum to reveal whether a small number of nodes account for unusually many links. section 5.1.1
Listing 5.1 Evaluating the node out-degree distribution with the apoc.agg.statistics function
MATCH (u:User)
WITH u, count{ (u)-[:FOLLOWS]->() } AS outDegree
RETURN apoc.agg.statistics(outDegree)
Runs the out-degree measurement query for every User node and returns statistics for the resulting distribution. section 5.1.1
