This class requires that either
The following Comparator object will order a priority queue's Vertex objects (recall that state objects implement the Vertex interface) by removing those with the lowest heuristic values first:
new Comparator<Vertex>() {
public int compare(Vertex v1, Vertex v2) {
int h1 = ((State) v1).getHeuristic(finalState);
int h2 = ((State) v2).getHeuristic(finalState);
return h1 - h2;
}
}