I am trying to work out a cypher query to determine the shortest paths between a set of nodes, such as the set identified as follows,
MATCH (u:User) WITH u ORDER by u.score DESC LIMIT 10 RETURN u
assuming a graph of the form
(:User)-[:Owns]-(:Box)
The first restriction is that I only want to return paths between users matching the first query.
The second restriction is that I do not want to include Box elements where there is a link to only one user in the user set. I am only interested in Box elements where there is more that one matching User who Owns the Box. There may be other Users not selected linked to the Box, but I have no interest in them.
In a sense, it seems to me that I am seeking to extract a subnetwork of all nodes/paths linking the matching user set, but I am new to Cypher/Neo4j and can not work this out.
Any pointers gratefully received.