Amit ppt

3,433 views
3,354 views

Published on

problem charactrerestic

0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,433
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
237
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

Amit ppt

  1. 1. Amit purohit
  2. 2. <ul><li>Defining the problem as a State Space Search </li></ul><ul><li>Production Systems </li></ul><ul><li>Control Strategies </li></ul><ul><li>Breadth First Search </li></ul><ul><li>Depth First Search </li></ul><ul><li>Heuristic Search </li></ul><ul><li>Problem Characteristics </li></ul><ul><li>Is the Problem Decomposable? </li></ul><ul><li>Can Solution Steps be ignored or undone? </li></ul><ul><li>Production system characteristics </li></ul><ul><li>Issues in the design of search programs </li></ul>
  3. 3. <ul><li>Define the problem precisely </li></ul><ul><li>Analyse the problem </li></ul><ul><li>Isolate and represent the task knowledge that is necessary to solve the problem </li></ul><ul><li>Choose the best problem-solving techniques and apply it to the particular problem. </li></ul>
  4. 4. <ul><li>To build a program that could “play chess”, we could first have to specify the starting position of the chess board, the rules that define the legal moves, and the board positions that represent a win for one side or the other. </li></ul><ul><li>In addition, we must make explicit the previously implicit goal of not only playing the legal game of chess but also winning the game, if possible, </li></ul>
  5. 5. <ul><li>The state space for this problem can be described as the set of ordered pairs of integers (x,y) such that x = 0, 1,2, 3 or 4 and y = 0,1,2 or 3; x represents the number of gallons of water in the 4-gallon jug and y represents the quantity of water in 3-gallon jug </li></ul><ul><li>The start state is (0,0) </li></ul><ul><li>The goal state is (2,n) </li></ul>
  6. 6. <ul><li>The operators to be used to solve the problem can be described as follows: </li></ul>Sl No Current state Next State Descritpion 1 (x,y) if x < 4 (4,y) Fill the 4 gallon jug 2 (x,y) if y <3 (x,3) Fill the 3 gallon jug 3 (x,y) if x > 0 (x-d, y) Pour some water out of the 4 gallon jug 4 (x,y) if y > 0 (x, y-d) Pour some water out of the 3-gallon jug 5 (x,y) if x>0 (0, y) Empty the 4 gallon jug 6 (x,y) if y >0 (x,0) Empty the 3 gallon jug on the ground 7 (x,y) if x+y >= 4 and y >0 (4, y-(4-x)) Pour water from the 3 –gallon jug into the 4 –gallon jug until the 4-gallon jug is full
  7. 7. 8 (x, y) if x+y >= 3 and x>0 (x-(3-y), 3) Pour water from the 4-gallon jug into the 3-gallon jug until the 3-gallon jug is full 9 (x, y) if x+y <=4 and y>0 (x+y, 0) Pour all the water from the 3-gallon jug into the 4-gallon jug 10 (x, y) if x+y <= 3 and x>0 (0, x+y) Pour all the water from the 4-gallon jug into the 3-gallon jug 11 (0,2) (2,0) Pour the 2 gallons from 3-gallon jug into the 4-gallon jug 12 (2,y) (0,y) Empty the 2 gallons in the 4-gallon jug on the ground
  8. 8. <ul><li>Required a control structure that loops through a simple cycle in which some rule whose left side matches the current state is chosen, the appropriate change to the state is made as described in the corresponding right side, and the resulting state is checked to see if it corresponds to goal state. </li></ul><ul><li>One solution to the water jug problem </li></ul><ul><li>Shortest such sequence will have a impact on the choice of appropriate mechanism to guide the search for solution. </li></ul>Gallons in the 4-gallon jug Gallons in the 3-gallon jug Rule applied 0 0 2 0 3 9 3 0 2 3 3 7 4 2 5 or 12 0 2 9 0r 11 2 0
  9. 9. <ul><li>Define a state space that contains all the possible configurations of the relevant objects. </li></ul><ul><li>Specify one or more states within that space that describe possible situations from which the problem solving process may start ( initial state) </li></ul><ul><li>Specify one or more states that would be acceptable as solutions to the problem. ( goal states) </li></ul><ul><li>Specify a set of rules that describe the actions ( operations) available. </li></ul>
  10. 10. <ul><li>A production system consists of: </li></ul><ul><li>A set of rules, each consisting of a left side that determines the applicability of the rule and a right side that describes the operation to be performed if that rule is applied. </li></ul><ul><li>One or more knowledge/databases that contain whatever information is appropriate for the particular task. Some parts of the database may be permanent, while other parts of it may pertain only to the solution of the current problem. </li></ul><ul><li>A control strategy that specifies the order in which the rules will be compared to the database and a way of resolving the conflicts that arise when several rules match at once. </li></ul><ul><li>A rule applier </li></ul>
  11. 11. <ul><li>Inorder to solve a problem: </li></ul><ul><li>We must first reduce it to one for which a precise statement can be given. This can be done by defining the problem’s state space ( start and goal states) and a set of operators for moving that space. </li></ul><ul><li>The problem can then be solved by searching for a path through the space from an initial state to a goal state. </li></ul><ul><li>The process of solving the problem can usefully be modelled as a production system. </li></ul>
  12. 12. <ul><li>How to decide which rule to apply next during the process of searching for a solution to a problem? </li></ul><ul><li>The two requirements of good control strategy are that </li></ul><ul><ul><li>it should cause motion. </li></ul></ul><ul><ul><li>It should be systematic </li></ul></ul>
  13. 13. <ul><li>Algorithm: </li></ul><ul><ul><li>Create a variable called NODE-LIST and set it to initial state </li></ul></ul><ul><ul><li>Until a goal state is found or NODE-LIST is empty do </li></ul></ul><ul><ul><ul><li>Remove the first element from NODE-LIST and call it E. If NODE-LIST was empty, quit </li></ul></ul></ul><ul><ul><ul><li>For each way that each rule can match the state described in E do: </li></ul></ul></ul><ul><ul><ul><ul><li>Apply the rule to generate a new state </li></ul></ul></ul></ul><ul><ul><ul><ul><li>If the new state is a goal state, quit and return this state </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Otherwise, add the new state to the end of NODE-LIST </li></ul></ul></ul></ul>
  14. 14. (0,0) (4,0) (0,3) (4,3) (0,0) (1,3) (4,3) (0,0) (3,0)
  15. 15. <ul><li>If the initial state is a goal state, quit and return success </li></ul><ul><li>Otherwise, do the following until success or failure is signaled: </li></ul><ul><ul><li>Generate a successor, E, of initial state. If there are no more successors, signal failure. </li></ul></ul><ul><ul><li>Call Depth-First Search, with E as the initial state </li></ul></ul><ul><ul><li>If success is returned, signal success. Otherwise continue in this loop. </li></ul></ul>
  16. 16. <ul><li>In this search, we pursue a singal branch of the tree until it yields a solution or until a decision to terminate the path is made. </li></ul><ul><li>It makes sense to terminate a path if it reaches dead-end, produces a previous state. In such a state backtracking occurs </li></ul><ul><li>Chronological Backtracking: Order in which steps are undone depends only on the temporal sequence in which steps were initially made. </li></ul><ul><li>Specifically most recent step is always the first to be undone. </li></ul><ul><li>This is also simple backtracking. </li></ul>
  17. 17. <ul><li>DFS requires less memory since only the nodes on the current path are stored. </li></ul><ul><li>By chance, DFS may find a solution without examining much of the search space at all. </li></ul>
  18. 18. <ul><li>BFS will not get trapped exploring a blind alley. </li></ul><ul><li>If there is a solution, BFS is guarnateed to find it. </li></ul><ul><li>If there are multiple solutions, then a minimal solution will be found. </li></ul>
  19. 19. <ul><li>A simple motion causing and systematic control structure could solve this problem. </li></ul><ul><li>Simply explore all possible paths in the tree and return the shortest path. </li></ul><ul><li>If there are N cities, then number of different paths among them is 1.2….(N-1) or (N-1)! </li></ul><ul><li>The time to examine single path is proportional to N </li></ul><ul><li>So the total time required to perform this search is proportional to N! </li></ul><ul><li>For 10 cities, 10! = 3,628,800 </li></ul><ul><li>This phenomenon is called Combinatorial explosion. </li></ul>
  20. 20. <ul><li>Begin generating complete paths, keeping track of the shortest path found so far. </li></ul><ul><li>Give up exploring any path as soon as its partial length becomes greater than the shortest path found so far. </li></ul><ul><li>Using this algorithm, we are guaranteed to find the shortest path. </li></ul><ul><li>It still requires exponential time. </li></ul><ul><li>The time it saves depends on the order in which paths are explored. </li></ul>
  21. 21. <ul><li>A Heuristic is a technique that improves the efficiency of a search process, possibly by sacrificing claims of completeness. </li></ul><ul><li>Heuristics are like tour guides </li></ul><ul><li>They are good to the extent that they point in generally interesting directions; </li></ul><ul><li>They are bad to the extent that they may miss points of interest to particular individuals. </li></ul><ul><li>On the average they improve the quality of the paths that are explored. </li></ul><ul><li>Using Heuristics, we can hope to get good ( though possibly nonoptimal ) solutions to hard problems such asa TSP in non exponential time. </li></ul><ul><li>There are good general purpose heuristics that are useful in a wide variety of problem domains. </li></ul><ul><li>Special purpose heuristics exploit domain specific knowledge </li></ul>
  22. 22. <ul><li>It works by selecting locally superior alternative at each step. </li></ul><ul><li>Applying to TSP: </li></ul><ul><ul><li>Arbitrarily select a starting city </li></ul></ul><ul><ul><li>To select the next city, look at all cities not yet visited and select the one closest to the current city. Go to next step. </li></ul></ul><ul><ul><li>Repeat step 2 until all cities have been visited. </li></ul></ul><ul><li>This procedure executes in time proportional to N 2 </li></ul><ul><li>It is possible to prove an upper bound on the error it incurs. This provides reassurance that one is not paying too high a price in accuracy for speed. </li></ul>
  23. 23. <ul><li>This is a function that maps from problem state descriptions to measures of desirsability, usually represented as numbers. </li></ul><ul><ul><li>Which aspects of the problem state are considered, </li></ul></ul><ul><ul><li>how those aspects are evaluated, and </li></ul></ul><ul><ul><li>the weights given to individual aspects are chosen in such a way that </li></ul></ul><ul><li>the value of the heuristic function at a given node in the search process gives as good an estimate as possible of whether that node is on the desired path to a solution. </li></ul><ul><li>Well designed heuristic functions can play an important part in efficiently guiding a search process toward a solution. </li></ul>
  24. 24. <ul><li>Chess : The material advantage of our side over opponent. </li></ul><ul><li>TSP: the sum of distances so far </li></ul><ul><li>Tic-Tac-Toe: 1 for each row in which we could win and in we already have one piece plus 2 for each such row in we have two pieces </li></ul>
  25. 25. <ul><li>Inorder to choose the most appropriate method for a particular problem, it is necessary to analyze the problem along several key dimensions: </li></ul><ul><ul><li>Is the problem decomposable into a set of independent smaller or easier subproblems? </li></ul></ul><ul><ul><li>Can solution steps be ignored or at least undone if they prove unwise? </li></ul></ul><ul><ul><li>Is the problem’s universe predictable? </li></ul></ul><ul><ul><li>Is a good solution to the problem obvious without comparison to all other possible solutions? </li></ul></ul><ul><ul><li>Is the desired solution a state of the world or a path to a state? </li></ul></ul><ul><ul><li>Is a large amount of knowledge absolutely required to solve the problem or is knowledge important only to constrain the search? </li></ul></ul><ul><ul><li>Can a computer that is simply given the problem return the solution or will the solution of the problem require interaction between the computer and a person? </li></ul></ul>
  26. 26. <ul><li>Whether the problem can be decomposed into smaller problems? </li></ul><ul><li>Using the technique of problem decomposition, we can often solve very large problems easily. </li></ul>
  27. 27. <ul><li>Following operators are available: </li></ul><ul><li>CLEAR(x) [ block x has nothing on it]-> ON(x, Table) </li></ul><ul><li>CLEAR(x) and CLEAR(y) -> ON(x,y) [ put x on y] </li></ul>C A B A B C Start: ON(C,A) Goal: ON(B,C) and ON(A,B) ON(B,C) ON(B,C) and ON(A,B) ON(B,C) ON(A,B) CLEAR(A) ON(A,B) CLEAR(A) ON(A,B)
  28. 28. <ul><li>Suppose we are trying to prove a math theorem.We can prove a lemma. If we find the lemma is not of any help, we can still continue. </li></ul><ul><li>8-puzzle problem </li></ul><ul><li>Chess: A move cannot be taken back. </li></ul><ul><li>Important classes of problems: </li></ul><ul><ul><li>Ignorable ( theorem proving) </li></ul></ul><ul><ul><li>Recoverable ( 8-puzzle) </li></ul></ul><ul><ul><li>Irrecoverable ( Chess) </li></ul></ul><ul><li>The recoverability of a problem plays an important role in determining the complexity of the control structure necessary for the problem’s solution. </li></ul><ul><ul><li>Ignorable problems can be solved using a simple control structure that never backtracks </li></ul></ul><ul><ul><li>Recoverable problems can be solved by a slightly more complicated control strategy that does sometimes make mistakes </li></ul></ul><ul><ul><li>Irrecoverable problems will need to be solved by systems that expends a great deal of effort making each decision since decision must be final. </li></ul></ul>
  29. 29. <ul><li>Certain Outcome ( ex: 8-puzzle) </li></ul><ul><li>Uncertain Outcome ( ex: Bridge, controlling a robot arm) </li></ul><ul><li>For solving certain outcome problems, open loop approach ( without feedback) will work fine. </li></ul><ul><li>For uncertain-outcome problems, planning can at best generate a sequence of operators that has a good probability of leading to a solution. We need to allow for a process of plan revision to take place. </li></ul>
  30. 30. <ul><li>Any path problem </li></ul><ul><li>Best path problem </li></ul><ul><li>Any path problems can often be solved in a reasonable amount of time by using heuristics that suggest good paths to explore. </li></ul><ul><li>Best path problems are computationally harder. </li></ul>
  31. 31. <ul><li>Examples: </li></ul><ul><ul><li>Finding a consistent interpretation for the sentence “ The bank president ate a dish of pasta salad with the fork ”. We need to find the interpretation but not the record of the processing. </li></ul></ul><ul><ul><li>Water jug : Here it is not sufficient to report that we have solved , but the path that we found to the state (2,0). Thus the a statement of a solution to this problem must be a sequence of operations ( Plan) that produces the final state. </li></ul></ul>
  32. 32. <ul><li>Two examples: </li></ul><ul><ul><li>Chess: Knowledge is required to constrain the search for a solution </li></ul></ul><ul><ul><li>Newspaper story understanding: Lot of knowledge is required even to be able to recognize a solution. </li></ul></ul><ul><li>Consider a problem of scanning daily newspapers to decide which are supporting the democrats and which are supporting the republicans in some election. We need lots of knowledge to answer such questions as: </li></ul><ul><ul><li>The names of the candidates in each party </li></ul></ul><ul><ul><li>The facts that if the major thing you want to see done is have taxes lowered, you are probably supporting the republicans </li></ul></ul><ul><ul><li>The fact that if the major thing you want to see done is improved education for minority students, you are probably supporting the democrats. </li></ul></ul><ul><ul><li>etc </li></ul></ul>
  33. 33. <ul><li>The programs require intermediate interaction with people for additional inputs and to provided reassurance to the user. </li></ul><ul><li>There are two types of programs: </li></ul><ul><ul><li>Solitary </li></ul></ul><ul><ul><li>Conversational: </li></ul></ul><ul><li>Decision on using one of these approaches will be important in the choice of problem solving method. </li></ul>
  34. 34. <ul><li>There are several broad classes into which the problems fall. These classes can each be associated with generic control strategy that is appropriate for solving the problems: </li></ul><ul><ul><li>Classification : ex: medical diagnostics, diagnosis of faults in mechanical devices </li></ul></ul><ul><ul><li>Propose and Refine: ex: design and planning </li></ul></ul>
  35. 35. <ul><li>Can production systems, like problems, be described by a set of characteristics that shed some light on how they can easily be implemented? </li></ul><ul><li>If so, what relationships are there between problem types and the types of production systems best suited to solving the problems? </li></ul><ul><li>Classes of Production systems: </li></ul><ul><ul><li>Monotonic Production System: the application of a rule never prevents the later application of another rule that could also have been applied at the time the first rule was selected. </li></ul></ul><ul><ul><li>Non-Monotonic Production system </li></ul></ul><ul><ul><li>Partially commutative Production system: property that if application of a particular sequence of rules transforms state x to state y, then permutation of those rules allowable, also transforms state x into state y. </li></ul></ul><ul><ul><li>Commutative Production system </li></ul></ul>
  36. 36. <ul><li>Production system in which the application of a rule never prevents the later application of another rule that could also have been applied at the time the first rule was applied. </li></ul><ul><li>i.e., rules are independent. </li></ul>
  37. 37. <ul><li>A partially Commutative production system has a property that if the application of a particular sequence of rules transform state x into state y, then any permutation of those rules that is allowable, also transforms state x into state y. </li></ul><ul><li>A Commutative production system is a production system that is both monotonic and partially commutative. </li></ul>
  38. 38. <ul><li>These production systems are useful for solving ignorable problems. </li></ul><ul><li>Example: Theorem Proving </li></ul><ul><li>They can be implemented without the ability to backtrack to previous states when it is discovered that an incorrect path has been followed. </li></ul><ul><li>This often results in a considerable increase in efficiency, particularly because since the database will never have to be restored, It is not necessary to keep track of where in the search process every change was made. </li></ul><ul><li>They are good for problems where things do not change; new things get created. </li></ul>
  39. 39. <ul><li>Useful for problems in which changes occur but can be reversed and in which order of operations is not critical. </li></ul><ul><li>Example: Robot Navigation, 8-puzzle, blocks world </li></ul><ul><li>Suppose the robot has the following ops: go North (N), go East (E), go South (S), go West (W). To reach its goal, it does not matter whether the robot executes the N-N-E or N-E-N. </li></ul>
  40. 40. <ul><li>Problems in which irreversible change occurs </li></ul><ul><li>Example: chemical synthesis </li></ul><ul><li>The ops can be :Add chemical x to the pot, Change the temperature to t degrees. </li></ul><ul><li>These ops may cause irreversible changes to the potion being brewed. </li></ul><ul><li>The order in which they are performed can be very important in determining the final output. </li></ul><ul><li>(X+y) +z is not the same as (z+y) +x </li></ul><ul><li>Non partially commutative production systems are less likely to produce the same node many times in search process. </li></ul><ul><li>When dealing with ones that describe irreversible processes, it is partially important to make correct decisions the first time, although if the universe is predictable, planning can be used to make that less important. </li></ul>
  41. 42. Monotonic NonMonotonic Partially Commutative Theorem proving Robot Navigation Not Partially Commutative Chemical Synthesis Bridge
  42. 43. <ul><li>The direction in which to conduct the search ( forward versus backward reasoning). </li></ul><ul><li>How to select applicable rules ( Matching) </li></ul><ul><li>How to represent each node of the search process ( knowledge representation problem) </li></ul>
  43. 44. <ul><li>Four steps for designing a program to solve a problem: </li></ul><ul><ul><li>Define the problem precisely </li></ul></ul><ul><ul><li>Analyse the problem </li></ul></ul><ul><ul><li>Identify and represent the knowledge required by the task </li></ul></ul><ul><ul><li>Choose one or more techniques for problem solving and apply those techniques to the problem. </li></ul></ul>

×