A* vs IDA*

In Chapter 1, The Basics of AI in Games, we mentioned some of the differences between A* and IDA*. Now that you've implemented A*, you can see that the A* implementation keeps a few things in memory—the path array, the open list, and the closed list. At different points in the implementation, you may allocate more or less memory as you iterate through your lists. In this regard, A* is greedier than IDA*, but keep in mind that in most cases, on modern hardware, this is not an issueeven with much larger grids than ours.

The IDA* approach only looks at the the current iteration's adjacent/neighbor spots, and because it keeps no record of the visited nodes, it may end up visiting the same node multiple times. In similar circumstances, ...

Get Unity 2017 Game AI Programming - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.