I'd like to traverse all the nodes within a specific depth using traversal 
framework.
The start node (userNode) is uo.

TraversalDescription friendsTraversal = graphDb.traversalDescription()
            .evaluator(Evaluators.excludeStartPosition())
                    .evaluator(Evaluators.toDepth(4))
                    .depthFirst()
                    
.relationships(DynamicRelationshipType.withName("KNOWS"))
                    .uniqueness(Uniqueness.RELATIONSHIP_GLOBAL);
    
for (Node currentNode : friendsTraversal.traverse(userNode).nodes())       
             // userNode: uo
    traversedNodes += currentNode.getProperty("name") + " ";     
     
System.out.println(String.format("%s [TRAVERSES, depth %d] %s", 
userNodeName, depth, traversedNodes));

The result is as follows.
uo [TRAVERSES, depth 4] uu ux GG uo QP QQ QA 

Question 1. How come uo is included in the traversed nodes in spite of 
excluding the start position by calling 
evaluator(Evaluators.excludeStartPosition()).
Question 2. How come KX is not included in the traversed nodes though it's 
4 depths away from the uo node.

My expected nodes traversed are { uu, ux, QP, GG, QQ, KX }.

The node topology is shown below. The blue edges are KNOWS edges.

<https://lh4.googleusercontent.com/-Thm847nTmVE/U8fcNrB6HBI/AAAAAAAABw8/WrY_ZM5P-JQ/s1600/image2013-12-18+10-55-30.png>


-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to