代码之家  ›  专栏  ›  技术社区  ›  Neel Basu

为双向边缘的每个定向边缘创建反向边缘

  •  1
  • Neel Basu  · 技术社区  · 6 年前

    我对图形数据库很陌生。我从阿兰戈开始。对于这个项目,我不确定将来会遇到哪些查询。我不想制造瓶颈。所以我想在任何地方创建无向或双向边。

    但是,由于只支持有向边,我目前的理解是,如果某个顶点不能通过 directed traversal 然后我会遇到瓶颈。所以每当我创造一个边缘 a -> b 我也在创造 b -> a 在同一个边缘集合中。

    我的假设正确吗?设计决策可以接受吗?

    1 回复  |  直到 6 年前
        1
  •  1
  •   CodeManX    6 年前

    当边缘总是定向时,您可以使用 any选择忽略遍历中的边缘方向。 https://docs.arangodb.com/3.3/aql/graphs/traversals.html

    • outbound to follow an edge in its defined direction( \u from \u to )
    • inbound to follow in the opposite direction( )
    • any to follow whatever of the edge direction,inbound and outbound( \u from \u to )
        • OUTBOUND 沿其定义的方向跟随边( _from _ _to )
        • INBOUND 向相反的方向走( _从 ← _至 )
        • 任何 无论边缘方向、入站和出站,都要遵循( _从 _ _至 )

        Traversal directions in graph

    推荐文章