I have a graph that looks like this -
It's the same type of node interacting with one another. (:DataSet)-[:INTERACTS_WITH*]->(:DataSet)
I want to write a query that returns the starting nodes of the longest paths.
so far I have -
match p=(d:DataSet)-[r:INTERACTS_WITH*]->(d1:DataSet) return nodes(p), length(p) order by length(p) desc
And this kind of does the job but I see that the max path length is 8
CLEARLY that is not the length of the longest path. If I remove direction from the query, it becomes very expensive and unscalable. What am I doing wrong?