Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the point of IDA* vs A* algorithm

I don't understand how IDA* saves memory space. From how I understand IDA* is A* with iterative deepening.

What's the difference between the amount of memory A* uses vs IDA*.

Wouldn't the last iteration of IDA* behave exactly like A* and use the same amount of memory. When I trace IDA* I realize that it also has to remember a priority queue of the nodes that are below the f(n) threshold.

I understand that ID-Depth first search helps depth first search by allowing it to do a breadth first like search while not having to remember every every node. But I thought A* already behaves like depth first as in it ignores some sub-trees along the way. How does Iteratively deepening make it use less memory?

Another question is Depth first search with iterative deepening allows you to find the shortest path by making it behave breadth first like. But A* already returns optimal shortest path (given that heuristic is admissible). How does iterative deepening help it. I feel like IDA*'s last iteration is identical to A*.

like image 666
tcui222 Avatar asked Oct 08 '15 21:10

tcui222


People also ask

How is IDA * better than A *?

To conclude, IDA* has a better memory usage than A*. As in A* and unlike IDDFS, it concentrates on exploring the most promising nodes, and thus does not go to the same depth everywhere in the search tree (whereas ordinary IDDFS does). A* can be thought of as a dynamic programming algorithm.

WHY A * algorithm is better?

Because of its flexibility and versatility, it can be used in a wide range of contexts. A* is formulated with weighted graphs, which means it can find the best path involving the smallest cost in terms of distance and time.

Is IDA * optimal?

Optimality: IDA* finds optimal solution, if the heuristic function is admissible. Completeness: IDA*is complete. It always finds solution. It always finds solution if it exists within the threshold limit.

Why we use A * search algorithm?

It is a searching algorithm that is used to find the shortest path between an initial and a final point. It is a handy algorithm that is often used for map traversal to find the shortest path to be taken. A* was initially designed as a graph traversal problem, to help build a robot that can find its own course.


1 Answers

In IDA*, unlike A*, you don't need to keep a set of tentative nodes which you intend to visit, therefore, your memory consumption is dedicated only to the local variables of the recursive function.

Although this algorithm is lower on memory consumption, it has its own flaws:

Unlike A*, IDA* doesn't utilize dynamic programming and therefore often ends up exploring the same nodes many times. (IDA* In Wiki)

The heuristic function still needs to be specified for your case in order to not scan the whole graph, yet the scan's memory required in every moment is only the path you are currently scanning without its surrounding nodes.

Here is a demo of the memory required in each algorithm:

Memory Map

In the A* algorithm all of the nodes and their surrounding nodes needs to be included in the "need to visit" list while in the IDA* you get the next nodes "lazily" when you reach its previews node so you don't need to include it in an extra set.

As mentioned in the comments, IDA* is basically just IDDFS with heuristics:

IDDFS vs IDA*

like image 173
Tamir Vered Avatar answered Oct 11 '22 12:10

Tamir Vered