Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Artificial Intelligence Uninformed Search Techniques (Depth Limited Search, Iterative Deepening Depth First Search, 8-Puzzle Problem)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

ARTIFICIAL INTELLIGENCE

LECTURE 4

UNINFORMED SEARCH TECHNIQUES

(Depth Limited Search, Iterative Deepening Depth First Search,

8- Puzzle Problem)

Depth Limited Search (DLS)


Depth limited search is the search algorithm for uninformed search. The unbounded tree problem
happens to appear in the depth-first search algorithm, and it can be fixed by imposing a boundary
or a limit to the depth of the search domain. Thus, Depth limited search can be called an
extended and refined version of the DFS algorithm. In a nutshell, we can say that to avoid the
infinite loop status while execution of the codes, depth limited search algorithm is being
executed into a finite set of depth called depth limit.
Completeness:
The limited path introduces another problem that we may not find out goal if our goal is not
found within the depth we have set for the algorithm. This is also called as cutoff failure. So,
DLS is not complete.
Time Complexity: O(bd)
Advantages:
- It is memory Efficient.
Disadvantages:
- It can terminate without finding solution.
- It is not Optimal
Example:
Iterative Deepening Depth First Search (IDS)
Iterative deepening depth-first search (IDDFS) is an algorithm that is an important part of an
Uninformed search strategy just like BFS and DFS. We can define IDDFS as an algorithm of an
amalgam of BFS and DFS searching techniques. In IDDFS, We have found certain limitations in
BFS and DFS so we have done hybridization of both the procedures for eliminating the demerits
lying in them individually. We do a limited depth-first search up to a fixed “limited depth”. Then
we keep on incrementing the depth limit by iterating the procedure unless we have found the
goal node or have traversed the whole tree whichever is earlier.
IDS works by looking for the best search depth d, thus starting with depth limit 0 and make a
DFS and if the search failed it increase the depth limit by 1 and try a DFS again with depth 1 and
so on – first d = 0, then 1 then 2 and so on – until a depth d is reached where a goal is found.
Completeness:
IDS is like BFS, is complete when the branching factor b is finite.
Optimality:
IDS is also like BFS optimal.
Time Complexity:
One may find that it is wasteful to generate nodes multiple times, but actually it is not that costly
compared to BFS. Consider that we are searching a binary tree and our depth limit reached 4, the
nodes generated in last level = 24 = 16, the nodes generated in all nodes before last level = 20 + 21
+ 22 + 23= 15
Imagine this scenario, we are performing IDS and the depth limit reached depth d, now if you
remember the way IDS expands nodes, you can see that nodes at depth d are generated once,
nodes at depth d-1 are generated 2 times, nodes at depth d-2 are generated 3 times and so on,
until you reach depth 1 which is generated d times, we can view the total number of generated
nodes in the worst case as:
N(IDS) = (b)d + (d – 1)b2 + (d – 2)b3 + …. + (2)bd-1 + (1)bd = O(bd)
If this search were to be done with BFS, the total number of generated nodes in the worst case
will be like:
N(BFS) = b + b2 + b3 + b4 + …. bd + (bd + 1) = O(bd + 1)
If we consider a realistic numbers, and use b = 10 and d = 5, then number of generated nodes in
BFS and IDS will be like
N(IDS) = 50 + 400 + 3000 + 20000 + 100000 = 123450
N(BFS) = 10 + 100 + 1000 + 10000 + 100000 + 999990 = 1111100
BFS generates like 9 time nodes to those generated with IDS.
Space Complexity:
IDS is like DFS in its space complexity, taking O(bd) of memory.
Conclusion:
We can conclude that IDS is a hybrid search strategy between BFS and DFS inheriting their
advantages. IDS is faster than BFS and DFS. It is said that “IDDS is the preferred uniformed
search method when there is a large search space and the depth of the solution is not known”.

8-PUZZLE PROBLEM
8-puzzle problem consists of 3x3 matrix have eight tiles and one empty space and we have to
start from an initial state and have to find the goal state by moving the tiles into the empty space.
Rules of solving puzzle
Instead of moving the tiles in the empty space we can visualize moving the empty space in place
of the tile.
The empty space can only move in four directions (Movement of empty space)
- Up
- Down
- Right or
- Left
The empty space cannot move diagonally and can take only one step at a time.
Example:

Let's solve the problem without Heuristic Search that is Uninformed Search or Blind Search
using Breadth First Search.

Time complexity: In worst case time complexity in BFS is O(bd).


In worst case it will be (320). The average branch factor will be 3, we can calculate it as follows;
All possible move of an Empty tile
o- Position total possible moves are (2)
x - position total possible moves are (3)
#-position total possible moves are (4)
( 2 x 4 + 3 x 4 + 1 x 4 ) /9 = 24/9 = 2.66 = 3 (Average branching factor)
N average case, search space can go upto depth of 20. So, in worst case it can take O(320) time.

You might also like