I have a problem when i use the path variables.
For example my hierarchy looks like
A-[Knows]-> B
B-[Knows]-> C
C-[Knows]-> D
D-[Knows]-> E
C-[Knows]-> F
F-[Knows]-> G
G-[Knows]-> B
My query is MATCH p = (x)<-[Knows*]->(y) Return p
The relation direction have to be bidirectional. Toy problem is like A,B but in real application, i don't know direction of relations.
So there is a cycle and loop. The path start to find from A to C. But after finding C, next steps, cycle is happened.
How to avoid the loop or how to ignore it, how to remove from actual path or how to stop when the path end in B. I don't need to find second B to C.
Expected result :
A->B->C->D->E
A->B->C->F->G->B // that is enough. The query must be stopped.
Actual result :
A->B->C->D->E
A->B->C->F->G->B->C->F->G->B..... loop trouble.