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

**URL:** https://community.neo4j.com/t/how-can-i-save-the-result-of-clusters-and-how-can-i-compare-nodes-of-each-cluster-separately/2462
**Category:** Cypher
**Tags:** apoc, cypher
**Created:** [October 15, 2018, 11:55am UTC](https://community.neo4j.com/t/how-can-i-save-the-result-of-clusters-and-how-can-i-compare-nodes-of-each-cluster-separately/2462 "2018-10-15T11:55:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mehdi.ajroud](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mehdi.ajroud/32/1045_2.png) [@mehdi.ajroud](https://community.neo4j.com/u/mehdi.ajroud)
#### Post date: [October 15, 2018, 11:55am UTC](https://community.neo4j.com/t/how-can-i-save-the-result-of-clusters-and-how-can-i-compare-nodes-of-each-cluster-separately/2462/1 "2018-10-15T11:55:01Z")

</div>

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 :

````auto
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 ?
````

---

<div class="post-metadata">

### Author: ![michael.hunger](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/michael.hunger/32/27377_2.png) [@michael.hunger](https://community.neo4j.com/u/michael.hunger)
#### Post date: [October 21, 2018, 2:11am UTC](https://community.neo4j.com/t/how-can-i-save-the-result-of-clusters-and-how-can-i-compare-nodes-of-each-cluster-separately/2462/2 "2018-10-21T02:11:08Z")

</div>

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`

---

<div class="post-metadata">

### Author: ![mehdi.ajroud](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/mehdi.ajroud/32/1045_2.png) [@mehdi.ajroud](https://community.neo4j.com/u/mehdi.ajroud)
#### Post date: [October 29, 2018, 12:29pm UTC](https://community.neo4j.com/t/how-can-i-save-the-result-of-clusters-and-how-can-i-compare-nodes-of-each-cluster-separately/2462/3 "2018-10-29T12:29:11Z")

</div>

Thanks Micheal for your help :)
