finished shortest path, takes into account time constraints