# Which heuristics guarantee the optimality of A*?

The following is a statement and I am trying to figure out if it's true or false and why.

Given a non-admissible heuristic function, A* will always give a solution if one exists, but there is no guarantee it will be optimal.

I know that a non-admissible function is $$h(n) > h^*(n)$$ (where $$h^*(n)$$ is the real cost to the goal), but I do not know if there is a guarantee.

Which heuristics guarantee the optimality of A*? Is the admissibility of the heuristic always a necessary condition for A* to produce an optimal solution?

Admissibility is not a necessary condition. Take any admissible heuristic $$h_1$$ and make a new function $$h(n) = h_1(n)+5$$. This heuristic is not admissible, but if you run A* on it, it will still find optimal solutions.