You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ne...@googlegroups.com
What's the best way to prevent cycles in a graph? I'm building a graph that is usually more like a tree, but sometimes nodes point up to higher levels in the tree (direction matters). I want to make sure that when that happens, the higher level node is not a parent of the current node.
Say I have this graph: http://console.neo4j.org/r/en0t9x. I'm currently at node D1, and I successfully created a link to B3, but I would want to prevent links from D1 to B1 or A, for example. The only thing I have in my process is a list of node names I "want" to connect to, and that list might contain D1 or B1.
Thanks,
Wes
Michael Hunger
unread,
Aug 7, 2012, 4:57:26 PM8/7/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ne...@googlegroups.com
Wes,
you can use paths as predicates
e.g.
start current= ..., target= ...
where NOT(current<-[:linked*]-target)
create current-[:linked]->target
HTH
Michael
Wes Freeman
unread,
Aug 7, 2012, 5:00:56 PM8/7/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message