Presentation is loading. Please wait.

Presentation is loading. Please wait.

SOLVING PROBLEMS BY SEARCHING

Similar presentations


Presentation on theme: "SOLVING PROBLEMS BY SEARCHING"— Presentation transcript:

1 SOLVING PROBLEMS BY SEARCHING

2 Problem Solving Agent Problem-solving agents decide what to do by finding sequences of actions that lead to desirable states. Intelligent agents are supposed to act in such a way that the environment goes through a sequence of states that maximizes the performance measure. In its full generality, this specification is difficult to translate into a successful agent design. The task is somewhat simplified if the agent can adopt a goal and aim to satisfy it.

3 BREADTH FIRST SEARCH(BFS)
One simple search strategy is a breadth-first search. In this strategy, the root node is expanded first, then all the nodes generated by the root node are expanded next, and then their successors, and so on. In general, all the nodes at depth d in the search tree are expanded before the nodes at depth d + 1. Breadth-first search can be implemented by calling the GENERAL-SEARCH algorithm with a queuing function that puts the newly generated states at the end of the queue, after all the previously generated states

4

5

6 ADVANTAGES OF BREADTH-FIRST SEARCH
Breadth first search will never get trapped exploring the useless path forever. If there is a solution, BFS will definitely find it out. If there is more than one solution then BFS can find the minimal one that requires less number of steps.

7 DISADVANTAGES OF BREADTH-FIRST SEARCH
The main drawback of Breadth first search is its  memory  requirement. Since each level of the tree must be saved in order to generate the next level, and the amount of memory is proportional to the number of nodes stored, the space complexity of BFS is O(bd). As a result, BFS is severely space-bound in practice so will exhaust the memory available on typical computers in a matter of minutes. If the solution is farther away from the root, breath first search will consume lot of time.

8 Depth First Search (DFS)
Depth-first search always expands one of the nodes at the deepest level of the tree. Only when the search hits a dead end (a non-goal node with no expansion) does the search go back and expand nodes at shallower levels. This strategy can be implemented by GENERAL-SEARCH with a queuing function that always puts the newly generated states at the front of the queue. Because the expanded node was the deepest, its successors will be even deeper and are therefore now the deepest.

9

10


Download ppt "SOLVING PROBLEMS BY SEARCHING"

Similar presentations


Ads by Google