BaseDijkstra: adds shortestPath function