implemented parallel dijkstra