graph - Neo4j/Cypher - find connected nodes that have more than 2 links -
I have a graph (thus link instructions for any labels or simplicity has been removed)
I would like to start on node (c) and only those nodes I will find those who have nodes with more than 2 adjacent edges, and the path from them (C)
In the above example, there are 3 adjacent edges (ba, bc, bg) and node (e) 4 in the node (b) adjacent edges (ed, ef, eh, eh), so i just B) and (E) would like to return the path.
I also want to no to return the path to (a), (f), (h), (g) or (j) - when i am satisfied counting the traversal I want to stop I have tried the following: ... but it gives the path to do one, which is in addition to G, H, F and B and E. Edit: For example, Pictures I, if my data is imposed, then the initial suggestion does not work (see) so that a new image Example given below. I want : Path to B - just as I do not want : To return the path. Thanks again neo4jers. .. Interesting, I've put it in the console in NEO 4J. The statement statement you are looking for is: The move here is in two parts specified in the
start n = node (c) match (n) - [r *] - (m) - [rx] - ( O) with Mm, NNNRR, (rx) cnt ou cnt & gt; 2 returns n, r, m, cnt;
START n = node (2) // node ID in node ID = 2 match P = (n ) - [Knowledge *] - (M), (M) - [: Knowledge] - (x) with P, as count (x) where count & gt count, 2 returns p
match . The first part is to use
with
and
returns using aggregation.
Comments
Post a Comment