cancel
Showing results for 
Search instead for 
Did you mean: 

Graph Data Science DFS traversal takes forever

cuneyttyler
Ninja
Ninja

I have the following query. Although I gave maxDepth = 1, the run never ends. When I run this with BFS it instantly returns. Isn't it supposed to be fast with maxDepth = 1? (NOTE: I have a very large graph but I'm not sure if that's relevant when maxDepth = 1)

MATCH (a:Entity{name:'Steve Jobs'}), (d:Entity{name:'Apple Inc.'})
WITH id(a) AS source, [id(e)] AS targetNodes
CALL gds.dfs.stream('myGraph', {
sourceNode: source,
targetNodes: targetNodes,
maxDepth: 1
})
YIELD path
RETURN path
6 REPLIES 6

A few things to check:

  1. What version of GDS are you using?
  2. What's the degree of your source node (Steve Jobs)
  3. If you check gds.beta.listProgress or the logs, do you see anything printed there?

Hi, I'm reimporting my database and it will take a couple of hours then I'll run listProgress to see it's output.

My GDS version is 2.0.4 and the degree of Steve Jobs is about 30.

Thanks.

.

Log says 'Finished' for DFS but neo4j browser stucks at loading screen. And even if I give a larger maxDepth like 10000, it finishes in a short time which is really unexpected this time. Also gds.beta.listprogress outputs 'n/a' for DFS progress.

And 'Steve Jobs' and 'Apple Inc.' are directly connected.

glilienfield
Ninja
Ninja

I assume it’s a typo, but your target node array has id(e), but your two matched nodes are bound to ‘a’ and ‘d’.  Should it be id(d) instead? 

Yes, sorry about that I can't edit the post and in my previous response I already gave it as 'd'.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online