Computing the degrees of the network nodes

We are now going to explore the three graphs, and introduce an important property of a network node, which is the degree of the node.

The degree of a node represents the number of links it has to other nodes. In a directed graph, we can make a distinction between the incoming degree of a node or an in-degree, which is the number of its incoming links, and its outgoing degree or out-degree, which is the number of nodes that it points to. In the following sections, we will explore the degree distributions of the three example networks.

In-degree and out-degree of the Enron email network

For the Enron email network, we can confirm that there are roughly ten times more links than nodes:

scala> emailGraph.numEdges ...

Get Apache Spark Graph Processing now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.