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.
Glossary
IDA* (Iterative Deepening A*)

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.
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.
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.
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.
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.
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.
Completeness (Finite Branching Factor)
IDA* is a complete algorithm, meaning it will always find a solution if one exists, given two conditions:
- The state space has a finite branching factor.
- 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.
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.
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.
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).
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:
- Initialize Threshold: Start with a threshold equal to the heuristic estimate from the start node,
f(start) = h(start). - 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 noden. - 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).
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
IDA* is a core algorithm within the broader family of heuristic search techniques. Understanding these related concepts is essential for developers optimizing agent decision-making under computational constraints.
A* Search
The foundational algorithm upon which IDA* is built. A Search* is a best-first graph traversal algorithm that finds the lowest-cost path by combining the actual cost to reach a node, g(n), with a heuristic estimate of the cost to the goal, h(n). It maintains an open list (priority queue) of nodes to explore and a closed list of explored nodes, guaranteeing optimality if the heuristic is admissible (never overestimates). Its primary drawback is memory usage, as it stores all generated nodes, which IDA* was designed to solve.
- Key Property: Optimal and complete with an admissible heuristic.
- Memory Complexity: O(b^d), where b is branching factor, d is solution depth.
- Primary Use Case: Pathfinding in video games (e.g., NPC navigation) and robotics when memory is not a critical constraint.
Iterative Deepening
The memory-saving strategy that IDA* adapts. Iterative Deepening is a graph search strategy that performs a series of depth-limited depth-first searches (DFS), incrementally increasing the depth limit until the goal is found. It combines the space efficiency of DFS (O(bd), where b is branching factor, d is depth) with the completeness and optimality guarantees of breadth-first search (BFS) for unweighted graphs. Each iteration re-explores shallower levels, which seems inefficient but is often acceptable because the number of nodes grows exponentially with depth.
- Core Mechanism: Repeated depth-first searches with increasing cutoff.
- Advantage: Drastically reduces memory footprint compared to BFS or A*.
- Foundation: Provides the iterative, depth-first framework that IDA* enhances with heuristic guidance.
Depth-First Search (DFS)
The underlying traversal method for each iteration of IDA*. Depth-First Search (DFS) is a graph traversal algorithm that explores as far as possible along each branch before backtracking, using a stack (either explicitly or via recursion) to manage the search frontier. It is not optimal and not complete in infinite spaces, but it has minimal memory requirements, storing only the current path (O(d)). IDA* uses a DFS at its core for each cost-bound iteration, but guides it with a heuristic f-cost threshold instead of a simple depth limit, and prunes branches where f(n) exceeds the bound.
- Memory Use: O(d), ideal for deep search spaces.
- IDA Adaptation*: DFS is modified to use an f-cost limit (g(n)+h(n)) and to return the next minimum threshold.
Recursive Best-First Search (RBFS)
Another memory-efficient best-first search algorithm often compared to IDA*. Recursive Best-First Search (RBFS) is a recursive algorithm that simulates A* search while using only linear space. It keeps track of an f-limit for each recursive call and updates alternative f-cost values for siblings. When a node's f-cost exceeds its f-limit, recursion unwinds to the next best alternative path. Compared to IDA*, RBFS can be more efficient in terms of node regeneration because it remembers the best alternative path, but it involves more complex bookkeeping and overhead.
- Space Complexity: O(bd), but often more efficient in practice than IDA*.
- Trade-off: Reduces node re-expansion at the cost of increased computational overhead per node.
- Use Case: Useful for problems where the heuristic is expensive to compute, making node regeneration costly.
Heuristic Function (h(n))
The guiding intelligence for both A* and IDA*. A heuristic function, h(n), estimates the cost from a given node n to the nearest goal state. The quality of this function directly determines algorithm efficiency.
- Admissible Heuristic: Never overestimates the true cost. Required for A* and IDA* to guarantee optimality. Example: Straight-line distance in pathfinding.
- Consistent (Monotonic) Heuristic: Satisfies the triangle inequality: h(n) ≤ c(n, n') + h(n'), where n' is a successor of n. Ensures A* finds optimal paths without re-opening nodes.
- Dominance: If h₂(n) ≥ h₁(n) for all n, h₂ is said to dominate h₁ and will typically lead to a more efficient search, expanding fewer nodes. IDA*' performance is exceptionally sensitive to the accuracy of the heuristic.
Search Space & State Space
The formal problem context in which IDA* operates. The state space is a conceptual model of a problem, defined by:
- States: All possible configurations of the problem (e.g., a board position in the 15-puzzle, a location on a map).
- Initial State: The starting point.
- Goal State(s): The condition(s) that define a solution.
- Actions/Operators: Rules that define legal moves between states.
- Successor Function: Given a state, returns all states reachable by a single action.
- Path Cost: A function that assigns a numeric cost to a sequence of actions.
The search space is the portion of the state space that is actually explored by an algorithm like IDA*. IDA* excels in large or infinite state spaces where storing the entire explored graph (as A* does) is infeasible, as it only needs memory proportional to the depth of the current path.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us