News for hackers. Stuff that matters.
Re:Pathfinding Demystified by ichinaski on Friday May 16, 2014 @04:07AM (#7754333)
> # If we just got to the goal node, build and return the path.

  if adjacent == goal_node: 
    return build_path(goal_node)
If you want to ensure the path is optimal, you'll have to wait until you 'expand' the goal node, as there might exist goal states in the open set with lower costs.
Re:Pathfinding Demystified by ggambetta on Friday May 16, 2014 @04:31AM (#7754410)
Fixed. It's a copy-paste artifact from Part I, where the algorithm is looking for a path, not the optimal path, so it didn't matter. Thanks!