cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

APOC.Path.expand and MUST BE circular paths

Koen_Algoet
Node Clone

Anybody a good idea to use apoc.path.extendconfig to filter the paths where first and last node is the same,

Finding only circular paths?

end node must be equal to the begin node in variable lenght path

Or is unwinding the only solution?

 

 

3 REPLIES 3

Maybe try setting the "terminatorNodes" list in the config to the start node, i.e. [<startNode>].

Ok, that is something I can try. Would be nice feature for apoc. 

I'm looking at the apoc.nodes.cylces function.

This is part of my grapgh, for 1 tank ( I have 54 tanks)

Koen_Algoet_0-1662196248505.png

 

To list the nodes of the returned paths I use:

MATCH (p:Tank {Name:'T0104'})
with collect (p) as mynodes
CALL apoc.nodes.cycles(mynodes,{relTypes: ['CanCirculate']}) YIELD path
WITH ([n IN nodes(path) | n.Name] ) AS PathNodes
RETURN PathNodes

 
I get only 1 path of nodes where I have multiple cycles available.
T0104T0104MainV13_1P1104P1104CT0104CircT0104
 
Options like 
T0104T0104MainV11_1P1104P1104CT0104CircT0104
T0104T0104MainV12_1P1104P1104CT0104CircT0104
..
T0104T0104MainV11_1P1107P1107CT0104CircT0104
 
What is going wrong. Why is are not all cycles returned?