The example that I would like to present for admissible heuristic that is not consistent goes like this:
So, basically the admissible heuristic is that algorithm that never overestimates the cost of finding the path, this means that the cost of reaching a point X from a point Y will always be less than or equal to the actual cost.
Now, let’s say there exists a heuristic function h(x), that will help us estimate the cost for reaching to a node Y. Now, as far as the definition goes, admissible heuristic is that algorithm that never overestimates. So, if we imagine ourselves standing in a place where we can go up, down, left and right in one 1 box. Then the function would be behaving something like this:
For a given node assuming that it’s in centre, then if we have go south or north, then h(X) will be a vertical distance for the goal
If we have go east or west from that node, then h(X) will be a horizontal distance for the goal
If we are going in another direction then it will be 0.
Now, let’s say we have two nodes, C and D which are adjacent to each other, and they both have the same goal of reaching to the north. Then in this case we would be having an inconsistent admissible heuristic