changed the name of useDijkstra to minimizeTime