You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
**数据结构:**类似于有向森林,森林中的每条边方向都是从叶子指向根。
**任务:**循环任务,输入某些”叶子“节点,寻找这些叶子节点的”根“,然后将这些根指向一个新的根。
**客户端:*nebula-python
查询叶子的根: MATCH (e:entity)-[:merge]->(node:entity) WHERE id(e) == "{start_vid}" RETURN node
插入根: INSERT VERTEX entity(a1, a2) VALUES "{vid}":({v1}, {v2})
插入根的相关边: INSERT EDGE merge(a1,a2) VALUES "{source}"->"{target}":("{v1}",{v2})
正常情况: 森林中的每个节点只会指向一个节点
异常情况: 森林中出现了1个节点指向多个节点的情况
初步分析原因: 每次插入新的根,相关的边在下一轮任务前可能不在相关路径中,导致查出来一个旧的“根”,从而导致某个“根”指向多个节点
Beta Was this translation helpful? Give feedback.
All reactions