01 - State Space Search
01 - State Space Search
01 - State Space Search
• Ever since the first computers were built, scientist have been
trying to make them intelligent
1
What is AI?
2
What is AI?
3
What is AI?
4
What is AI?
6
State Space Search
7
Problem Spaces
• We can solve the problem in our heads and encode the rules
or
• We can define the possible states for the problem and make
a list of legal or valid operations
8
Problem Spaces
9
Problem Spaces
10
Problem Spaces
• The problem can now be seen as that of moving around in
the state space from one legal state to another
11
Problem Spaces
For defining any problem as a state space search we must:
12
Problem Spaces
13
Blind Search
• Uninformed search
We are not informed about the quality of our choices
14
Blind Search
15
Blind Search
16
Blind Search
17
Blind Search
18
Depth First Search
Method
• When a state is examined, all of its children and their
descendants are examined before any of its siblings
• The siblings are considered only when no further descendants
of a state can be found
19
Depth First Search
20
Depth First Search
21
Depth First Search
Advantages
• It quickly goes deep into search space, hence it is efficient for
search spaces with many branches
• Requires less memory since only the nodes on the current
path are stored
Disadvantages
• Shortest path is not guaranteed. A state may be reached
by a longer path when it is encountered the first time. It
may get lost deep in a graph, missing shorter paths to a
goal. If the shortest path is required each state may be
stored as a triplet (state, parent, length-of-path)
Method
• It explores the space in a level by level fashion. Only when
no there are no more states to be explored at a given
level does the algorithm move on to the next level
23
Breadth First Search
24
Breadth First Search
Advantages
• It is guaranteed to find the shortest path from the start
state to the goal state
• Because there is no chance that duplicate states may be
found along a better path, the algorithm simply
discards any duplicate states
Disadvantages
• If the branching factor is high and the goal is at deep levels,
this algorithm is not useful.
The memory required is high since at every level, all
of the tree that has been so far generated must be
stored
25
Depth first versus Breadth first
26
Non-deterministic Search
27
Depth First Search with Iterative Deepening
28