@Override
        public int compare(Object o1, Object o2)
        {
            if ((o1.getClass() != Vertex.class && o1.getClass() != Point.class) ||
                (o2.getClass() != Vertex.class && o2.getClass() != Point.class))
                return 0;
            Vertex v1 = (Vertex)o1;
            Vertex v2 = (Vertex)o2;
            return (shortestPaths.get(v1) + aStarHeuristic(v1) < 
                    shortestPaths.get(v2) + aStarHeuristic(v2)) ? -1 : 1;
        }