You are on page 1of 3

1.

Explain in detail about problem solving agents PROBLEM-SOLVING AGENTS


Goals and Goal Formulation - first step in problem solving Problem Formulation deciding on actions and states to consider, given a goal Search - for Sequences of Actions that Lead to the Goal (Solution) Execute carry out the actions recommended by the solution

AN EXAMPLE: Problem-solving in a simple environment The (agent design) assumes that the environment is 1. Static formulating & solving the problem is done without paying attention to any changes in the environment 2. Observable initial state is known 3. Discrete because alternative courses of action can be enumerated 4. Deterministic solutions to problems are single sequences of actions, so they cant handle any unexpected events. PROBLEM FORMULATION - Well-defined problems can be defined by the following 4 components 1. Initial State the start state of the agent 2. Operators possible actions available to agent. Example is the Successor function. State space = initial state + successor function. A path is a sequence of states connected by a sequence of actions. 3. Goal Test determine whether a given state is a goal state; in general, there are many goal states. 4. Path cost function that assigns a numeric cost to each path; the step cost is the cost of moving from a state to the next state. Problems are solved by searching through the state space. The resulting search tree is evaluated as follows: 1. Start at root node of tree 2. Expand (by using the successor function) the current state to find other states, and check which of these are goal states. 3. The search strategy is used to determine which state to expand. Each node has the following 5 components: (a) (b) (c) STATE PARENT-NODE ACTION - action applied to the parent to generate the node

(d) (e)

PATH-COST : the cost, g(n), of the path from initial state to the node DEPTH number of steps along the path from initial state.

Operations on a queue 1. 2. 3. 4. 5. 6. MAKE-QUEUE : create a queue with a set of elements EMPTY? - check if there are elements left in a queue FIRST returns the first element of a queue REMOVE-FIRST : returns first element and remove it from the queue INSERT - insert an element into the queue and return the resulting queue INSERT-ALL : insert a set of elements and return the queue.

Measuring Problem-Solving Performance Criteria for evaluating search strategies


Completeness will algorithm find solution if one exists? Time Complexity - how long it takes to find solution Note: Time is measured in terms of the number of nodes generated during search Space Complexity - memory required to perform search Note: Space is measured in terms of maximum number of nodes stored in memory Optimality - does algorithm find optimal solution?

2 a) Explain in detail about uninformed search strategies SEARCH STRATEGIES 1. Uninformed (blind) Search This strategy has no additional information about states beyond what is provided in the problem definition. All it does is generate successors and distinguish a goal state from a nongoal state. There are 5 methods: (a) Depth-first Search (DFS)

Expand the node deepest in the tree. Backtrack when you reach a non-goal node with no descendants Problems with DFS It can make a wrong choice and go down a long (possibly infinite) path, although there may be a solution close to the root of the tree. DFS is not optimal. If left subtree is of unbounded depth, but contained no solutions, DFS would never terminate. Hence, DFS is not complete. Time complexity of DFS is O(bm)

Space complexity of DFS is O(bm)

(b) Breadth-first Search (BFS)


Expand all the nodes at depth d before expanding at depth d+1. (Sequence is: root node, then its children, its grandchildren, etc) Optimal? Yes, if path cost is a non-decreasing function of the depth of the goal node (in particular, if all step costs are equal). Complete? Yes. If the shallowest goal node is at depth d, BFS will find it after expanding all shallower nodes (if branching factor b is finite)

(c) Depth-limited Search (DLS) Solves problem of unbounded trees (the infinite-path problem) in DFS by using a predetermined depth limit l. DLS is still incomplete if l < d that is, the shallowest goal is beyond the limit. DLS is nonoptimal if l > d. Time complexity is O(bl); space complexity is O(bl). (d) Iterative Deepening Search (IDS) - Finds the best depth limit. Gradually increase the limit 0, 1, 2, - until goal is found at depth limit d.

IDS combines the benefits of DFS and BFS. Like DFS space complexity is O(bd). Like BFS it is complete when the branching factor is finite; and it is optimal if path cost is a non-decreasing function of the depth of the goal node. Time complexity is O(bd).

You might also like