You can do

MATCH (n:Entity) where n.name IN {names}
WITH collect(n) as nodes
UNWIND nodes as n
UNWIND nodes as m
MATCH path = allShortestPaths( (n)-[*..4]-(m) )
RETURN path


On Fri, Apr 7, 2017 at 11:12 PM, unrealadmin23 via Neo4j <
[email protected]> wrote:

>
> Consider a number of arbitrary nodes,  A,B,C,D,E,F,.....
>
> I wish to return all of the shortest paths between these nodes.
> The nodes may have many edges between them, but anticipate a maximum of 4.
> The graph is complex and non hierarchical  (if this makes sense - any node
> may point to any other node).
> A typical node has the form:  match (n:Entity { name: 'xyz' })
>
> How would I write the match expression to return the shortest paths
> between the above nodes,  in no specific order ?
>
> Wayne
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to