A heuristic function is a problem-specific, domain-knowledge function, denoted as h(n), that estimates the cost from a given node n to the nearest goal state in a search problem. It is a critical component of informed search algorithms like A* and Greedy Best-First Search, providing a computationally cheap approximation to guide the exploration of the state space toward more promising regions, thereby dramatically improving efficiency over brute-force methods.
