Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-03-2022 10:59 AM - last edited on 07-25-2022 09:18 AM by TrevorS
I developed a Multi-Threaded Multi Pair Dijkstra algorithm using GDS core api. It takes list of ids as start nodes and target nodes. When I project a graph and call my method and after that I dropped that graph projection and reproject the graph with same parameters, my algorithm gives different results.
Another issue is that it sometimes starts with a node which is not in the start nodes list. But I simply followed the procedure in the Dijkstra's algorithm from the core api. My code simply takes it and converts it into a mult-threaded, multi-paired version. The Dijkstra method stays. This might be a detail question but I'd be very grateful if you could look at my code and tell me if there is anything wrong. I tried to do decent coding concerning thread-safety.
Here is my code : https://github.com/cuneyttyler/semanticspace-neo4j-gds/blob/master/algorithms/src/main/java/com/sema...
Note: Test cases run perfectly but it gives undesired results on production.
EDIT: I logged some things and I see that the degree of the source node(or any other node I'm not sure about that) is different than actual. So the graph object interprets the node id differently I think and when traversing the relationships, it traverse wrong relationships so it returns a wrong path with wrong source nodes(Targets are also sometimes wrong too). This might be because internal node id's are different than database ids. But the api should convert the given database ids to internal ids. I think that's the way it works in other algorithms. Another interesting thing is that sometimes it returns a path with correct source and sometimes not.
Thanks in advance.
Solved! Go to Solution.
06-03-2022 01:58 PM
I solved the issue. As I pointed out in the edit, the id's doesn't match because I forgot to convert the input parameter ids to internal ids with graph.toMappedNodeId method. After that it works correctly.
06-03-2022 01:58 PM
I solved the issue. As I pointed out in the edit, the id's doesn't match because I forgot to convert the input parameter ids to internal ids with graph.toMappedNodeId method. After that it works correctly.
All the sessions of the conference are now available online