Fixed the compareTo() in Vertex.java and rewrote dijkstra() inside Graph.java accordingly.