What is the A* evaluation function f(n) = g(n) + h(n), and what do each of its components represent?
The A* evaluation function estimates the total cost of the cheapest path from start vertex s to goal vertex g passing through vertex n: f(n) = g(n) + h(n). Here, g(n) is the exact cost of the shortest path found so far from s to n (historical cost-to-come), updated dynamically through edge relaxation. The term h(n) is an admissible and consistent heuristic function estimating the minimum cost from n to g (prospective cost-to-go). The sum f(n) represents the total estimated cost, allowing A* to prioritize nodes that balance verified short distance from the start with promising proximity to the target.