SlideShare a Scribd company logo
1 of 43
Uninformed (also called blind)
search algorithms)
This Lecture
Chapter 3.1-3.4
Next Lecture
Chapter 3.5-3.7
(Please read lecture topic material before and after each lecture on that topic)
Outline
 Overview of uninformed search methods
 Search strategy evaluation
 Complete? Time? Space? Optimal?
 Max branching (b), Solution depth (d), Max depth (m)
 Search Strategy Components and Considerations
 Queue? Goal Test when? Tree search vs. Graph search?
 Various blind strategies:
 Breadth-first search
 Uniform-cost search
 Depth-first search
 Iterative deepening search (generally preferred)
 Bidirectional search (preferred if applicable)
3
Uninformed search strategies
 Uninformed (blind):
 You have no clue whether one non-goal state is better
than any other. Your search is blind. You don’t know if
your current exploration is likely to be fruitful.
 Various blind strategies:
 Breadth-first search
 Uniform-cost search
 Depth-first search
 Iterative deepening search (generally preferred)
 Bidirectional search (preferred if applicable)
4
Search strategy evaluation
 A search strategy is defined by the order of node expansion
 Strategies are evaluated along the following dimensions:
 completeness: does it always find a solution if one exists?
 time complexity: number of nodes generated
 space complexity: maximum number of nodes in memory
 optimality: does it always find a least-cost solution?
 Time and space complexity are measured in terms of
 b: maximum branching factor of the search tree
 d: depth of the least-cost solution
 m: maximum depth of the state space (may be ∞)
5
Uninformed search strategies
 Queue for Frontier:
 FIFO? LIFO? Priority?
 Goal-Test:
 When inserted into Frontier? When removed?
 Tree Search or Graph Search:
 Forget Explored nodes? Remember them?
Queue for Frontier
 FIFO (First In, First Out)
 Results in Breadth-First Search
 LIFO (Last In, First Out)
 Results in Depth-First Search
 Priority Queue sorted by path cost so far
 Results in Uniform Cost Search
 Iterative Deepening Search uses Depth-First
 Bidirectional Search can use either Breadth-First or
Uniform Cost Search
6
When to do Goal-Test?
When generated? When popped?
 Do Goal-Test when node is popped from queue
IF you care about finding the optimal path
AND your search space may have both short
expensive and long cheap paths to a goal.
 Guard against a short expensive goal.
 E.g., Uniform Cost search with variable step costs.
 Otherwise, do Goal-Test when is node inserted.
 E.g., Breadth-first Search, Depth-first Search, or Uniform
Cost search when cost is a non-decreasing function of depth
only (which is equivalent to Breadth-first Search).
 REASON ABOUT your search space & problem.
 How could I possibly find a non-optimal goal?
8
Repeated states
 Failure to detect repeated states can turn a linear
problem into an exponential one!
 Test is often implemented as a hash table.
9
Solutions to Repeated States
Graph search
 Never explore a state explored before
 Must keep track of all possible states (a lot of memory)
 E.g., 8-puzzle problem, we have 9! = 362,880 states
 Memory-efficient approximation for DFS/DLS
 Avoid states on path to root: avoid looping paths.
 Graph search optimality/completeness
 Same as Tree search; just a space-time trade-off
S
B
C
S
B C
S
C B S
State Space
Example of a Search Tree
faster but memory inefficient
10
Breadth-first search
 Expand shallowest unexpanded node
 Frontier (or fringe): nodes in queue to be explored
 Frontier is a first-in-first-out (FIFO) queue, i.e.,
new successors go at end of the queue.
 Goal-Test when inserted.
Initial state = A
Is A a goal state?
Put A at end of queue.
frontier = [A]
Future= green dotted circles
Frontier=white nodes
Expanded/active=gray nodes
Forgotten/reclaimed= black nodes
 Expand shallowest unexpanded node
 Frontier is a FIFO queue, i.e., new
successors go at end
11
Breadth-first search
Expand A to B, C.
Is B or C a goal state?
Put B, C at end of queue.
frontier = [B,C]
12
Breadth-first search
 Expand shallowest unexpanded node
 Frontier is a FIFO queue, i.e., new
successors go at end
Expand B to D, E
Is D or E a goal state?
Put D, E at end of queue
frontier=[C,D,E]
13
Breadth-first search
 Expand shallowest unexpanded node
 Frontier is a FIFO queue, i.e., new
successors go at end
Expand C to F, G.
Is F or G a goal state?
Put F, G at end of queue.
frontier = [D,E,F,G]
14
Breadth-first search
 Expand shallowest unexpanded node
 Frontier is a FIFO queue, i.e., new
successors go at end
Expand D to no children.
Forget D.
frontier = [E,F,G]
15
Breadth-first search
 Expand shallowest unexpanded node
 Frontier is a FIFO queue, i.e., new
successors go at end
Expand E to no children.
Forget B,E.
frontier = [F,G]
16
Example
BFS
17
Properties of breadth-first search
 Complete? Yes, it always reaches a goal (if b is finite)
 Time? 1+b+b2+b3+… + bd = O(bd)
(this is the number of nodes we generate)
 Space? O(bd) (keeps every node in memory,
either in fringe or on a path to fringe).
 Optimal? No, for general cost functions.
Yes, if cost is a non-decreasing function only of depth.
 With f(d) ≥ f(d-1), e.g., step-cost = constant:
 All optimal goal nodes occur on the same level
 Optimal goal nodes are always shallower than non-optimal goals
 An optimal goal will be found before any non-optimal goal
 Space is the bigger problem (more than time)
18
Uniform-cost search
Breadth-first is only optimal if path cost is a non-decreasing
function of depth, i.e., f(d) ≥ f(d-1); e.g., constant step cost,
as in the 8-puzzle.
Can we guarantee optimality for variable positive step costs ?
(Why ? To avoid infinite paths w/ step costs 1, ½, ¼, …)
Uniform-cost Search:
Expand node with smallest path cost g(n).
 Frontier is a priority queue, i.e., new successors are merged
into the queue sorted by g(n).
 Can remove successors already on queue w/higher g(n).
 Saves memory, costs time; another space-time trade-off.
 Goal-Test when node is popped off queue.
19
Uniform-cost search
Uniform-cost Search:
Expand node with smallest path cost g(n).
Proof of Completeness:
Given that every step will cost more than 0,
and assuming a finite branching factor, there
is a finite number of expansions required before
the total path cost is equal to the path cost of the
goal state. Hence, we will reach it.
Proof of optimality given completeness:
Assume UCS is not optimal.
Then there must be an (optimal) goal state with
path cost smaller than the found (suboptimal) goal
state (invoking completeness).
However, this is impossible because UCS would
have expanded that node first by definition.
Contradiction.
20
Uniform-cost search
Implementation: Frontier = queue ordered by path cost.
Equivalent to breadth-first if all step costs all equal.
Complete? Yes, if b is finite and step cost ≥ ε > 0.
(otherwise it can get stuck in infinite loops)
Time? # of nodes with path cost ≤ cost of optimal solution.
O(b1+C*/ε) ≈ O(bd+1)
Space? # of nodes with path cost ≤ cost of optimal solution.
O(b1+C*/ε) ≈ O(bd+1)
Optimal? Yes, for any step cost ≥ ε > 0.
21
S B
A D
E
C
F
G
1 20
2
3
4 8
6 1
1
The graph above shows the step-costs for different paths going from the start (S) to
the goal (G).
Use uniform cost search to find the optimal path to the goal.
Exercise for at home
22
Depth-first search
 Expand deepest unexpanded node
 Frontier = Last In First Out (LIFO) queue, i.e., new
successors go at the front of the queue.
 Goal-Test when inserted.
Initial state = A
Is A a goal state?
Put A at front of queue.
frontier = [A]
Future= green dotted circles
Frontier=white nodes
Expanded/active=gray nodes
Forgotten/reclaimed= black nodes
23
Depth-first search
 Expand deepest unexpanded node
 Frontier = LIFO queue, i.e., put successors at front
Expand A to B, C.
Is B or C a goal state?
Put B, C at front of queue.
frontier = [B,C]
Note: Can save a space factor of b by generating successors one at a time.
See backtracking search in your book, p. 87 and Chapter 6.
Future= green dotted circles
Frontier=white nodes
Expanded/active=gray nodes
Forgotten/reclaimed= black nodes
24
Depth-first search
 Expand deepest unexpanded node
 Frontier = LIFO queue, i.e., put successors at front
Expand B to D, E.
Is D or E a goal state?
Put D, E at front of queue.
frontier = [D,E,C]
Future= green dotted circles
Frontier=white nodes
Expanded/active=gray nodes
Forgotten/reclaimed= black nodes
25
Depth-first search
 Expand deepest unexpanded node
 Frontier = LIFO queue, i.e., put successors at front
Expand D to H, I.
Is H or I a goal state?
Put H, I at front of queue.
frontier = [H,I,E,C]
Future= green dotted circles
Frontier=white nodes
Expanded/active=gray nodes
Forgotten/reclaimed= black nodes
26
Depth-first search
 Expand deepest unexpanded node
 Frontier = LIFO queue, i.e., put successors at front
Expand H to no children.
Forget H.
frontier = [I,E,C]
Future= green dotted circles
Frontier=white nodes
Expanded/active=gray nodes
Forgotten/reclaimed= black nodes
27
Depth-first search
 Expand deepest unexpanded node
 Frontier = LIFO queue, i.e., put successors at front
Expand I to no children.
Forget D, I.
frontier = [E,C]
Future= green dotted circles
Frontier=white nodes
Expanded/active=gray nodes
Forgotten/reclaimed= black nodes
28
Depth-first search
 Expand deepest unexpanded node
 Frontier = LIFO queue, i.e., put successors at front
Expand E to J, K.
Is J or K a goal state?
Put J, K at front of queue.
frontier = [J,K,C]
Future= green dotted circles
Frontier=white nodes
Expanded/active=gray nodes
Forgotten/reclaimed= black nodes
29
Depth-first search
 Expand deepest unexpanded node
 Frontier = LIFO queue, i.e., put successors at front
Expand I to no children.
Forget D, I.
frontier = [E,C]
Future= green dotted circles
Frontier=white nodes
Expanded/active=gray nodes
Forgotten/reclaimed= black nodes
30
Depth-first search
 Expand deepest unexpanded node
 Frontier = LIFO queue, i.e., put successors at front
Expand K to no children.
Forget B, E, K.
frontier = [C]
Future= green dotted circles
Frontier=white nodes
Expanded/active=gray nodes
Forgotten/reclaimed= black nodes
31
Depth-first search
 Expand deepest unexpanded node
 Frontier = LIFO queue, i.e., put successors at front
Expand C to F, G.
Is F or G a goal state?
Put F, G at front of queue.
frontier = [F,G]
Future= green dotted circles
Frontier=white nodes
Expanded/active=gray nodes
Forgotten/reclaimed= black nodes
32
Properties of depth-first search
 Complete? No: fails in loops/infinite-depth spaces
 Can modify to avoid loops/repeated states along path
 check if current nodes occurred before on path to root
 Can use graph search (remember all nodes ever seen)
 problem with graph search: space is exponential, not linear
 Still fails in infinite-depth spaces (may miss goal entirely)
 Time? O(bm) with m =maximum depth of space
 Terrible if m is much larger than d
 If solutions are dense, may be much faster than BFS
 Space? O(bm), i.e., linear space!
 Remember a single path + expanded unexplored nodes
 Optimal? No: It may find a non-optimal goal first
A
B C
33
Iterative deepening search
• To avoid the infinite depth problem of DFS,
only search until depth L,
i.e., we don’t expand nodes beyond depth L.
 Depth-Limited Search
• What if solution is deeper than L?  Increase L iteratively.
 Iterative Deepening Search
• This inherits the memory advantage of Depth-first search
• Better in terms of space complexity than Breadth-first search.
34
Iterative deepening search L=0
35
Iterative deepening search L=1
36
Iterative deepening search L=2
37
Iterative Deepening Search L=3
38
Iterative deepening search
 Number of nodes generated in a depth-limited search to
depth d with branching factor b:
NDLS = b0 + b1 + b2 + … + bd-2 + bd-1 + bd
 Number of nodes generated in an iterative deepening
search to depth d with branching factor b:
NIDS = (d+1)b0 + d b1 + (d-1)b2 + … + 3bd-2 +2bd-1 + 1bd
= O(bd)
 For b = 10, d = 5,
 NDLS = 1 + 10 + 100 + 1,000 + 10,000 + 100,000 = 111,111
 NIDS = 6 + 50 + 400 + 3,000 + 20,000 + 100,000 = 123,450
)
( d
b
O
39
Properties of iterative deepening search
 Complete? Yes
 Time? O(bd)
 Space? O(bd)
 Optimal? No, for general cost functions.
Yes, if cost is a non-decreasing function only of depth.
40
Bidirectional Search
 Idea
 simultaneously search forward from S and backwards
from G
 stop when both “meet in the middle”
 need to keep track of the intersection of 2 open sets of
nodes
 What does searching backwards from G mean
 need a way to specify the predecessors of G
 this can be difficult,
 e.g., predecessors of checkmate in chess?
 which to take if there are multiple goal states?
 where to start if there is only a goal test, no explicit list?
41
Bi-Directional Search
Complexity: time and space complexity are: /2
( )
d
O b
42
Summary of algorithms
Generally the preferred
uninformed search strategy
Criterion Breadth-
First
Uniform-
Cost
Depth-
First
Depth-
Limited
Iterative
Deepening
DLS
Bidirectional
(if
applicable)
Complete? Yes[a] Yes[a,b] No No Yes[a] Yes[a,d]
Time O(bd) O(b1+C*/ε) O(bm) O(bl) O(bd) O(bd/2)
Space O(bd) O(b1+C*/ε) O(bm) O(bl) O(bd) O(bd/2)
Optimal? Yes[c] Yes No No Yes[c] Yes[c,d]
There are a number of footnotes, caveats, and assumptions.
See Fig. 3.21, p. 91.
[a] complete if b is finite
[b] complete if step costs   > 0
[c] optimal if step costs are all identical
(also if path cost non-decreasing function of depth only)
[d] if both directions use breadth-first search
(also if both directions use uniform-cost search with step costs   > 0)
Note that d ≤ 1+C*/ε
43
Summary
 Problem formulation usually requires abstracting away real-
world details to define a state space that can feasibly be
explored
 Variety of uninformed search strategies
 Iterative deepening search uses only linear space and not
much more time than other uninformed algorithms
http://www.cs.rmit.edu.au/AI-Search/Product/
http://aima.cs.berkeley.edu/demos.html (for more demos)

More Related Content

Similar to 2012wq171-03-UninformedSeknlk ;lm,l;mk;arch.ppt

ARTIFICIAL INTELLIGENCE UNIT 2(2)
ARTIFICIAL INTELLIGENCE UNIT 2(2)ARTIFICIAL INTELLIGENCE UNIT 2(2)
ARTIFICIAL INTELLIGENCE UNIT 2(2)SURBHI SAROHA
 
problem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , problomsproblem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , problomsSlimAmiri
 
AI unit-2 lecture notes.docx
AI unit-2 lecture notes.docxAI unit-2 lecture notes.docx
AI unit-2 lecture notes.docxCS50Bootcamp
 
Dfs presentation
Dfs presentationDfs presentation
Dfs presentationAlizay Khan
 
CptS 440 / 540 Artificial Intelligence
CptS 440 / 540 Artificial IntelligenceCptS 440 / 540 Artificial Intelligence
CptS 440 / 540 Artificial Intelligencebutest
 
Artificial intelligence(05)
Artificial intelligence(05)Artificial intelligence(05)
Artificial intelligence(05)Nazir Ahmed
 
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchJarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchPalGov
 
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptxPPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptxRaviKiranVarma4
 
Lecture 08 uninformed search techniques
Lecture 08 uninformed search techniquesLecture 08 uninformed search techniques
Lecture 08 uninformed search techniquesHema Kashyap
 
SP14 CS188 Lecture 2 -- Uninformed Search.pptx
SP14 CS188 Lecture 2 -- Uninformed Search.pptxSP14 CS188 Lecture 2 -- Uninformed Search.pptx
SP14 CS188 Lecture 2 -- Uninformed Search.pptxAnimeGuru1
 
Informed-search TECHNIQUES IN ai ml data science
Informed-search TECHNIQUES IN ai ml data scienceInformed-search TECHNIQUES IN ai ml data science
Informed-search TECHNIQUES IN ai ml data sciencedevvpillpersonal
 
Artificial Intelligence_Searching.pptx
Artificial Intelligence_Searching.pptxArtificial Intelligence_Searching.pptx
Artificial Intelligence_Searching.pptxRatnakar Mikkili
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AIKirti Verma
 
Lecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesLecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesHema Kashyap
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)Bablu Shofi
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AIAmey Kerkar
 
Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search StrategiesAmey Kerkar
 

Similar to 2012wq171-03-UninformedSeknlk ;lm,l;mk;arch.ppt (20)

ARTIFICIAL INTELLIGENCE UNIT 2(2)
ARTIFICIAL INTELLIGENCE UNIT 2(2)ARTIFICIAL INTELLIGENCE UNIT 2(2)
ARTIFICIAL INTELLIGENCE UNIT 2(2)
 
problem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , problomsproblem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , probloms
 
Week 7.pdf
Week 7.pdfWeek 7.pdf
Week 7.pdf
 
AI unit-2 lecture notes.docx
AI unit-2 lecture notes.docxAI unit-2 lecture notes.docx
AI unit-2 lecture notes.docx
 
Dfs presentation
Dfs presentationDfs presentation
Dfs presentation
 
CptS 440 / 540 Artificial Intelligence
CptS 440 / 540 Artificial IntelligenceCptS 440 / 540 Artificial Intelligence
CptS 440 / 540 Artificial Intelligence
 
Artificial intelligence(05)
Artificial intelligence(05)Artificial intelligence(05)
Artificial intelligence(05)
 
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchJarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
 
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptxPPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
 
Final slide4 (bsc csit) chapter 4
Final slide4 (bsc csit) chapter 4Final slide4 (bsc csit) chapter 4
Final slide4 (bsc csit) chapter 4
 
Lecture 08 uninformed search techniques
Lecture 08 uninformed search techniquesLecture 08 uninformed search techniques
Lecture 08 uninformed search techniques
 
SP14 CS188 Lecture 2 -- Uninformed Search.pptx
SP14 CS188 Lecture 2 -- Uninformed Search.pptxSP14 CS188 Lecture 2 -- Uninformed Search.pptx
SP14 CS188 Lecture 2 -- Uninformed Search.pptx
 
Informed-search TECHNIQUES IN ai ml data science
Informed-search TECHNIQUES IN ai ml data scienceInformed-search TECHNIQUES IN ai ml data science
Informed-search TECHNIQUES IN ai ml data science
 
Artificial Intelligence_Searching.pptx
Artificial Intelligence_Searching.pptxArtificial Intelligence_Searching.pptx
Artificial Intelligence_Searching.pptx
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AI
 
Lecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesLecture 12 Heuristic Searches
Lecture 12 Heuristic Searches
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)
 
Unit ii-ppt
Unit ii-pptUnit ii-ppt
Unit ii-ppt
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AI
 
Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search Strategies
 

Recently uploaded

Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 

Recently uploaded (20)

Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 

2012wq171-03-UninformedSeknlk ;lm,l;mk;arch.ppt

  • 1. Uninformed (also called blind) search algorithms) This Lecture Chapter 3.1-3.4 Next Lecture Chapter 3.5-3.7 (Please read lecture topic material before and after each lecture on that topic)
  • 2. Outline  Overview of uninformed search methods  Search strategy evaluation  Complete? Time? Space? Optimal?  Max branching (b), Solution depth (d), Max depth (m)  Search Strategy Components and Considerations  Queue? Goal Test when? Tree search vs. Graph search?  Various blind strategies:  Breadth-first search  Uniform-cost search  Depth-first search  Iterative deepening search (generally preferred)  Bidirectional search (preferred if applicable)
  • 3. 3 Uninformed search strategies  Uninformed (blind):  You have no clue whether one non-goal state is better than any other. Your search is blind. You don’t know if your current exploration is likely to be fruitful.  Various blind strategies:  Breadth-first search  Uniform-cost search  Depth-first search  Iterative deepening search (generally preferred)  Bidirectional search (preferred if applicable)
  • 4. 4 Search strategy evaluation  A search strategy is defined by the order of node expansion  Strategies are evaluated along the following dimensions:  completeness: does it always find a solution if one exists?  time complexity: number of nodes generated  space complexity: maximum number of nodes in memory  optimality: does it always find a least-cost solution?  Time and space complexity are measured in terms of  b: maximum branching factor of the search tree  d: depth of the least-cost solution  m: maximum depth of the state space (may be ∞)
  • 5. 5 Uninformed search strategies  Queue for Frontier:  FIFO? LIFO? Priority?  Goal-Test:  When inserted into Frontier? When removed?  Tree Search or Graph Search:  Forget Explored nodes? Remember them?
  • 6. Queue for Frontier  FIFO (First In, First Out)  Results in Breadth-First Search  LIFO (Last In, First Out)  Results in Depth-First Search  Priority Queue sorted by path cost so far  Results in Uniform Cost Search  Iterative Deepening Search uses Depth-First  Bidirectional Search can use either Breadth-First or Uniform Cost Search 6
  • 7. When to do Goal-Test? When generated? When popped?  Do Goal-Test when node is popped from queue IF you care about finding the optimal path AND your search space may have both short expensive and long cheap paths to a goal.  Guard against a short expensive goal.  E.g., Uniform Cost search with variable step costs.  Otherwise, do Goal-Test when is node inserted.  E.g., Breadth-first Search, Depth-first Search, or Uniform Cost search when cost is a non-decreasing function of depth only (which is equivalent to Breadth-first Search).  REASON ABOUT your search space & problem.  How could I possibly find a non-optimal goal?
  • 8. 8 Repeated states  Failure to detect repeated states can turn a linear problem into an exponential one!  Test is often implemented as a hash table.
  • 9. 9 Solutions to Repeated States Graph search  Never explore a state explored before  Must keep track of all possible states (a lot of memory)  E.g., 8-puzzle problem, we have 9! = 362,880 states  Memory-efficient approximation for DFS/DLS  Avoid states on path to root: avoid looping paths.  Graph search optimality/completeness  Same as Tree search; just a space-time trade-off S B C S B C S C B S State Space Example of a Search Tree faster but memory inefficient
  • 10. 10 Breadth-first search  Expand shallowest unexpanded node  Frontier (or fringe): nodes in queue to be explored  Frontier is a first-in-first-out (FIFO) queue, i.e., new successors go at end of the queue.  Goal-Test when inserted. Initial state = A Is A a goal state? Put A at end of queue. frontier = [A] Future= green dotted circles Frontier=white nodes Expanded/active=gray nodes Forgotten/reclaimed= black nodes
  • 11.  Expand shallowest unexpanded node  Frontier is a FIFO queue, i.e., new successors go at end 11 Breadth-first search Expand A to B, C. Is B or C a goal state? Put B, C at end of queue. frontier = [B,C]
  • 12. 12 Breadth-first search  Expand shallowest unexpanded node  Frontier is a FIFO queue, i.e., new successors go at end Expand B to D, E Is D or E a goal state? Put D, E at end of queue frontier=[C,D,E]
  • 13. 13 Breadth-first search  Expand shallowest unexpanded node  Frontier is a FIFO queue, i.e., new successors go at end Expand C to F, G. Is F or G a goal state? Put F, G at end of queue. frontier = [D,E,F,G]
  • 14. 14 Breadth-first search  Expand shallowest unexpanded node  Frontier is a FIFO queue, i.e., new successors go at end Expand D to no children. Forget D. frontier = [E,F,G]
  • 15. 15 Breadth-first search  Expand shallowest unexpanded node  Frontier is a FIFO queue, i.e., new successors go at end Expand E to no children. Forget B,E. frontier = [F,G]
  • 17. 17 Properties of breadth-first search  Complete? Yes, it always reaches a goal (if b is finite)  Time? 1+b+b2+b3+… + bd = O(bd) (this is the number of nodes we generate)  Space? O(bd) (keeps every node in memory, either in fringe or on a path to fringe).  Optimal? No, for general cost functions. Yes, if cost is a non-decreasing function only of depth.  With f(d) ≥ f(d-1), e.g., step-cost = constant:  All optimal goal nodes occur on the same level  Optimal goal nodes are always shallower than non-optimal goals  An optimal goal will be found before any non-optimal goal  Space is the bigger problem (more than time)
  • 18. 18 Uniform-cost search Breadth-first is only optimal if path cost is a non-decreasing function of depth, i.e., f(d) ≥ f(d-1); e.g., constant step cost, as in the 8-puzzle. Can we guarantee optimality for variable positive step costs ? (Why ? To avoid infinite paths w/ step costs 1, ½, ¼, …) Uniform-cost Search: Expand node with smallest path cost g(n).  Frontier is a priority queue, i.e., new successors are merged into the queue sorted by g(n).  Can remove successors already on queue w/higher g(n).  Saves memory, costs time; another space-time trade-off.  Goal-Test when node is popped off queue.
  • 19. 19 Uniform-cost search Uniform-cost Search: Expand node with smallest path cost g(n). Proof of Completeness: Given that every step will cost more than 0, and assuming a finite branching factor, there is a finite number of expansions required before the total path cost is equal to the path cost of the goal state. Hence, we will reach it. Proof of optimality given completeness: Assume UCS is not optimal. Then there must be an (optimal) goal state with path cost smaller than the found (suboptimal) goal state (invoking completeness). However, this is impossible because UCS would have expanded that node first by definition. Contradiction.
  • 20. 20 Uniform-cost search Implementation: Frontier = queue ordered by path cost. Equivalent to breadth-first if all step costs all equal. Complete? Yes, if b is finite and step cost ≥ ε > 0. (otherwise it can get stuck in infinite loops) Time? # of nodes with path cost ≤ cost of optimal solution. O(b1+C*/ε) ≈ O(bd+1) Space? # of nodes with path cost ≤ cost of optimal solution. O(b1+C*/ε) ≈ O(bd+1) Optimal? Yes, for any step cost ≥ ε > 0.
  • 21. 21 S B A D E C F G 1 20 2 3 4 8 6 1 1 The graph above shows the step-costs for different paths going from the start (S) to the goal (G). Use uniform cost search to find the optimal path to the goal. Exercise for at home
  • 22. 22 Depth-first search  Expand deepest unexpanded node  Frontier = Last In First Out (LIFO) queue, i.e., new successors go at the front of the queue.  Goal-Test when inserted. Initial state = A Is A a goal state? Put A at front of queue. frontier = [A] Future= green dotted circles Frontier=white nodes Expanded/active=gray nodes Forgotten/reclaimed= black nodes
  • 23. 23 Depth-first search  Expand deepest unexpanded node  Frontier = LIFO queue, i.e., put successors at front Expand A to B, C. Is B or C a goal state? Put B, C at front of queue. frontier = [B,C] Note: Can save a space factor of b by generating successors one at a time. See backtracking search in your book, p. 87 and Chapter 6. Future= green dotted circles Frontier=white nodes Expanded/active=gray nodes Forgotten/reclaimed= black nodes
  • 24. 24 Depth-first search  Expand deepest unexpanded node  Frontier = LIFO queue, i.e., put successors at front Expand B to D, E. Is D or E a goal state? Put D, E at front of queue. frontier = [D,E,C] Future= green dotted circles Frontier=white nodes Expanded/active=gray nodes Forgotten/reclaimed= black nodes
  • 25. 25 Depth-first search  Expand deepest unexpanded node  Frontier = LIFO queue, i.e., put successors at front Expand D to H, I. Is H or I a goal state? Put H, I at front of queue. frontier = [H,I,E,C] Future= green dotted circles Frontier=white nodes Expanded/active=gray nodes Forgotten/reclaimed= black nodes
  • 26. 26 Depth-first search  Expand deepest unexpanded node  Frontier = LIFO queue, i.e., put successors at front Expand H to no children. Forget H. frontier = [I,E,C] Future= green dotted circles Frontier=white nodes Expanded/active=gray nodes Forgotten/reclaimed= black nodes
  • 27. 27 Depth-first search  Expand deepest unexpanded node  Frontier = LIFO queue, i.e., put successors at front Expand I to no children. Forget D, I. frontier = [E,C] Future= green dotted circles Frontier=white nodes Expanded/active=gray nodes Forgotten/reclaimed= black nodes
  • 28. 28 Depth-first search  Expand deepest unexpanded node  Frontier = LIFO queue, i.e., put successors at front Expand E to J, K. Is J or K a goal state? Put J, K at front of queue. frontier = [J,K,C] Future= green dotted circles Frontier=white nodes Expanded/active=gray nodes Forgotten/reclaimed= black nodes
  • 29. 29 Depth-first search  Expand deepest unexpanded node  Frontier = LIFO queue, i.e., put successors at front Expand I to no children. Forget D, I. frontier = [E,C] Future= green dotted circles Frontier=white nodes Expanded/active=gray nodes Forgotten/reclaimed= black nodes
  • 30. 30 Depth-first search  Expand deepest unexpanded node  Frontier = LIFO queue, i.e., put successors at front Expand K to no children. Forget B, E, K. frontier = [C] Future= green dotted circles Frontier=white nodes Expanded/active=gray nodes Forgotten/reclaimed= black nodes
  • 31. 31 Depth-first search  Expand deepest unexpanded node  Frontier = LIFO queue, i.e., put successors at front Expand C to F, G. Is F or G a goal state? Put F, G at front of queue. frontier = [F,G] Future= green dotted circles Frontier=white nodes Expanded/active=gray nodes Forgotten/reclaimed= black nodes
  • 32. 32 Properties of depth-first search  Complete? No: fails in loops/infinite-depth spaces  Can modify to avoid loops/repeated states along path  check if current nodes occurred before on path to root  Can use graph search (remember all nodes ever seen)  problem with graph search: space is exponential, not linear  Still fails in infinite-depth spaces (may miss goal entirely)  Time? O(bm) with m =maximum depth of space  Terrible if m is much larger than d  If solutions are dense, may be much faster than BFS  Space? O(bm), i.e., linear space!  Remember a single path + expanded unexplored nodes  Optimal? No: It may find a non-optimal goal first A B C
  • 33. 33 Iterative deepening search • To avoid the infinite depth problem of DFS, only search until depth L, i.e., we don’t expand nodes beyond depth L.  Depth-Limited Search • What if solution is deeper than L?  Increase L iteratively.  Iterative Deepening Search • This inherits the memory advantage of Depth-first search • Better in terms of space complexity than Breadth-first search.
  • 38. 38 Iterative deepening search  Number of nodes generated in a depth-limited search to depth d with branching factor b: NDLS = b0 + b1 + b2 + … + bd-2 + bd-1 + bd  Number of nodes generated in an iterative deepening search to depth d with branching factor b: NIDS = (d+1)b0 + d b1 + (d-1)b2 + … + 3bd-2 +2bd-1 + 1bd = O(bd)  For b = 10, d = 5,  NDLS = 1 + 10 + 100 + 1,000 + 10,000 + 100,000 = 111,111  NIDS = 6 + 50 + 400 + 3,000 + 20,000 + 100,000 = 123,450 ) ( d b O
  • 39. 39 Properties of iterative deepening search  Complete? Yes  Time? O(bd)  Space? O(bd)  Optimal? No, for general cost functions. Yes, if cost is a non-decreasing function only of depth.
  • 40. 40 Bidirectional Search  Idea  simultaneously search forward from S and backwards from G  stop when both “meet in the middle”  need to keep track of the intersection of 2 open sets of nodes  What does searching backwards from G mean  need a way to specify the predecessors of G  this can be difficult,  e.g., predecessors of checkmate in chess?  which to take if there are multiple goal states?  where to start if there is only a goal test, no explicit list?
  • 41. 41 Bi-Directional Search Complexity: time and space complexity are: /2 ( ) d O b
  • 42. 42 Summary of algorithms Generally the preferred uninformed search strategy Criterion Breadth- First Uniform- Cost Depth- First Depth- Limited Iterative Deepening DLS Bidirectional (if applicable) Complete? Yes[a] Yes[a,b] No No Yes[a] Yes[a,d] Time O(bd) O(b1+C*/ε) O(bm) O(bl) O(bd) O(bd/2) Space O(bd) O(b1+C*/ε) O(bm) O(bl) O(bd) O(bd/2) Optimal? Yes[c] Yes No No Yes[c] Yes[c,d] There are a number of footnotes, caveats, and assumptions. See Fig. 3.21, p. 91. [a] complete if b is finite [b] complete if step costs   > 0 [c] optimal if step costs are all identical (also if path cost non-decreasing function of depth only) [d] if both directions use breadth-first search (also if both directions use uniform-cost search with step costs   > 0) Note that d ≤ 1+C*/ε
  • 43. 43 Summary  Problem formulation usually requires abstracting away real- world details to define a state space that can feasibly be explored  Variety of uninformed search strategies  Iterative deepening search uses only linear space and not much more time than other uninformed algorithms http://www.cs.rmit.edu.au/AI-Search/Product/ http://aima.cs.berkeley.edu/demos.html (for more demos)