Try

Match (c)-[*]->(x)<-[*]-(d)
return x


And

Match p=shortestPath((a)-[*]-(b))
Return nodes(p)

If you have more rel-types, use
(c)-[:KNOWS*]->(x)

Sent from mobile device

Am 03.05.2014 um 20:54 schrieb Quazi Marufur Rahman <[email protected]>:

> Hi,
> 
> I have created a directed acyclic graph using py2neo. Part of it looks like,
> a->b
> b->c
> b->d
> c->d
> Here '->' represents 'knows'
> 
> I have two questions.
> How can I find the node which knows both 'c' and 'd' and closest to them? 
> Something like lowest common ancestor in tree.
> How to find the shortest distance between 'a' and 'b'?
> Please let me know if any tutorial is available to solve these two questions.
> 
> 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.

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