find the shortest path using Dijkstra without bonus