Random walk runs forever with sourceNodes parameter

I am running the random walk algorithm on my graph with just 4 nodes and 8 edges as a test. When I don't specify the sourceNodes parameter, everything is fine and I get walks from all the nodes. Here is my code:

CALL gds.beta.randomWalk.stream(
'example',
{ 
walkLength: 2,
walksPerNode: 1,
randomSeed: 42,
concurrency: 1
}
)
YIELD nodeIds, path
RETURN nodeIds, [node IN nodes(path) | node.name ] AS event_name

So far so good. But when I specify a source node at a particular node present in the projected graph, the query runs forever and doesn't terminate. Here is the query:

MATCH (n:IDHcodel:Molecular)
WHERE n.name IN ['9q34o3'] 
WITH COLLECT(n) as sourceNodes 
CALL gds.beta.randomWalk.stream(
'example',
{ 
sourceNodes: sourceNodes,
walkLength: 2,
walksPerNode: 1,
randomSeed: 42,
concurrency: 1
}
)
YIELD nodeIds, path
RETURN nodeIds, [node IN nodes(path) | node.name ] AS event_name

I certainly made sure that the node is in the projected graph. Any help would be appreciated. Thanks.

What version of GDS are you running? We've just released patches - 1.8.7 and 2.0.3 - that include a bug fix for random walk with specified start nodes.

1 Like

The GDS version is 1.8.2

@kasthuri try updating to GDS 1.8.7 :slight_smile:

Thanks, Alicia. I have requested my admin to upgrade to the latest version.

Best
K