title: Why does the A-star algorithm need g(n)?
body: <p>Dijkstra's algorithm is <code>f(n) = g(n)</code><br>
  and A* is <code>f(n) = g(n) + h(n)</code>.</p>
  
  <p>g(n) is the cost of the path from the start node to n.<br>
  h(n) is a heuristic function that estimates the cost of the cheapest path from n to the goal.</p>
  
  <p>Is g(n) needed? Can't it find the shortest path without g(n)?</p>
  
  <p>Why does A* need g(n)?</p>