7

I have a problem with graph traversal. My use case is not solvable using typical graph traversal algorithms (DFS, BFS). I want traverse nodes, starting from specific Node (N), where edge is of type ET. I want to retrieve all nodes with their &path from N to the node. This is possible using one of the Orient's strategies but I want to have all possible paths - not only one.

Sample:

graph

For above graph there are two paths from R to C :

  • Root -> A -> C
  • Root -> B -> C

My graphs can be bit more comples but the idea is the same.

In OrientDB documentation I found that there's a method on Graph that returns all edges (getEdgesofClass(String class)). I thought that I might solve my problem If I could somehow specify the graph (subgraph of main graph - only nodes that are connected with Root node) that on which I want to call this method.

Thanks for all the input.

goral
  • 1,185
  • 10
  • 16

0 Answers0