...f(n) = g(n) + h(n)
where n is the last node on the path, g(n) is the cost of the path from the start node to n, and h(n) is a heuristic that estimates the cost of the cheapest path from n to the goal.
Why do we consider the cost of the path from the start node to where we currently are? I have been playing around with implementing this algorithm for a problem, and have been using a priority queue and when I do g(n) + h(n) it takes longer than just using strictly h(n). Wouldn't it make sense to only use h(n) since hypothetically if the heuristic is accurate you only care about how close you are to your goal?
EDIT: Actually I just discovered that my g(n) function was computing wrong, but I still logically don't really understand why g(n) + h(n) would be better than just h(n).
An easy way to see why leaving out g(n) leads to an incorrect algorithm is the fact that the real costs would never enter the algorithm. It relies totally on the heuristic, which is only guaranteed to be a lower bound.