I have a problem that I described in graphgist (
http://gist.neo4j.org/?a0bc29b21622a2f19a36). I have 5 users and each user 
has 2 friends.

//USERS

1,2,3,4,5


//FRIENDS

1 -> 2,3

2 -> 1,5

3 -> 4,5

4 -> 2,3

5 -> 2,4


With the information above, I do traversal from depth 2 to depth 5. To do 
traversal, I use Cypher and Traversal API (BFS and DFS).

The problems are:

1. the result of Cypher is different with Traversal API both BFS and DFS.

2. the result of BFS is different with DFS


This is the result of Cypher (or you can see it in the graphgist)

=================================================================

Depth 2: 5,4

Depth 3: 4

Depth 4: 5

Depth 5: 5,4


This is the result of BFS

=========================

Depth 2: 5,4

Depth 3: 5,4

Depth 4: 5,4

Depth 5: 5,4


This is the result of DFS

=========================

Depth 2: 5,4

Depth 3: 5,4,2

Depth 4: 5,4,2

Depth 5: 5,4,2


And this is the way to traverse using BFS:

POST http://localhost:7474/db/data/node/1/traverse/node
{
  "order" : "breadth_first",
  "uniqueness" : "node_global",
  "prune_evaluator" : {
    "name" : "none",
    "language" : "builtin"
  },
  "return_filter" : {
    "body" : "position.length() > 1;",
    "language" : "javascript"
  },
  "relationships" : {
    "direction" : "out",
    "type" : "Friend"
  },
  "max_depth" : 5
}


And this is the way to traverse using DFS:

POST http://localhost:7474/db/data/node/1/traverse/node
{
  "order" : "depth_first",
  "uniqueness" : "node_global",
  "prune_evaluator" : {
    "name" : "none",
    "language" : "builtin"
  },
  "return_filter" : {
    "body" : "position.length() > 1;",
    "language" : "javascript"
  },
  "relationships" : {
    "direction" : "out",
    "type" : "Friend"
  },
  "max_depth" : 5
}


Please correct me if I'm wrong and explain me how Traversal works in Neo4j 
exactly.


Thank you.

Rio

-- 
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 neo4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to