How can I save the result of clusters ? and how can I compare nodes of each cluster separately?

apoc
cypher

(Mehdi Ajroud) #1

The aim of this work is knowing how my clusters were made/how the group of nodes which is connected to each other was made . I have contracts and attributes in my graph .

I used this query to have clusters of Attributes(companies) which collaborated together for 10 times at least :

match (n1:attribfxplaf)-[r]-()
with n1.clusterId as clusterId, count(n1) as clusterSize,count(distinct r) as numberOfRels
where clusterSize > 10 AND  numberOfRels > 10
match (n2) where n2.clusterId = clusterId
return n2,clusterId``` 

now I want to know how to save this and not executing this query each time I need this result . And how can I compare nodes properties of the same cluster ?

(Michael Hunger) #2

You can create a "COLLABORATED" relationship between those nodes n1 and n2, with the cluster-id and count as property on the relationship.

Or better just label them with a marker label, like :FrequentCollaborators


(Mehdi Ajroud) #3

Thanks Micheal for your help :)