Threats to understanding the direction of relations in the return paths.
I have such a graph
(:START)-[:NEXT]->(:NODE)-[:NEXT]->(:NODE)...
Now I map all the paths, starting from the beginning of the node in the direction :NEXTup to length 10, say. The request looks like
MATCH t=((:START)-[:NEXT*..10]->(:NODE))
RETURN t;
I get weekend paths with seemingly mixed directions :NEXT, such as
(:START)-[:NEXT]->(:NODE)<-[:NEXT]-(:NODE)-[:NEXT]->(:NODE)<-...
and I canβt understand where the variable directions come from.
EDIT:
A graph is just a straight line (with one direction). No loops, no branches. Repeat the script in the shell as follows:
CREATE (s:START);
MATCH (s:START) MERGE (s)-[:NEXT]->(a:NODE)-[:NEXT]->(b:NODE)-[:NEXT]->(c:NODE)-[:NEXT]->(d:NODE);
MATCH t=((:START)-[:NEXT*..10]->()) return t;
+
| t |
+
| (:START)-[:NEXT]->(:NODE) |
| (:START)-[:NEXT]->(:NODE)<-[:NEXT]-(:NODE) |
| (:START)-[:NEXT]->(:NODE)<-[:NEXT]-(:NODE)-[:NEXT]->(:NODE) |
| (:START)-[:NEXT]->(:NODE)<-[:NEXT]-(:NODE)-[:NEXT]->(:NODE)<-[:NEXT]-(:NODE) |
+
See how on the returned paths the arrows alternate in the direction? It scares me.
source
share