SlideShare a Scribd company logo
Iterative Deepening
G51IAI – Introduction to AI
Andrew Parkes
http://www.cs.nott.ac.uk/~ajp/
Motivations
• BFS & A*
– good for optimality
– bad on memory, O(bd
)
• DFS
– solutions not guaranteed optimal: dives and
misses good nodes
– good for memory O(bd)
• “Iterative Deepening” refers to a method that
tries to combine the best of the above
Depth-Limited Search
• Simply put an upper limit on the depth (cost)
of paths allowed
• Motivation:
– e.g. inherent limit on range of a vehicle
• tell me all the places I can reach on 10 litres of petrol
– prevents search diving into deep solutions
– might already have a solution of known depth
(cost), but are looking for a shallower (cheaper)
one
Depth-Limited Search
• Impose an upper limit on the depth (cost) of
paths allowed
– Only add nodes to the queue if their depth does
not exceed the bound
• DepthLimitedDFS ( k ) :
DFS but only consider nodes with depth d ≤ k
Trees: Depth-Limited
• Depth limit of 2
would mean that
children of E are
ignored
JB C
D
E
F
G
A
H
I
d=0
d=1
d=2
d=3
d=4
Iterative Deepening Search
• Follow the BFS pattern of
“search all nodes of depth d before depth d+1”
• But do the search at depth d using Depth-Limited-DFS
• Schematically:
• IDS:
k=0;
while ( not success && k < depth of tree ) {
Depth-Limited-DFS ( k );
k++
}
Properties of IDS
• Memory Usage
– Same as DFS O(bd)
• Time Usage:
– Worse than BFS because nodes at each level will
be expanded again at each later level
– BUT often is not much worse because almost all
the effort is at the last level anyway, because trees
are “leaf –heavy”
– Typically might be at most a factor two worse
Memory Usage of A*
• We store the tree in order to
– to return the route
– avoid repeated states
• Takes a lot of memory
• But scanning a tree is better with DFS
IDA*
• Combine A* and iterative deepening
• f is the estimate of total path cost for start to
goal
• IDA*:
– Impose a limit on f
– Use DFS to search within the f limit
– Iteratively relax the limit
• Greatly reduces memory usage
• Can repeat far too much work, and so be
slow
Summary
• Algorithm IDS:
– IDS : BFS plus DFS for tree search
• Algorithm IDA*:
– the basis of “state of the art” “complete &
optimal” algorithms
Summary
• BFS & A*: good for optimality, but not memory
• DFS: good for memory O(bd), but not optimality
• “Iterative Deepening” refers to
– IDS “Iterative Deeepening Search”
• mix of DFS and BFS on trees
– a broad approach used for general search, with general aim
to combine optimality with low memory usage of DFS
• Self-Study: carefully work through “ids.ppt”
• Expectations:
– know about the motivations and ideas and the search
pattern
– do not need details of how to code IDA*
Questions?

More Related Content

PPTX
Lecture 17 Iterative Deepening a star algorithm
PPT
Iterative deepening search
PPT
Ch2 3-informed (heuristic) search
PPT
Depth firstsearchalgorithm
PDF
PPTX
Chapter 22 Finite Field
PPTX
Uninformed Search technique
Lecture 17 Iterative Deepening a star algorithm
Iterative deepening search
Ch2 3-informed (heuristic) search
Depth firstsearchalgorithm
Chapter 22 Finite Field
Uninformed Search technique

What's hot (20)

PPTX
Bfs and Dfs
PPTX
Dfs presentation
PPT
Branch and bound
PDF
Introduction To Autumata Theory
PPTX
Depth-First Search
PPT
Linked list
PPTX
Breadth first search (Bfs)
PPTX
Lecture 14 Heuristic Search-A star algorithm
PPT
Bfs and dfs in data structure
PPTX
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
PPTX
Hill climbing algorithm
PPTX
Basic blocks - compiler design
PPT
Minimum spanning tree
PPTX
A* algorithm
PPTX
Dijkstra s algorithm
PDF
String matching algorithms
PPT
block ciphers
PPTX
Depth first search and breadth first searching
PPTX
Top down parsing
Bfs and Dfs
Dfs presentation
Branch and bound
Introduction To Autumata Theory
Depth-First Search
Linked list
Breadth first search (Bfs)
Lecture 14 Heuristic Search-A star algorithm
Bfs and dfs in data structure
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Hill climbing algorithm
Basic blocks - compiler design
Minimum spanning tree
A* algorithm
Dijkstra s algorithm
String matching algorithms
block ciphers
Depth first search and breadth first searching
Top down parsing
Ad

Similar to Intro to-iterative-deepening (20)

PDF
ITERATIVE DEEPNING DEPTH FIRST PPT SEARCH
PPTX
Lecture09-AI-Artificial intelligence.pptx
PPTX
Lecture09-AI-Artificial intelligence.pptx
PDF
PPTX
Search Algorithms in AI.pptx
PPT
AI-search-metodsandeverythingelsenot.ppt
PPTX
AI-05 Search Algorithms.pptx
PPT
3-uninformed-search.ppt
PPTX
Uninformed Search Strategies techni.pptx
PPT
Iterative deepening search
PPTX
Unit 2 Uninformed Search Strategies.pptx
PDF
Presentation on the artificial intelligenc
PPTX
6CS4_AI_Unit-1.pptx helo to leairn dsa in a eay
PPTX
Uniform Cost Search, Depth Mimited Search.pptx
PPTX
4.Module_2_Chaptjvyfgcgfxfdxhgfxchtfer_3.pptx
PPTX
Intro to ArtificiaI Intelligence Unit No 2 Notes-1.pptx
PPTX
ai unit foe ngineering students and also
PPTX
Unit-2 for AIML including type of searches
PPTX
Lecture # 02-Search Algorithms11111.pptx
PPTX
AI Unit-2 (Chapter-3-4) Solving Problems by Searching.pptx
ITERATIVE DEEPNING DEPTH FIRST PPT SEARCH
Lecture09-AI-Artificial intelligence.pptx
Lecture09-AI-Artificial intelligence.pptx
Search Algorithms in AI.pptx
AI-search-metodsandeverythingelsenot.ppt
AI-05 Search Algorithms.pptx
3-uninformed-search.ppt
Uninformed Search Strategies techni.pptx
Iterative deepening search
Unit 2 Uninformed Search Strategies.pptx
Presentation on the artificial intelligenc
6CS4_AI_Unit-1.pptx helo to leairn dsa in a eay
Uniform Cost Search, Depth Mimited Search.pptx
4.Module_2_Chaptjvyfgcgfxfdxhgfxchtfer_3.pptx
Intro to ArtificiaI Intelligence Unit No 2 Notes-1.pptx
ai unit foe ngineering students and also
Unit-2 for AIML including type of searches
Lecture # 02-Search Algorithms11111.pptx
AI Unit-2 (Chapter-3-4) Solving Problems by Searching.pptx
Ad

Recently uploaded (20)

PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Electronic commerce courselecture one. Pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Big Data Technologies - Introduction.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Approach and Philosophy of On baking technology
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Cloud computing and distributed systems.
PPTX
sap open course for s4hana steps from ECC to s4
A comparative analysis of optical character recognition models for extracting...
Electronic commerce courselecture one. Pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Unlocking AI with Model Context Protocol (MCP)
The Rise and Fall of 3GPP – Time for a Sabbatical?
Building Integrated photovoltaic BIPV_UPV.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Review of recent advances in non-invasive hemoglobin estimation
Mobile App Security Testing_ A Comprehensive Guide.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Big Data Technologies - Introduction.pptx
MYSQL Presentation for SQL database connectivity
Approach and Philosophy of On baking technology
gpt5_lecture_notes_comprehensive_20250812015547.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Cloud computing and distributed systems.
sap open course for s4hana steps from ECC to s4

Intro to-iterative-deepening

  • 1. Iterative Deepening G51IAI – Introduction to AI Andrew Parkes http://www.cs.nott.ac.uk/~ajp/
  • 2. Motivations • BFS & A* – good for optimality – bad on memory, O(bd ) • DFS – solutions not guaranteed optimal: dives and misses good nodes – good for memory O(bd) • “Iterative Deepening” refers to a method that tries to combine the best of the above
  • 3. Depth-Limited Search • Simply put an upper limit on the depth (cost) of paths allowed • Motivation: – e.g. inherent limit on range of a vehicle • tell me all the places I can reach on 10 litres of petrol – prevents search diving into deep solutions – might already have a solution of known depth (cost), but are looking for a shallower (cheaper) one
  • 4. Depth-Limited Search • Impose an upper limit on the depth (cost) of paths allowed – Only add nodes to the queue if their depth does not exceed the bound • DepthLimitedDFS ( k ) : DFS but only consider nodes with depth d ≤ k
  • 5. Trees: Depth-Limited • Depth limit of 2 would mean that children of E are ignored JB C D E F G A H I d=0 d=1 d=2 d=3 d=4
  • 6. Iterative Deepening Search • Follow the BFS pattern of “search all nodes of depth d before depth d+1” • But do the search at depth d using Depth-Limited-DFS • Schematically: • IDS: k=0; while ( not success && k < depth of tree ) { Depth-Limited-DFS ( k ); k++ }
  • 7. Properties of IDS • Memory Usage – Same as DFS O(bd) • Time Usage: – Worse than BFS because nodes at each level will be expanded again at each later level – BUT often is not much worse because almost all the effort is at the last level anyway, because trees are “leaf –heavy” – Typically might be at most a factor two worse
  • 8. Memory Usage of A* • We store the tree in order to – to return the route – avoid repeated states • Takes a lot of memory • But scanning a tree is better with DFS
  • 9. IDA* • Combine A* and iterative deepening • f is the estimate of total path cost for start to goal • IDA*: – Impose a limit on f – Use DFS to search within the f limit – Iteratively relax the limit • Greatly reduces memory usage • Can repeat far too much work, and so be slow
  • 10. Summary • Algorithm IDS: – IDS : BFS plus DFS for tree search • Algorithm IDA*: – the basis of “state of the art” “complete & optimal” algorithms
  • 11. Summary • BFS & A*: good for optimality, but not memory • DFS: good for memory O(bd), but not optimality • “Iterative Deepening” refers to – IDS “Iterative Deeepening Search” • mix of DFS and BFS on trees – a broad approach used for general search, with general aim to combine optimality with low memory usage of DFS • Self-Study: carefully work through “ids.ppt” • Expectations: – know about the motivations and ideas and the search pattern – do not need details of how to code IDA*