ArticleslgStudy

computer science

Iterative deepening A*

Iterative deepening A* is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Iterative deepening A* rather than just read about it. In short: Iterative deepening A* (IDA*) is a graph traversal and path search algorithm that can find the shortest path between a designated start node and any member of a set of goal nodes in a weighted graph. It is a variant of iterative deepening depth-first search that borrows the idea to use a heuristic function to conservatively estimate the remaining cost to get to the goal from the A* search algorithm.

Key takeaways

  • Iterative deepening A* belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Iterative deepening A* to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Iterative deepening A* from memory before moving on to harder problems.

Reference excerpt

Iterative deepening A* (IDA*) is a graph traversal and path search algorithm that can find the shortest path between a designated start node and any member of a set of goal nodes in a weighted graph. It is a variant of iterative deepening depth-first search that borrows the idea to use a heuristic function to conservatively estimate the remaining cost to get to the goal from the A* search algorithm. Since it is a depth-first search algorithm, its memory usage is lower than in A*, but unlike ordinary iterative deepening search, it concentrates on exploring the most promising nodes and thus does not go to the same depth everywhere in the search tree. Unlike A*, IDA* does not utilize dynamic programming and therefore often ends up exploring the same nodes many times. While the standard iterative deepening depth-first search uses search depth as the cutoff for each iteration, the IDA* uses the more informative f ( n ) = g ( n ) + h ( n ) {\displaystyle f(n)=g(n)+h(n)} , where g ( n ) {\displaystyle g(n)} is the cost to travel from the root to node n {\displaystyle n} and h ( n ) {\displaystyle h(n)} is a problem-specific heuristic estimate of the cost to travel from n {\displaystyle n} to the goal. The algorithm was first described by Richard E. Korf in 1985.

Description Iterative-deepening-A* works as follows: at each iteration, perform a depth-first search, cutting off a branch when its total cost f ( n ) = g ( n ) + h ( n ) {\displaystyle f(n)=g(n)+h(n)} exceeds a given threshold. This threshold starts at the estimate of the cost at the initial state, and increases for each iteration of the algorithm. At each iteration, the threshold used for the next iteration is the minimum cost of all values that exceeded the current threshold. As in A*, the heuristic has to have particular properties to guarantee optimality (shortest paths). See Properties below.

Pseudocode path current search path (acts like a stack) node current node (last node in current path) g the cost to reach current node f estimated cost of the cheapest path (root..node..goal) h(node) estimated cost of the cheapest path (node..goal) cost(node, succ) step cost function is_goal(node) goal test successors(node) node expanding function, expand nodes ordered by g + h(node) ida_star(root) return either NOT_FOUND or a pair with the best path and its cost procedure ida_star(root) bound := h(root) path := [root] loop t := search(path, 0, bound) if t = FOUND then return (path, bound) if t = ∞ then return NOT_FOUND bound := t end loop end procedure

function search(path, g, bound) node := path.last f := g + h(node) if f > bound then return f if is_goal(node) then return FOUND min := ∞ for succ in successors(node) do if succ not in path then path.push(succ) t := search(path, g + cost(node, succ), bound) if t = FOUND then return FOUND if t < min then min := t path.pop() end if end for return min end function

Properties Like A*, IDA* is guaranteed to find the shortest path leading from the given start node to any goal node in the problem graph, if the heuristic function h is admissible, that is

h ( n ) ≤ h ∗ ( n ) {\displaystyle h(n)\leq h^{*}(n)}

for all nodes n, where h* is the true cost of the shortest path from n to the nearest goal (the "perfect heuristic"). IDA* is beneficial when the problem is memory constrained. A* search keeps a large queue of unexplored nodes that can quickly fill up memory. By contrast, because IDA* does not remember any node except the ones on the current path, it requires an amount of memory that is only linear in the length of the solution that it constructs. Its time complexity is analyzed by Korf et al. under the assumption that the heuristic cost estimate h is consistent, meaning that

h ( n ) ≤ c o s t ( n , n ′ ) + h ( n ′ ) {\displaystyle h(n)\leq \mathrm {cost} (n,n')+h(n')}

for all nodes n and all neighbors n' of n; they conclude that compared to a brute-force tree search over an exponential-sized problem, IDA* achieves a smaller search depth (by a constant factor), but not a smaller branching factor. Recursive best-first search is another memory-constrained version of A* search that can be faster in practice than IDA*, since it requires less regenerating of nodes.

Time Complexity While IDA* is often praised for its memory efficiency compared to A*, its worst-case time complexity can be significantly worse under certain conditions:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Iterative deepening A*

Start with the simplest possible case. Write down what Iterative deepening A* claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Iterative deepening A* before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Iterative deepening A* ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Iterative deepening A*

In research
Iterative deepening A* appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Iterative deepening A* in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Iterative deepening A* is common in secondary-school and first-year university syllabi. It links to neighbouring topics Game artificial intelligence, Graph algorithms, Routing algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Iterative deepening A* outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Iterative deepening A*” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Iterative deepening A* in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Iterative deepening A* means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Iterative deepening A* out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Iterative deepening A* in simple terms?

Iterative deepening A* (IDA*) is a graph traversal and path search algorithm that can find the shortest path between a designated start node and any member of a set of goal nodes in a weighted graph. It is a variant of iterative deepening depth-first search that borrows the idea to use a heuristic…

Why does Iterative deepening A* matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Iterative deepening A*?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Iterative deepening A*.

Tags

  • Game artificial intelligence
  • Graph algorithms
  • Routing algorithms
  • Search algorithms

Keep exploring