1 / 22

Problem Solving and Search

Problem Solving and Search. Andrea Danyluk September 11, 2013. Announcements. Progamming Assignment 0: Python Tutorial Due now Thanks for your patience with account set-up, turnin , etc. Assignment 1: Search Now posted on web site Due Fri, Sep 20 Team project! (35 students)

kelda
Download Presentation

Problem Solving and 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. Problem Solving and Search Andrea Danyluk September 11, 2013

  2. Announcements • Progamming Assignment 0: Python Tutorial • Due now • Thanks for your patience with account set-up, turnin, etc. • Assignment 1: Search • Now posted on web site • Due Fri, Sep 20 • Team project! (35 students) • First few parts straightforward. Don’t be fooled. It gets harder.

  3. Today’s Lecture • More on Uninformed search • Breadth-first • Depth-first • Uniform-cost search  New • Informed (Heuristic) search • Greedy best-first

  4. Formalizing State Space Search • A node in a search tree typically contains: • A state description • A reference to the parent node • The name of the operator that generated it from its parent • The cost of the path from the initial state to itself • Might also include its depth in the tree • The node that is the root of the search tree typically represents the initial state

  5. Formalizing State Space Search • Child nodes are generated by applying legal operators to a node • The process of expanding a node means to generate all of its successor nodes and to add them to the frontier. • A goal test is a function applied to a state to determine whether its associated node is a goal node

  6. Formalizing State Space Search • A solution is either • A sequence of operators that is associated with a path from start state to goal or • A state that satisfies the goal test • The cost of a solution is the sum of the arc costs on the solution path • If all arcs have the same (unit) cost, then the solution cost is just the length of the solution (i.e., the length of the path)

  7. Evaluating Search Strategies • Completeness • Is the strategy guaranteed to find a solution when there is one? • Optimality • Does the strategy find the highest-quality solution when there are several solutions? • Time Complexity • How long does it take (in the worst case) to find a solution? • Space Complexity • How much memory is required (in the worst case)?

  8. Evaluating BFS • Complete? • Yes (if the number of possible actions is finite) • Optimal? • Not in general. When is it optimal? • When costs of all actions are the same • Time Complexity? • How do we measure it? • Space Complexity?

  9. Time and Space Complexity Let • b = branching factor (i.e., max number of successors) • m = maximum depth of the search tree • d = depth of shallowest solution For BFS Time: O(bd) If we check for goal as we generate a node! Not if we check as we get ready to expand! Space: O(bd)

  10. Evaluating DFS • Complete? • Not in general • Yes if state space is finite and we modify tree search to account for loops • Optimal? • No • Time Complexity? • O(bm) • Space Complexity? • O(mb)

  11. Depth-Limited DFS? Let lbe the depth limit • Complete? • No • Optimal? • No • Time Complexity? • O(bl) • Space Complexity? • O(ml)

  12. Iterative Deepening? • Complete? • Yes (if b is finite) • Optimal? • Yes (if costs of all actions are the same) • Time Complexity? • O(bd) • Space Complexity? • O(bd)

  13. Costs on Actions

  14. Costs on Actions Cost of moving a truck = 2x the cost of moving a car that isn’t a sports car. Cost of moving a sports car is 4x the cost of moving any other vehicle.

  15. Uniform Cost Search f Similar to another algorithm you know? 3.5 a 3 b 1 3 1 4 2 1 g 1 e 2 c 5 3.75 3 Fringe is a Priority Queue Priority = cost so far d h 3 i

  16. Evaluating Uniform Cost Search • Complete? • Yes (if b is finite and step cost ≥ efor positive e ) • Optimal? • Yes • Time Complexity? • O(b1+C*/e)  Can’t check for goal until coming out of PQ! • Space Complexity? • O(b1+C*/e)

  17. So we’re done, right? Our search spaces are big.

  18. Informed (Heuristic) Search Strategies • Use problem-specific knowledge to find solutions more efficiently

  19. Best-first Search • Choose a node from the frontier based on its “desirability” • Frontier is a priority queue • Requires a search heuristic • Any estimate of how close a state is to a goal • Examples: • Euclidean distance • Manhattan distance • For the “rush hour” problem?

  20. Greedy Best-first Search h(n) = estimate of cost from n to the closest goal Expand the node with lowest h value - i.e., the node that appears to be closest to the goal

  21. Greedy Search with hSLD This time g is the goal. f 3.5 a 3 b 1 3 1 4 2 1 g 1 e 2 c 5 3.75 3 d h 3 i

  22. Problems with Greedy Search? Can be quite good with a high-quality heuristic, but • Not optimal • Time and space complexity: O(bm)

More Related