Which accounts form a cluster?
Query 1Weakly connected components over the transfers: each component with more than one account is a group that moved money among themselves.
CALL algo.wcc({relationshipTypes: 'SENT'}) YIELD node, componentId
WITH componentId, collect(node.id) AS accounts
WHERE size(accounts) > 1
RETURN componentId, accounts ORDER BY size(accounts) DESC, componentId;+-------------+--------------------------------------+
| componentId | accounts |
+-------------+--------------------------------------+
| 0 | ["A-101", "A-102", "A-103", "A-104"] |
| 4 | ["A-105", "A-106"] |
| 6 | ["A-107", "A-108"] |
+-------------+--------------------------------------+
3 rows