0% found this document useful (0 votes)
165 views0 pages

Faadoo: India'S No.1 Website For

FaaDoOEngineers.com is a website providing resources for engineering students in India, including preparation materials for entrance exams, information on coaching centers, engineering projects, reports, presentations, ebooks, and resumes/CVs. The website then provides several documents discussing different search algorithms used in artificial intelligence like depth-first search, breadth-first search, depth-bounded search, iterative deepening search, best-first search, and their application to problems like the 8-puzzle problem.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
165 views0 pages

Faadoo: India'S No.1 Website For

FaaDoOEngineers.com is a website providing resources for engineering students in India, including preparation materials for entrance exams, information on coaching centers, engineering projects, reports, presentations, ebooks, and resumes/CVs. The website then provides several documents discussing different search algorithms used in artificial intelligence like depth-first search, breadth-first search, depth-bounded search, iterative deepening search, best-first search, and their application to problems like the 8-puzzle problem.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 0

Engaging Peers, Inspiring Careers!

FaaDoOEngineers.com
Indias No.1 website for:
IIT-JEE/AIEEE preparation resources
Coaching centre packages
Engineering Major and Minor projects
Seminar reports
Paper presentations
EBOOKS
Resumes/CVs, and so much more
-By FaaDoOEngineers.com
Artificial Intelligence
Search: 2
Artificial Intelligence
Part I : The Eights Puzzle
Part II: Search Algorithms via lists
Part II: Best First Search
Search 2
The Eights Puzzle
Sliding blocks puzzle, more usually 15 puzzle
shows you the state of AI in the sixties
how many moves between these states?
1 2 3
8 4
7 6 5
2 1 6
4 8
7 5 3
-By FaaDoOEngineers.com
Search Reminder
Search states, Search trees
Dont store whole search trees, just the frontier
B
(a B)
Impossible
b
(a b)
Impossible
a
(a)
Choose B
B
(ABC)
Impossible
b
(AbC)
Solution
C
(AC)
Choose B
c
Ac
impossible
A
(A)
Choose C
ABC, ABc, AbC, Abc, aBC, abC, abc
state = ()
Choose A
-By FaaDoOEngineers.com
Frontiers as lists
One way to implement search algorithms is via lists
Lists fundamental in AI programming
main data structure in Lisp, Prolog
makes list processing really easy (no pointers)
<end of advert for AI languages>
Lists can easily store frontier of search
Each element in list is search state
Different algorithms manipulate list differently
-By FaaDoOEngineers.com
A general search algorithm
1. Form a one element list with null state
2. Loop Until (either list empty or we have a solution)
Remove the first state X from the list
Choose the next decision to make
e.g. which letter to set in SAT, which city to choose successor in TSP
Create a new state for each possible choice of decision
e.g. upper/lower case, Walla Walla/Oberlin/Ithaca
MERGE the set of new states into the list
different algorithms will have different MERGE methods
3. If (solution in list) succeed
else list must be empty, so fail
-By FaaDoOEngineers.com
Depth First Search
The most important AI search algorithm?
MERGE = push
treat list as a stack
new search states to explore at front of list, get treated first
What about when many new states created?
We use a heuristic to decide what order to push new
states
all new states in front of all old states in the list
What about when no new states created?
We must be at a leaf node in the search tree
we have to backtrack to higher nodes
-By FaaDoOEngineers.com
Breadth First Search
MERGE = add to end
treat list as a queue
new search states to explore at end of list,
What about when many new states created?
We use a heuristic to decide what order to add new states
Breadth first considers all states at a given depth in
the search tree before going on to the next depth
compare with depth-first,
depth-first considers all children of current node before
any other nodes in the search tree
list can be exponential size -- all nodes at given depth
-By FaaDoOEngineers.com
Depth-First-Depth-Bounded
Search
As depth-first search
Disallow nodes beyond a certain depth d in tree
to implement, add depth in tree to search state
Compare DFDB with Depth-first
DFDB: always finds solution at depth <= d
DF may find very deep solution before shallow ones
DFDB: never goes down infinite branch
relevant if search tree contains infinite branches
e.g. Eights puzzle
DFDB: we have a resource limit (b^d if b branching rate)
How do we choose d?
-By FaaDoOEngineers.com
Iterative Deepening Search
No longer a simple instance of general search
d = min-d
Loop Until (solution found)
apply DFDB(d)
d := d + increment
Why?
Guarantees to find a solution if one exists (cf DFDB)
Finds shallow solutions first (cf DF)
Always has small frontier (cf Breadth First)
Surprising asymptotic guarantees
search time typically no more than d/(d-1) as bad as DF
-By FaaDoOEngineers.com
Why is Iterative deepening ok?
Suppose increment = 1, solution at depth d
how much more work do we expect to do in I.D. vs DF ?
I.d. repeats work from depths 1 to d

d
i=1
b
i
= b
d+1
/ (b - 1)
Ratio to b
d
= b
d+1
/ b
d
(b - 1) = b/(b-1)
So we only do b/(b-1) times as much work as we need to
e.g. even if b=2, only do twice as much work
Very often worth the overhead for the advantages
-By FaaDoOEngineers.com
Comparing Search
Algorithms
Depth
First
Breadth
First
Depth
Bounded
Iterative
Deepening
Always finds
solution if one
exists?
Yes if no
inf. branch
Yes No Yes
First solution
shallowest?
No Yes No Yes if min-d,
increment
correct
Size of list at
depth d?
bd b^d bd bd
Revisits nodes
redundantly?
No No No Yes
-By FaaDoOEngineers.com
Best First Search
All the algorithms up to now have been hard wired
I.e. they search the tree in a fixed order
use heuristics only to choose among a small number of
choices
e.g. which letter to set in SAT / whether to be A or a
Would it be a good idea to explore the frontier
heuristically?
I.e. use the most promising part of the frontier?
This is Best First Search
-By FaaDoOEngineers.com
Best First Search
Best First Search is still an instance of general
algorithm
Need heuristic score for each search state
MERGE: merge new states in sorted order of score
I.e. list always contains most promising state first
can be efficiently done if use (e.g.) heap for list
no, heaps not done for free in Lisp, Prolog.
Search can be like depth-first, breadth-first, or in-
between
list can become exponentially long
-By FaaDoOEngineers.com
Search in the Eights Puzzle
The Eights puzzle is different to (e.g.) SAT
can have infinitely long branches if we dont check for
loops
bad news for depth-first,
still ok for iterative deepening
Usually no need to choose variable (e.g. letter in SAT)
there is only one piece to move (the blank)
we have a choice of places to move it to
we might want to minimise length of path
in SAT just want satisfying assignment
-By FaaDoOEngineers.com
Search in the Eights Puzzle
Are the hard wired methods effective?
Breadth-first very poor except for very easy problems
Depth-first useful without loop checking
not much good with it, either
Depth-bounded -- how do we choose depth bound?
Iterative deepening ok
and we can use increment = 2 (why?)
still need good heuristics for move choice
Will Best-First be ok?
-By FaaDoOEngineers.com
Search in the Eights Puzzle
How can we use Best-First for the Eights puzzle?
We need good heuristic for rating states
Ideally want to find guaranteed shortest solution
Therefore need to take account of moves so far
And some way of guaranteeing no better solution
elsewhere
-By FaaDoOEngineers.com
Next week in Search for AI
Heuristics for the Eights Puzzle
the A* algorithm
-By FaaDoOEngineers.com
Engaging Peers, Inspiring Careers!
FaaDoOEngineers.com
Indias No.1 website for:
IIT-JEE/AIEEE preparation resources
Coaching centre packages
Engineering Major and Minor projects
Seminar reports
Paper presentations
EBOOKS
Resumes/CVs, and so much more
-By FaaDoOEngineers.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy