SlideShare a Scribd company logo
1 of 12
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

What's hot

AI_Session 6 Iterative deepening Depth-first and bidirectional search.pptx
AI_Session 6 Iterative deepening Depth-first and bidirectional search.pptxAI_Session 6 Iterative deepening Depth-first and bidirectional search.pptx
AI_Session 6 Iterative deepening Depth-first and bidirectional search.pptxAsst.prof M.Gokilavani
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms Syed Ahmed
 
Matching techniques
Matching techniquesMatching techniques
Matching techniquesNagpalkirti
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}FellowBuddy.com
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesDr. C.V. Suresh Babu
 
Unification and Lifting
Unification and LiftingUnification and Lifting
Unification and LiftingMegha Sharma
 
State Space Representation and Search
State Space Representation and SearchState Space Representation and Search
State Space Representation and SearchHitesh Mohapatra
 
Search problems in Artificial Intelligence
Search problems in Artificial IntelligenceSearch problems in Artificial Intelligence
Search problems in Artificial Intelligenceananth
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMvikas dhakane
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logicAmey Kerkar
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rulesHarini Balamurugan
 

What's hot (20)

AI_Session 6 Iterative deepening Depth-first and bidirectional search.pptx
AI_Session 6 Iterative deepening Depth-first and bidirectional search.pptxAI_Session 6 Iterative deepening Depth-first and bidirectional search.pptx
AI_Session 6 Iterative deepening Depth-first and bidirectional search.pptx
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms
 
Matching techniques
Matching techniquesMatching techniques
Matching techniques
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
 
Unit1: Introduction to AI
Unit1: Introduction to AIUnit1: Introduction to AI
Unit1: Introduction to AI
 
Unification and Lifting
Unification and LiftingUnification and Lifting
Unification and Lifting
 
State Space Representation and Search
State Space Representation and SearchState Space Representation and Search
State Space Representation and Search
 
AI: Logic in AI
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
 
Search problems in Artificial Intelligence
Search problems in Artificial IntelligenceSearch problems in Artificial Intelligence
Search problems in Artificial Intelligence
 
Intelligent Agents
Intelligent Agents Intelligent Agents
Intelligent Agents
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rules
 
Iterative deepening search
Iterative deepening searchIterative deepening search
Iterative deepening search
 
Knowledge based agents
Knowledge based agentsKnowledge based agents
Knowledge based agents
 
Apriori Algorithm
Apriori AlgorithmApriori Algorithm
Apriori Algorithm
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
 
Informed search
Informed searchInformed search
Informed search
 

Similar to Iterative Deepening Search (IDS) combines DFS and BFS for optimal tree search

Similar to Iterative Deepening Search (IDS) combines DFS and BFS for optimal tree search (8)

ARTIFICIAL INTELLIGENCE UNIT 2(2)
ARTIFICIAL INTELLIGENCE UNIT 2(2)ARTIFICIAL INTELLIGENCE UNIT 2(2)
ARTIFICIAL INTELLIGENCE UNIT 2(2)
 
NEW-II.pptx
NEW-II.pptxNEW-II.pptx
NEW-II.pptx
 
NEW-II.pptx
NEW-II.pptxNEW-II.pptx
NEW-II.pptx
 
uninformed search part 1.pptx
uninformed search part 1.pptxuninformed search part 1.pptx
uninformed search part 1.pptx
 
Search strategies BFS, DFS
Search strategies BFS, DFSSearch strategies BFS, DFS
Search strategies BFS, DFS
 
Ai unit-4
Ai unit-4Ai unit-4
Ai unit-4
 
c4.pptx
c4.pptxc4.pptx
c4.pptx
 
RediSearch (SV Meetup)
RediSearch (SV Meetup)RediSearch (SV Meetup)
RediSearch (SV Meetup)
 

Recently uploaded

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Iterative Deepening Search (IDS) combines DFS and BFS for optimal tree search

  • 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*