1 / 26

Reasoning as Search

Reasoning as Search. Reasoning. We can describe reasoning as search in a space of possible situations. State Space Search. We need: A set of states A start state A set of operators (a successor function), possibly with costs attached. A set of goal states (or a way to test for goal).

sevita
Download Presentation

Reasoning as Search

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Reasoning as Search

  2. Reasoning We can describe reasoning as search in a space of possible situations.

  3. State Space Search • We need: • A set of states • A start state • A set of operators (a successor function), possibly with costs attached. • A set of goal states (or a way to test for goal)

  4. Recall the 8-Puzzle What are the states? http://www.javaonthebrain.com/java/puzz15/

  5. A Water Jug Problem You are given two jugs, a 4-gallon one and a 3-gallon one. Neither has any measuring markers on it. There is a pump that can be used to fill the jugs with water. How can you get exactly 2 gallons of water into the 4-gallon jug? States: Start state: Operators: Goal state:

  6. School Lunch Planning States: Start state: Operators: Goal state:

  7. Criminal Defense Lawyer States: Start state: Operators: Goal state:

  8. Search • Two key decisions: • Use a tree or a graph • How to choose which node to expand next • Example: http://www.javaonthebrain.com/java/puzz15/

  9. Performance Criteria • Completeness • Optimality • How good is the solution? • How efficient is the search algorithm at finding the solution?

  10. Breadth-First Search

  11. Depth-First Search

  12. The British Museum Algorithm A simple algorithm: Generate and test When done systematically, it is basic depth-first search. But suppose that each time we end a path, we start over at the top and choose the next path randomly. If we try this long enough, we may eventually hit a solution. We’ll call this The British Museum Algorithm or The Monkeys and Typewriters Algorithm http://www.arn.org/docs2/news/monkeysandtypewriters051103.htm

  13. A Version of Depth-First Search:Branch and Bound Consider the problem of planning a ski vacation. Fly to A $600 Fly to B $800 Fly to C $2000 Stay D $200 (800) Stay E $250 (850) Total cost (1200)

  14. Problem Reduction Goal: Acquire TV Steal TV Earn Money Buy TV Or another one: Theorem proving in which we reason backwards from the theorem we’re trying to prove.

  15. What is a Heuristic?

  16. What is a Heuristic? The word heuristic comes from the Greek word  (heuriskein), meaning “to discover”, which is also the origin of eureka, derived from Archimedes’ reputed exclamation, heurika (“I have found”), uttered when he had discovered that the volume of water displaced in the bath equals the volume of whatever (him) got put in the water. This could be used as a method for determining the purity of gold.

  17. What is a Heuristic? The word heuristic comes from the Greek word  (heuriskein), meaning “to discover”, which is also the origin of eureka, derived from Archimedes’ reputed exclamation, heurika (“I have found”), uttered when he had discovered that the volume of water displaced in the bath equals the volume of whatever (him) got put in the water. This could be used as a method for determining the purity of gold. A heuristic is a rule that helps us find something.

  18. Heuristic Functions • The job of a heuristic function f(n) is to evaluate a node n in a search tree so that the “best” node can be selected for expansion. • Two approaches to defining f: • f measures the value of the state contained in the node. • f measures the cost of the state (and possibly the path to it). Often, in this case, we decompose f: • f(n) = g(n) + h(n), where • g(n) = the cost to get to n, and • h(n) = an estimate of the cost to get from n to a goal

  19. Examples - f Measures the Value • Often, in these cases, f is the weighted sum of a set of component values: • Chess • School lunch planning • Autonomous Mars rover • Perry Mason defense lawyer

  20. Examples – f Measures the Cost to a Goal In many problems, all goal states are equally good. Then all we care about is the cost of getting to one. So a state is good if the estimated cost of getting from it to a goal is low. Or we may also want to take into account the cost, so far, of getting to it. • 8–Puzzle • Water jug • Route planning

  21. Hill Climbing Problem: You have just arrived in Washington, D.C. You’re in your car, trying to get downtown to the Washington Monument.

  22. Hill Climbing – Some Problems

  23. Sometimes the Problem is f From the initial state, move A to the table. Three choices for what to do next. A local heuristic function: Add one point for every block that is resting on the thing it is supposed to be resting on. Subtract one point for every block that is sitting on the wrong thing.

  24. Sometimes the Problem is f From the initial state, move A to the table. Three choices for what to do next. A global heuristic function: For each block that has the correct support structure (i. e., the complete structure underneath it is exactly as it should be), add one point for every block in the support structure. For each block that has an incorrect support structure, subtract one point for every block in the existing support structure.

  25. Hill Climbing – Is Close Good Enough? B A • Is A good enough? • Choose winning lottery numbers

  26. Hill Climbing – Is Close Good Enough? B A • Is A good enough? • Choose winning lottery numbers • Get the cheapest travel itinerary • Clean the house

More Related