Reader small image

You're reading from  Hands-On Graph Analytics with Neo4j

Product typeBook
Published inAug 2020
PublisherPackt
ISBN-139781839212611
Edition1st Edition
Tools
Right arrow
Author (1)
Estelle Scifo
Estelle Scifo
author image
Estelle Scifo

Estelle Scifo possesses over 7 years experience as a data scientist, after receiving her PhD from the Laboratoire de lAcclrateur Linaire, Orsay (affiliated to CERN in Geneva). As a Neo4j certified professional, she uses graph databases on a daily basis and takes full advantage of its features to build efficient machine learning models out of this data. In addition, she is also a data science mentor to guide newcomers into the field. Her domain expertise and deep insight into the perspective of the beginners needs make her an excellent teacher.
Read more about Estelle Scifo

Right arrow

Computing degree centrality

Computing degree centrality involves sorting nodes based on how many relationships they have. This can be computed with base Cypher or invoked via the GDS plugin and a projected graph.

Formula

Degree centrality Cn is defined as follows:

Cn = deg(n)

Here, deg(n) denotes the number of edges connected to the node n.

If your graph is directed, then you can define the incoming and outgoing degree as the number of relationships starting from node n and the number of relationships ending in n, respectively.

For instance, let's consider the following graph:

Node A has one incoming relationship (coming from B) and two outgoing relationships (to B and D), so its incoming degree is 1 and its outgoing degree is 2. The degrees of each node are summarized in the following table:

Node Outgoing degree Incoming degree Degree (undirected)
A 2 1 3
B 1 3 4
C 1 0 1
D 1 1 2

Let's now see how to get these results in Neo4j. You can create this small graph...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Graph Analytics with Neo4j
Published in: Aug 2020Publisher: PacktISBN-13: 9781839212611

Author (1)

author image
Estelle Scifo

Estelle Scifo possesses over 7 years experience as a data scientist, after receiving her PhD from the Laboratoire de lAcclrateur Linaire, Orsay (affiliated to CERN in Geneva). As a Neo4j certified professional, she uses graph databases on a daily basis and takes full advantage of its features to build efficient machine learning models out of this data. In addition, she is also a data science mentor to guide newcomers into the field. Her domain expertise and deep insight into the perspective of the beginners needs make her an excellent teacher.
Read more about Estelle Scifo