I want to find all user nodes that don't have intermediate connections to other user nodes.
Basic graph is like this :
(User)-[]->(id)
where a User node can have multiple IDs and some Ids have multiple user nodes. There is a particular pattern of interest
Match (u:User)-[]->(id)<-[]-(u2:User)
where u <> u2 AND id(u) < id(u2)
return u, id, u2
I want to find all users NOT in this pattern. That is, Find the distinct number of Users that don't have a connection to another User. I am on a big 244 RAM machine but everything I tried just kills the connection over the web interface. The graph contains 755MM Users and 2B Nodes+ overall.
Here is they query that breaks
Match (u:User)
Where not ((u)-[]->()<-[]-(:User)
RETURN count(distinct User)
I will take any solution to this including APOC if it works. 