cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Random walk runs forever with sourceNodes parameter

kasthuri
Node Clone

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.

4 REPLIES 4

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.

kasthuri
Node Clone

The GDS version is 1.8.2

@kasthuri try updating to GDS 1.8.7

kasthuri
Node Clone

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

Best
K

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online