Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Graph Analytics with Neo4j

You're reading from   Hands-On Graph Analytics with Neo4j Perform graph processing and visualization techniques using connected data across your enterprise

Arrow left icon
Product type Paperback
Published in Aug 2020
Publisher Packt
ISBN-13 9781839212611
Length 510 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Estelle Scifo Estelle Scifo
Author Profile Icon Estelle Scifo
Estelle Scifo
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Section 1: Graph Modeling with Neo4j
2. Graph Databases FREE CHAPTER 3. The Cypher Query Language 4. Empowering Your Business with Pure Cypher 5. Section 2: Graph Algorithms
6. The Graph Data Science Library and Path Finding 7. Spatial Data 8. Node Importance 9. Community Detection and Similarity Measures 10. Section 3: Machine Learning on Graphs
11. Using Graph-based Features in Machine Learning 12. Predicting Relationships 13. Graph Embedding - from Graphs to Matrices 14. Section 4: Neo4j for Production
15. Using Neo4j in Your Web Application 16. Neo4j at Scale 17. Other Books You May Enjoy

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 chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime