Inferensys

Glossary

IDA* (Iterative Deepening A*)

IDA* (Iterative Deepening A*) is a memory-efficient graph search and pathfinding algorithm that combines the space efficiency of iterative deepening depth-first search with the heuristic guidance of the A* algorithm.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
HEURISTIC SEARCH ALGORITHM

What is IDA* (Iterative Deepening A*)?

IDA* (Iterative Deepening A*) is a memory-efficient graph search and pathfinding algorithm that combines the space efficiency of iterative deepening depth-first search with the heuristic guidance of the A* algorithm.

Iterative Deepening A (IDA)** is a best-first search algorithm that performs a series of depth-first searches, each with an increasing cost threshold defined by the f-cost (f(n) = g(n) + h(n)). It explores all nodes where the total estimated cost does not exceed the current threshold, guaranteeing an optimal solution when using an admissible heuristic. This approach requires memory proportional only to the depth of the solution, making it ideal for state spaces where memory is a primary constraint.

The algorithm begins with a threshold equal to the heuristic estimate of the start node. Each depth-first search iteration explores paths until the f-cost exceeds the threshold, then updates the threshold to the minimum f-cost that was found and exceeded. This process repeats until a goal node is found. While highly space-efficient, IDA* can suffer from node re-expansion overhead in graphs with many distinct f-cost values, as states are revisited in each new iteration.

ALGORITHM MECHANICS

Key Features of IDA*

IDA* (Iterative Deepening A*) is a memory-efficient pathfinding algorithm that merges the systematic depth-limiting of iterative deepening with the informed guidance of the A* heuristic. Its core design addresses the memory explosion problem of standard A* search.

01

Iterative Deepening with a Cost Threshold

IDA* performs a series of depth-first searches (DFS), each with an increasing cost threshold (often denoted as f-limit or bound). This threshold is the maximum allowed f-cost for a node, where f(n) = g(n) + h(n).

  • g(n): The actual cost from the start node to node n.
  • h(n): The heuristic estimate from node n to the goal. The algorithm explores all paths where f(n) ≤ threshold. If the goal is not found, the threshold is increased to the minimum f-cost that exceeded the previous bound, and a new DFS begins. This process repeats until the goal is found.
02

Linear Memory Complexity

The primary advantage of IDA* is its extremely low memory footprint. Because it uses depth-first search at its core, it only needs to store the current path from the root to the frontier node on the call stack.

  • Memory Complexity: O(d), where d is the depth of the solution. This is linear in the depth of the search tree.
  • Contrast with A*: Standard A* must maintain both an open set (frontier) and a closed set (explored nodes), leading to memory complexity that is exponential in the depth for many problems (O(b^d), where b is branching factor). IDA* sacrifices time to regain tractable space usage for very deep searches.
03

Optimality Guarantee (Admissible Heuristic)

Like A*, IDA* guarantees an optimal solution (the shortest path or least-cost path) provided its heuristic function, h(n), is admissible. An admissible heuristic never overestimates the true cost to reach the goal.

  • The iterative deepening process ensures the first goal node found is the one with the lowest f-cost.
  • Because the threshold increases to the minimum exceeding cost, the algorithm systematically explores nodes in order of increasing f-cost, mirroring A*'s optimal expansion order without storing all frontier nodes.
04

Completeness (Finite Branching Factor)

IDA* is a complete algorithm, meaning it will always find a solution if one exists, given two conditions:

  1. The state space has a finite branching factor.
  2. The cost function is such that there are no cycles with zero or negative cost that could trap the search indefinitely. Its completeness is inherited from iterative deepening depth-first search (IDDFS), which itself is complete because it eventually searches to any finite depth.
05

Susceptibility to Heuristic Plateaus

A significant weakness of IDA* is its performance on problems with large areas of states sharing the same f-cost, known as heuristic plateaus or f-cost contours.

  • On a plateau, the algorithm conducts a full depth-first search within that entire f-cost contour before increasing the threshold.
  • This can lead to excessive node re-expansion, as nodes on the plateau are revisited in each iteration until the threshold finally increases. This makes its time complexity often worse than A*'s for problems where the heuristic provides less discriminative guidance.
06

Primary Use Case: Memory-Constrained Pathfinding

IDA* is the algorithm of choice when the state space is extremely large and storing the entire frontier and explored sets is infeasible, but an admissible heuristic is available. Classic Applications:

  • The 15-puzzle and other sliding tile puzzles.
  • Solving Rubik's Cube optimally.
  • Theorem proving and other combinatorial search problems in AI. It is less suitable for real-time pathfinding in video games or robotics, where A*'s faster time performance (using memory) is typically preferred.
ALGORITHM MECHANICS

How IDA* Works: Step-by-Step

Iterative Deepening A* (IDA*) is a memory-efficient graph search algorithm that finds optimal paths by performing a series of depth-first searches with incrementally increasing cost thresholds, guided by a heuristic function.

The algorithm begins by setting an initial cost threshold equal to the heuristic estimate from the start node. It then performs a depth-first search (DFS), recursively exploring paths and summing the actual cost (g(n)) and heuristic estimate (h(n)) for each node. If the total f-cost (f(n) = g(n) + h(n)) at any node exceeds the current threshold, that branch is pruned. The DFS continues until it either finds the goal node within the threshold or exhausts all paths below it.

If the goal is not found, the algorithm iteratively deepens by identifying the minimum f-cost that exceeded the previous threshold among all pruned branches. This cost becomes the new threshold for the next DFS iteration. This process repeats, with the threshold increasing each iteration, until the goal node is found. The final path returned is guaranteed to be optimal if the heuristic is admissible (never overestimates the true cost to the goal).

IDA* (ITERATIVE DEEPENING A*)

Frequently Asked Questions

IDA* (Iterative Deepening A*) is a memory-efficient heuristic search algorithm. These questions address its core mechanics, trade-offs, and practical applications for developers optimizing agent decision-making.

IDA (Iterative Deepening A)** is a memory-optimal graph search algorithm that finds the lowest-cost path by performing a series of depth-first searches (DFS) with an incrementally increasing cost threshold, guided by the same admissible heuristic used in A* search.

Its operation is a loop:

  1. Initialize Threshold: Start with a threshold equal to the heuristic estimate from the start node, f(start) = h(start).
  2. Depth-First Search: Perform a DFS that prunes any branch where the total estimated cost f(n) = g(n) + h(n) exceeds the current threshold. g(n) is the actual cost from the start to node n.
  3. Update & Repeat: If the goal is not found, set the new threshold to the minimum f-cost that exceeded the previous threshold among all pruned nodes. Repeat the DFS with this new, higher threshold.

This process continues until the goal node is found, guaranteeing an optimal solution if the heuristic is admissible (never overestimates the true cost).

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.