Computing the graph degree distribution
After the number of nodes and edges, the node’s degree is one of the first metrics to compute when studying a new graph. It tells us whether the edges are equally split across nodes or if some nodes monopolize almost all connections, leaving the others disconnected. Now that we’ve defined the node’s degree, we will learn how to compute it with Cypher and draw the distribution using the NeoDash graph application.
Definition of a node’s degree
The degree of a node is the number of links connected to this node. For undirected graphs, there is only one degree, since we just count all the edges connected to a given node. For directed graphs, we can compute the node’s degree in three different ways:
- Incoming degree: We count only the edges pointing toward the node
- Outgoing degree: We count only the edges pointing outward of the node
- Total degree: We count all edges attached to a node, regardless...