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.
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.