-1

Let's say we have a person trying to walk from east to west, but a north-south wall is in the way. Let's also say that the wall is longer north than it is south (relative to the person). What options are there to receive the best possible heuristic values, and make sure he walks towards the south end of the wall instead of the north?

Thank you.

ludluck
  • 127
  • 9
  • 2
    The keyword you're looking for is "path finding". – CodeCaster Oct 08 '16 at 21:07
  • But the problem I am having is actually calculating an `h(n)`. In fact, I'm not even sure which (`g(n)` or `h(n)`) something like Manhattan distance is. I'm guessing it is `h(n)`, but then I do not know how to calculate `g(n)`. – ludluck Oct 08 '16 at 21:49

1 Answers1

3

I guess you mean path planning with A* or similar. The simplest heuristic is just the real distance from your person without obstacles to the goal. With this heuristic you will always find the shortest path to the goal.

For a deeper look into this topic I recommend to read this.

marli
  • 529
  • 10
  • 19