Calculates the cheapest or fastest routes from one location to another