Hi everyone,
I wanna to find the all n-distant path between two set of nodes (Source and Destination). As I check by profile() and explain() steps, Tinkerpop always uses BFS but it is not efficient. The efficient approach in my task is start from S and D together and try to find common nodes with distance of n/2.
for example I want to find all meta path "Author-->Paper-->Paper<--Paper<--Author" between two set of Authors ( A1:{x,y} and A2:{p,q} ), that is common references in A1's and A2's papers. assume that all nodes has 10 neighbors. BFS should visit more than 2 * 10,000 nodes to find the result, but the efficient traversal is:
- find all papers of x,y,p and q: 40 nodes.
- intersect between the references of these A1's paper and A2's paper: intersect between two set with less than 200 element.
the second approach reduce the traversals significantly, due to starting from limited part of query.
My questions:
- Is this approach is implemented in Tinkerpop yet?
- If no, how can I implement it?
Regards,
Mohsen