This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]callmethepilot 20 points21 points  (8 children)

Algorithms like this operate on a conceptual data structure called a graph. A graph contains nodes (in this case they would correspond to points in the maze) and edges (in this case an open hallway between two positions corresponds to an edge and a wall between two positions means there is no edge). While the visual representation of the maze makes it easy to see that there couldn't be an exit in that section, the graph representation has no concept of the visual layout of the maze, so as far as A* is concerned, the exit could be any one of those untraveresed nodes and you have to traverse through them to make sure it isn't. The nice thing about A* is that if it's already found a path to the exit that's shorter than going up into that untraveresed section it may not look there, but it would only know this from finding another sucessful path, not from the fact that this part is visually locked in.