Improved testDijkstra by creating loops in graph