Find the Shortest Path in a Graph Program in Java