DijkstraShortestPath giving correct results for test cases