我试图做一个图遍历,只想列出递归路径
我的遍历具有1..10的可变深度,它将找到以下路径:
1. start - decide - execute1 - end
2. start - decide - execute2 - decide - execute1 - end
3. start - execute3 - end
使用以下查询:
FOR v, e, p IN 1..10 OUTBOUND 'Node/start_0' Path
FILTER v.name == "end"
RETURN CONCAT_SEPARATOR(' - ', p.vertices[*].name)
现在,我只想列出具有递归或循环的路径,在此示例中,我只想获取路径2. start - decide - execute2 - decide - execute1 - end
,因为它经过了decide - execute2 - decide
。
我知道我们可以通过设置uniqueVertices: 'path'
来避免这种循环情况,但是如何只获取其中存在循环的情况