cancel
Showing results for 
Search instead for 
Did you mean: 

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

glilienfield
Ninja
Ninja

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

Koen_Algoet
Node Clone

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

Koen_Algoet
Node Clone

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?
 
 
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.