N- Type of node
public interface Heuristic<N>
Heuristicgenerates estimates of the cost to move from a given node to the goal.
With a heuristic function pathfinding algorithms can choose the node that is most likely to lead to the optimal path. The notion of "most likely" is controlled by a heuristic. If the heuristic is accurate, then the algorithm will be efficient. If the heuristic is terrible, then it can perform even worse than other algorithms that don't use any heuristic function such as Dijkstra.