tinkerpop/gremlin — Issue #278: "paths" skips self-loop steps
Author: i000
Created: 2012-01-23 14:07:11+00:00
State: open

Hi,

I am doing a random walk on a TinkerPop graph. At each vertex a random walker decides to choose a neighbor, or to return to the starting vertex (this is called random walk with restart). I am interested in obtaining the paths of the random walker:

gremlin> v.sideEffect{println it.id}.wrwr(<>).loop(2){it.loops < 10}.paths

Since the loop is of length 10 I expect the path to be also of lenght 10. As you can se this is not the case

==>[v[6552], v[29400], v[33788], v[15076], v[6552], v[36202], v[13360], v[34304]]

The reason this happens is because steps like this vertex_X -> vertex_X (via a restart or self-loop are omitted)

6552 (starting vertex)
6552 (restart, OMITTED)
29400 (walk)
33788 (walk)
15076 (walk)
6552 (restart, RECORDED)
6552 (restart, OMITTED)
36202 (walk)
13360 (walk)

I believe the path should contain all steps.

Thanks