Search code examples
graph-databasesarangodbdirected-graph

ArangoDB Creating counter edge for every directed edge for bidirectional edges


I am very new to graph database. And I have started with Arango. For this project I am not sure about the queries that I will encounter in future. I don't want to create bottlenecks. So I wanted to create undirected or bidirectional edges everywhere.

However as only directed edges are supported my current understanding is that if some vertex is not reachable by a directed traversal then I'll hit a bottleneck later. So whenever I am creating an edge a -> b I am also creating b -> a in the same edge collection.

Are my assumptions correct ? and Is the design decision acceptable ?


Solution

  • While edges are always directed, you can choose to ignore the edge direction in a traversal by using ANY: https://www.arangodb.com/docs/stable/aql/graphs-traversals.html

    • OUTBOUND to follow an edge in its defined direction (_from_to)
    • INBOUND to follow in the opposite direction (_from_to)
    • ANY to follow regardless of the edge direction, inbound and outbound (_from_to)

    Traversal directions in graph