Neo4J How to visualize clusters obtained with Cypher queries

Viewed 181

I'm still training with Neo4J and now I'm learning clustering algorithms. I'm using Neo4J and python driver to connect to my database. Right now I'm able to launch Cypher queries and I use Graphistry to visualize the graph result from my query into the browser. It works very well, but now it's not enough. I'm learning clustering algorithms, I already tried some of them like Louvain, SCC, PageRank and others, but I just visualize them in my console because Neo4J returns a list from this query. This is not enough because I'm working with a very big graph (~23 millions edges) and a list is not good for clustering, I need some graphical structure.

Example: This is the query I launch for Louvain algorithm

call gds.louvain.stream('graph-name') yield nodeId, communityId return gds.util.asNode(nodeId).name as name, communityId order by name asc limit 20

This is what I get with Neo4J: enter image description here

And this is what I get with my python script: enter image description here

As you may understand, writing communities IDs is not enough, people need to visualize the clusters to analyze them, that's why I need something to draw these clusters. This is an example of what I want to achieve (random picture from the web): enter image description here

I just need something to draw these clusters. I can't do that in Graphistry because it needs a subgraph to draw it, but Neo4J returns a json list of data and I can't draw them. Any solution?

1 Answers

To visualize the nodes by community color you need to execute the louvain algorithm in the write mode.

call gds.louvain.write('graph-name', {writeProperty:'louvain'}) 

Then you can use the rule-based node colors in Bloom to visualize your clusters:

Here's a video clip that shows you how to accomplish that in Neo4j Bloom:

https://youtu.be/16uTHwznnJk?t=3218

Related