added a brute force algorithm for finding the shortest path