Dijksta's Algorithm Implemented in Java