Top Banner
Uninformed Search Technique Presented By: Kapil Dahal [email protected]
28

Uninformed Search technique

Feb 07, 2017

Download

Data & Analytics

Kapil Dahal
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Uninformed Search technique

Uninformed Search Technique

Presented By: Kapil [email protected]

Page 2: Uninformed Search technique

Breadth First Search• The breadth first search algorithm visits the nodes of the tree along

its breadth, starting from the level with depth 0 to the maximum depth.

• Here, the nodes in the tree are traversed following their ascending ordered labels.

Page 3: Uninformed Search technique
Page 4: Uninformed Search technique

Algorithm

Page 5: Uninformed Search technique

Contd….

Page 6: Uninformed Search technique

How the algorithm works?• If the current node is not the goal add the offspring of thecurrent in any order to the rear end of the queue and redefine the frontelement of the queue as the current.

• The algorithm terminates, when the goal is found.

Page 7: Uninformed Search technique

Time Complexity

Page 8: Uninformed Search technique

Expanding….

Page 9: Uninformed Search technique

Time and Memory requirement : Example

Page 10: Uninformed Search technique

Uniform Cost• Breadth first search is optimal when all step costs are equal.

• Uniform Cost search is optimal when step costs varies.

• Uniform-cost search expands the node n with lowest path cost.

Page 11: Uninformed Search technique

Uniform Cost Search:example

Page 12: Uninformed Search technique

Depth First Search• The depth first search generates nodes and compares them with the

goal along the largest depth of the tree and moves up to the parent of the last visited node, only when no further node can be generated below the last visited node.

• After moving up to the parent, the algorithm attempts to generate a new offspring of the parent node.

• Uses Stack as data structure.

Page 13: Uninformed Search technique

Algorithm

Page 14: Uninformed Search technique

Example tree

Page 15: Uninformed Search technique

Contd…• In the above algorithm, a starting node is placed in the stack, the top

of which is pointed to by the stack-top. For examining the node, it is popped out from the stack.

• If it is the goal, the algorithm terminates, else its children are pushed into the stack in any order.

• The process is continued until the stack is empty.

Page 16: Uninformed Search technique

example:DFS

Page 17: Uninformed Search technique

Properties: Depth first search

Page 18: Uninformed Search technique

Depth Limited Search• Depth-limited search avoids the pitfalls of depth-first search by

imposing a cutoff on the maximum depth of a path.

• This cutoff can be implemented with a special depth-limited search algorithm, or by using the general search algorithm with operators that keep track of the depth.

• To avoid the infinite depth problem of DFS, we can decide to only search until depth L, i.e. we don’t expand beyond depth L.

Page 19: Uninformed Search technique

Iterative deepening depth-first search• To avoid the infinite depth problem of DFS, we can decide to only

search until depth L, i.e. we don’t expand beyond depth L->Depth first search.

• What of solution is deeper than L? -->Increase L iteratively.->Iterative Deepening Search

Page 20: Uninformed Search technique

Contd…• When the initial depth cut-off is one, it generates only the root node

and examines it.

• If the root node is not the goal, then depth cut-off is set to two and the tree up to depth 2 is generated using typical depth first search.

• Similarly, when the depth cut-off is set to m, the tree is constructed up to depth m by depth first search.

Page 21: Uninformed Search technique

Contd…• Iterative deepening search is a strategy that sidesteps the issue of

choosing the best depth limit by trying all possible depth limits: first depth 0, then depth 1, then depth 2, and so on.

Page 22: Uninformed Search technique

Algorithm: IDS

Page 23: Uninformed Search technique

Example : Iterative deepening

Page 24: Uninformed Search technique

Nodes Generated:IDS• Number of nodes generated in a depth-limited search to depth d with

branching factor b:

• Number of nodes generated in an iterative deepening search to depth d with branching factor b:

Page 25: Uninformed Search technique

Properties: IDS

Page 26: Uninformed Search technique

Bi-Directional Search• Alternate searching from the start state toward the goal and from the

goal state toward the start.• Stop when the frontiers intersect.• Works well only when there are unique start and goal states.• Requires the ability to generate “predecessor” states.•

Page 27: Uninformed Search technique

Bidirectional search: figure

Page 28: Uninformed Search technique

Comparing Search Strategies