Hi, I am trying to find shortest path between two nodes, but I have more 
than 1 node of each nodes that I am looking for. The function shortestPath 
returns path for only the first node that finds. I am using: 

 MATCH p=shortestPath((n1:PERSON{Name:'Ana'})-[*]->(n2:AGE{Age:'40'})) 
RETURN length(p), nodes(p)

This return the shortest path between 1st Ana that is found and her age.

But I have more nodes with name ana in a graph.

I was trying    
MATCH p=((n1:PERSON{Name:'Ana'})-[*]->(n2:AGE{Age:'40'})) 
WITH DISTICT p
MATCH p1=shortestPath(p)
RETURN p1

But it does not work.
Is there a way to return a shortest path of a collection of paths for 
different nodes?

Thanks

 

-- 
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