Created a method that accepts an ArrayList of Locations and returns an ArrayList with the shortest path.