cancel
Showing results for 
Search instead for 
Did you mean: 

Join the community at Nodes 2022, our free virtual event on November 16 - 17.

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 - November 16 - 17, 2022.


Free NODES Training Series


October 19th -

Intro to Neo4j


October 20th -

Healthcare Analytics Using Neo4j


October 25th -

Handling Neo4j data with Apache Hop


October 26th -

Blazing Fast Graphs: Hands-on with Apache Arrow and Neo4j


November 2nd -

Graph EDA Using the Neo4j GDS Client