I have the following Graph Data Science BFS call. In this call, When I gave both 'Apple Inc.' and 'Microsoft' as target nodes, it only returns results with 'Steve Jobs' and 'Apple' which are directly linked. When I only give 'Microsoft' as target node, it returns a lot of nodes including source and target and many irrelevant.
I'd expect it to return only the PATH although it returns a lot of nodes(about 300) that are not in the path. I also would expect it that when I give both 'Apple' and 'Microsoft' as target nodes to return a union of these two although it now only returns a very small graph with only 'Steve Jobs' and 'Apple' (and a one common node linked by both)
These are some unexpected output I have encountered. Can you explain why are these happening and is there any way to get correct output?
Thanks.
My query:
MATCH (a:Entity{name:'Steve Jobs'}), (d:Entity{name:'Apple Inc.'}), (e:Entity{name:'Microsoft'})
WITH id(a) AS source, [id(d),id(e)] AS targetNodes
CALL gds.bfs.stream('myGraph', {
sourceNode: source,
targetNodes: targetNodes,
maxDepth: 4
})
YIELD path
RETURN path