Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright R. Weber Search in Problem Solving Search in Problem Solving INFO 629 Dr. R. Weber.

Similar presentations


Presentation on theme: "Copyright R. Weber Search in Problem Solving Search in Problem Solving INFO 629 Dr. R. Weber."— Presentation transcript:

1 Copyright R. Weber Search in Problem Solving Search in Problem Solving INFO 629 Dr. R. Weber

2 Copyright R. Weber Outline problem-solving problem-solving algorithms algorithms parts of a problem: formulation parts of a problem: formulation state space model state space model example problems example problems general search algorithm general search algorithm search strategies search strategies additional problems and strategies additional problems and strategies

3 Copyright R. Weber Problem solving What if deductive reasoning does not work? What if deductive reasoning does not work? What if case-based reasoning does not work? What if case-based reasoning does not work? What if inductive reasoning does not work? What if inductive reasoning does not work?

4 Copyright R. Weber Problem solving (ii) Some problems motivate us to list all its possible solutions, these are well understood problems. E.g., travel from Philly to NYC Some problems motivate us to list all its possible solutions, these are well understood problems. E.g., travel from Philly to NYC Some problems have clear allowed actions but you don’t know which ones will take you to the solution. E.g., some puzzles, route to arrive at the train station in Hartford Some problems have clear allowed actions but you don’t know which ones will take you to the solution. E.g., some puzzles, route to arrive at the train station in Hartford

5 Copyright R. Weber Problem solving (iii) Others have clear allowable actions but you don’t know which will take you to the goal more efficiently (faster, cheaper, economical design). E.g., designing a chip, design layout of parts in autoclave, schedule parts for production, schedule experts in call center. Others have clear allowable actions but you don’t know which will take you to the goal more efficiently (faster, cheaper, economical design). E.g., designing a chip, design layout of parts in autoclave, schedule parts for production, schedule experts in call center. Others also have constraints and may not be feasible. E.g. travel planning, schedule exams for university. Others also have constraints and may not be feasible. E.g. travel planning, schedule exams for university. Others you are simply not capable of solving because of combinatorial explosion. E.g., travel salesman Others you are simply not capable of solving because of combinatorial explosion. E.g., travel salesman

6 Copyright R. Weber Search search consists of a set of methods to systematically determine the next best action in order to search for a solution of a problem search consists of a set of methods to systematically determine the next best action in order to search for a solution of a problem parts of a problem: initial state, operators, goal test function, (path cost function). parts of a problem: initial state, operators, goal test function, (path cost function).

7 Copyright R. Weber Algorithm a search algorithm takes a problem as input and returns a solution in the form of an action sequence. a search algorithm takes a problem as input and returns a solution in the form of an action sequence. Formulate the problem in terms of sequences of actions to perform search Formulate the problem in terms of sequences of actions to perform search Environment: state space, path, solution. Environment: state space, path, solution. State space consists of all possible states e.g., (3,3,1), (1,1,0), (0,0,0), (2,2,1) State space consists of all possible states e.g., (3,3,1), (1,1,0), (0,0,0), (2,2,1) Path represents the steps taken to reach a solution Path represents the steps taken to reach a solution

8 Copyright R. Weber CANNIBALS AND MISSIONARIES http://www.dc.fi.udc.es/lidia/mariano/demos/Misioneros-Canibales/cannibal.htm CANNIBALS AND MISSIONARIES http://www.dc.fi.udc.es/lidia/mariano/demos/Misioneros-Canibales/cannibal.htm An example:

9 Copyright R. Weber CANNIBALS AND MISSIONARIES initial state is (3,3,1) initial state is (3,3,1) operators are five: CC, MM, CM, C, M operators are five: CC, MM, CM, C, M goal test is (0,0,0) goal test is (0,0,0) path cost: number of crossings path cost: number of crossings STATE SPACE MODEL

10 Copyright R. Weber Problem Solving with Search Formulate problem Formulate problem goal and problem formulation goal and problem formulation Choose search algorithm Choose search algorithm determine the next best action in order to search for a solution of a problem determine the next best action in order to search for a solution of a problem Execute Execute execute search method until solution is found execute search method until solution is found

11 Copyright R. Weber General Search Algorithm identify initial state identify initial state expand (generate new states) expand (generate new states) choose option choose option test goal function test goal function expand until goal not attained/no more states to expand expand until goal not attained/no more states to expand

12 Copyright R. Weber The NY tourist algorithm 1.identify initial state: - you are in a corner in NY 2.expand (use operators to generate new states) - identify legal operations 3.choose option (search strategy) - always make a right if you can otherwise go left - go to the side which is closest to your visual view of the goal 4.test goal function: Are you there yet? 5.If goal not attained (and there are still states to expand), continue from 2

13 Copyright R. Weber Example problems toy problems toy problems used to test search algorithms used to test search algorithms real world problems real world problems used to solve real problems used to solve real problems

14 Copyright R. Weber Toy problems

15 Copyright R. Weber The 8-puzzle (Russel&Norvig)

16 Copyright R. Weber Cryptarithmetic (Russel&Norvig)

17 Copyright R. Weber General puzzles algorithm 1. identify initial state as origin 2. expand to all possible locations 3. the blank space changes place with tile on its right 4. test goal function, is it the destiny? 5. if yes, return configuration else, return to 2

18 Copyright R. Weber Real world problems

19 Copyright R. Weber Applications of route finding Route planning Route planning Routing in computer networks Routing in computer networks Automated travel advisory systems Automated travel advisory systems Airline travel planning Airline travel planning Garbage collection/cleaning trucks Garbage collection/cleaning trucks Food/document delivery Food/document delivery Does this mean that search is the only method to perform route planning?? Does this mean that search is the only method to perform route planning??

20 Copyright R. Weber General route finding algorithm 1. identify initial state as origin 2. expand to all possible locations 3. choose location with smallest cost/fastest route/favor highways 4. test goal function, is it the destiny? 5. if yes, return location else, return to 2

21 Copyright R. Weber Traveling salesperson problems is a category of problems is a category of problems each city has to be visited once each city has to be visited once goal is to find the shortest tour goal is to find the shortest tour Exams in university Exams in university Nurses in hospitals Nurses in hospitals Experts in call centers Experts in call centers Scheduling

22 Copyright R. Weber VLSI layout Very large scale integration Very large scale integration Design of silicon chip Design of silicon chip Define the position and connections of a million gates in a chip Define the position and connections of a million gates in a chip Tasks: cell layout, channel routing Tasks: cell layout, channel routing Goal is to min area & connection length Goal is to min area & connection length

23 Copyright R. Weber Robot navigation Generalization of route finding problem Generalization of route finding problem Any route can be chosen in a continuous space Any route can be chosen in a continuous space Possible actions and states in a continuous space are infinite Possible actions and states in a continuous space are infinite The more actions a robot can perform the more dimensions are needed to describe states and actions The more actions a robot can perform the more dimensions are needed to describe states and actions To identify the result of an action, a robot must use vision To identify the result of an action, a robot must use vision

24 Copyright R. Weber Assembly sequencing Many industries use automatic assembly of objects Many industries use automatic assembly of objects Find an order to assemble parts of an object Find an order to assemble parts of an object Find an order to submit parts to a given process Find an order to submit parts to a given process Design for autoclave layout Design for autoclave layout Layout Design

25 Copyright R. Weber Constraint Satisfaction Problem 1. Initial is given by values of variables 2. Expand to all possible values 3. Variables change values 4. Do the variables’ values respect constraints? 5. if yes, return values else, return to 2 Another class of problems Another class of problems Design and scheduling problems Design and scheduling problems Algorithms designed specifically for CSP perform better than general ones Algorithms designed specifically for CSP perform better than general ones

26 Copyright R. Weber Constraint Satisfaction Search type of formulation indicated for many design and scheduling problems type of formulation indicated for many design and scheduling problems specific algorithms for CSP assign values for all variables and iteratively improve the solution within the area of the constraints specific algorithms for CSP assign values for all variables and iteratively improve the solution within the area of the constraints scheduling, PERT/CPM scheduling, PERT/CPM project planning and management project planning and management42

27 Copyright R. Weber Search strategies

28 Copyright R. Weber Uninformed search strategies breadth-first search breadth-first search uniform cost search uniform cost search depth-first search depth-first search depth-limited search depth-limited search iterative deepening search iterative deepening search bidirectional search bidirectional search Informed /heuristic strategies Informed /heuristic strategies best-first search best-first search A* A* Heuristic functions Heuristic functions memory bounded search memory bounded search simulated annealing simulated annealing Hill-climbing Hill-climbing

29 Copyright R. Weber Breadth-first search all nodes at depth d are expanded before the nodes at depth d+1 all nodes at depth d are expanded before the nodes at depth d+1 if there is a solution, it will find if there is a solution, it will find if there are more than one, it will find the shallowest if there are more than one, it will find the shallowest planning puzzles; large memory requirements planning puzzles; large memory requirements

30 Copyright R. Weber Depth-first search expands the deepest node to the deepest level of a tree expands the deepest node to the deepest level of a tree only expands nodes at shallower levels after reaching the end only expands nodes at shallower levels after reaching the end it does not guarantee a solution (neither complete or optimal) it does not guarantee a solution (neither complete or optimal) less memory requirements less memory requirements may be faster than breadth-first, but it may get stuck on a bad path may be faster than breadth-first, but it may get stuck on a bad path

31 Copyright R. Weber Depth-limited search imposes a bound on the maximum depth of a path imposes a bound on the maximum depth of a path guarantees that a solution is found if it exists guarantees that a solution is found if it exists Iterative deepening search tries to bound the search iteratively tries to bound the search iteratively it is optimal and complete it is optimal and complete implement depth first search up to the Nth level. N should start at either 0 or 1 and be incremented after each search up to N is complete. implement depth first search up to the Nth level. N should start at either 0 or 1 and be incremented after each search up to N is complete.

32 Copyright R. Weber Uniform cost search expands the lowest-cost node expands the lowest-cost node to find the best solution it requires that all operators have positive costs (the cost of a path does not decrease as we go along that path) to find the best solution it requires that all operators have positive costs (the cost of a path does not decrease as we go along that path) route-finding route-finding

33 Copyright R. Weber Bidirectional search start searching from the origin and from the goal and stop when searches meet start searching from the origin and from the goal and stop when searches meet

34 Copyright R. Weber Informed strategies best-first search best-first search nodes are ordered by an evaluation function nodes are ordered by an evaluation function A* A* uses an estimated cost uses an estimated cost Heuristic functions Heuristic functions memory bounded search memory bounded search simulated annealing simulated annealing to escape local maxima Hill-climbing Hill-climbing continually moves in the direction of increasing value

35 Copyright R. Weber Search strategies When do you solve a problem using a search strategy? When there is an algorithm to solve it when: it is guaranteed to find a solution it is guaranteed to find a solution when it finds a solution in a timely manner when it finds a solution in a timely manner when the memory requirements are reasonable when the memory requirements are reasonable when it can find the best solution or at least one of the best when it can find the best solution or at least one of the best sometimes, one can combine searches to improve the quality of a solution sometimes, one can combine searches to improve the quality of a solution


Download ppt "Copyright R. Weber Search in Problem Solving Search in Problem Solving INFO 629 Dr. R. Weber."

Similar presentations


Ads by Google