Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-20-2020 03:23 AM
Hi everyone,
For the following graph :
I would like to get all the distinct oriented paths for a given node.
For example, starting from x6, I would have 3 distinct paths :
x6 -> x3 -> x2 -> x1
x6 -> x3 -> x2 -> x4
x6 -> x3 -> x2 -> x5
I have tried this query: MATCH path = ({name:'x6'})-[*]->(n) RETURN path
And I obtained these results:
I think I just have to add clauses in my query, but I can't figure out which ones.
Thanks for your help.
10-20-2020 07:13 AM
What does this mean?
In your sample output, why wouldn't you also want to see x6 -> x3, x6 -> x3 -> x2, and other "intermediate" paths?
10-20-2020 07:38 AM
Yes I'm also interested by the "intermediate" paths but is it not possible to simplify by defining that they are included in the next 3 paths ?
I would like to "limit" the research of paths like this:
10-20-2020 07:59 AM
Have a look at this -- this might be what you mean / need, but I'm not sure
This would get you all of the paths, as short as possible, from your starting point to everything else, without replications I think.
10-21-2020 12:36 AM
Thanks David !
I also think about Shortest Path and Single Source Shortest Path algorithm because I will put cost on my relationship.
I found this code in neo4j documentation :
https://neo4j.com/docs/graph-data-science/current/alpha-algorithms/single-source-shortest-path/
All the sessions of the conference are now available online