I'm projecting a graph with the below code:
CALL gds.graph.project(
'entityGraph',
'Entity',
'TO_ENTITY'
)
When I use this projected graph in the call to GDS algorithm dijkstra it returns the desired result. However, when I use this graph in my custom pregel function, when I debug info of the given start node's degree, it says 0. I'm absolutely sure that my start node has TO_ENTITY relationships as I see them when I query that node.
My GDS version is 2.0.4
What might be the cause of the pregel displaying degree as zero?
Thanks.
Seems I don't have access to the repo, getting a 404.
It seems I don't have access to the repo, getting a 404.
Sorry, I made it available now.
Thanks. I had a look and I think the problem is exactly what I described in my first reply. In https://gitlab.com/cuneyttyler/dijkstra-multiple-inputs/-/blob/master/src/main/java/com/semanticspace/neo4j/DijkstraMultipleInputs.java#L45 you're checking the internal node id against the original node id (the user input). Those are not necessarily the same node entity, so the degree might differ. I suspect that if you run an algo test (using a GDLGraph) with that computation you'll see the correct degrees since the GDL Graph has (by default) the same internal and original id space.
However, I assume you took the Pregel examples as a template and there, we also show it in the same way. I'll will add methods to the ComputeContext which will allow you to map node ids between the id spaces.
Thanks! I didn't realise that. So I was very new when I asked the question but now I also have a look at the GDS Api and saw tests there. Now I'll run a test and see what happens.
EDIT: But now I realize that in that line where I check for the nodeId == config.startNode() - I didn't write that code. I took it from the Pregel BFS example. So the example also checks if the processed node is the start node this way. Is there something wrong with the Pregel example as well?
PR is open on the interal repo. With a bit of luck it will be in the 2.1 release next week.
As I wrote in my previous reply, I figured that you took that snippet from the examples. And it's also "wrong" there, so I'll add methods that allow the mapping and will also update the example.