# Is there a condition that guarantees that hill climbing will find the optimal solution?

I am studying intro to AI with shortest-path algorithms like A* and hill climbing. I learned that A* is guaranteed to find the optimal solution if the heuristic function h(n) has the property : $$h(n) \leq \text{ actual distance n-t}$$ . Is there a (mathematical) condition that tells us when we can trust hill climbing that will the optimal solution ? With some searches I could not find something clear.

• Convex problems can be solved this way. Otherwise it will can find a local optima but it may not be global. Aug 30, 2022 at 16:47