blind search methods

Post on 27-Nov-2014

85 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

4TH WEEK BLIND SEARCH

METHODS

ARTIFICIAL INTELLIGENCE2011-1 Group 1

BLIND SEARCHES

INTRODUCTION A blind search (also called an

uninformed search) is a search that has no information about its domain. The only thing that a blind search can do is distinguish a non-goal state from a goal state.

BLIND SEARCHES METHODS

Breadth-First SearchIt goes through the tree level by level, visiting all of the nodes on the top level first, then all the nodes on the second level, and so on. This strategy has the benefit of being complete (if there's a solution, it will be found), and optimal as long as the shallowest solution is the best solution.

Breadth-First Search Algorythm

1. QUEUE <-- path only containing the root;

2. WHILE QUEUE is not empty AND goal is not reached

DO remove the first path from the QUEUE; create new paths (to all children); reject the new paths with loops; add the new paths to back of QUEUE;

3. IF goal reached THEN success; ELSE failure;

Breadth-First Search

EXAMPLE:In this example, we can notice the level-by-level search to find the word “search”

BLIND SEARCHES METHODS

Depth-First SearchIt goes through the tree branch by branch, going all the way down to the leaf nodes at the bottom of the tree before trying the next branch over. This strategy requires much less memory than breadth-first search, since it only needs to store a single path from the root of the tree down to the leaf node.

Algorythm

1. QUEUE <-- path only containing the root;

2. WHILE QUEUE is not empty AND goal is not reached

DO remove the first path from the QUEUE; create new paths (to all children); reject the new paths with loops; add the new paths to front of QUEUE;

3. IF goal reached THEN success; ELSE failure;

Depth-First Search

Depth-First Search

12º

16º

13º

EXAMPLE:In this example, we can notice the level-by-level search to find the word “search”

10º

11º

14º

15º

17º

BLIND SEARCHES METHODS

Non Deterministic SearchForm a one element queue consisting of a

zero-length path that only contains rootUntil the first path in the queue terminates at

the goal node or the queue is empty Remove the first path from the queue; create

new paths by extending the first path to all neighbors of the terminal node

Reject all new paths with loops Add the new paths at RANDOM places in the

queue

If the goal node is foundsuccess; else failure

Non Deterministic Search Algorythm:

1. QUEUE <-- path only containing the root;

2. WHILE QUEUE is not empty AND goal is not reached

DO remove the first path from the QUEUE; create new paths (to all children); reject the new paths with loops; add the new paths in random places in QUEUE;

3. IF goal reached THEN success; ELSE failure;

top related