Problem Solving and Search Andrea Danyluk September 11, 2013.

Slides:



Advertisements
Similar presentations
Review: Search problem formulation
Advertisements

Uninformed search strategies
Greedy best-first search Use the heuristic function to rank the nodes Search strategy –Expand node with lowest h-value Greedily trying to find the least-cost.
Solving Problem by Searching
Problem Solving and Search Andrea Danyluk September 9, 2013.
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
Blind Search by Prof. Jean-Claude Latombe
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
Blind Search1 Solving problems by searching Chapter 3.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.4) January, 14, 2009.
Search Strategies Reading: Russell’s Chapter 3 1.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
CS 484 – Artificial Intelligence1 Announcements Department Picnic: today, after class Lab 0 due today Homework 2 due Tuesday, 9/18 Lab 1 due Thursday,
1 Blind (Uninformed) Search (Where we systematically explore alternatives) R&N: Chap. 3, Sect. 3.3–5.
Touring problems Start from Arad, visit each city at least once. What is the state-space formulation? Start from Arad, visit each city exactly once. What.
Artificial Intelligence (CS 461D)
Uninformed Search Jim Little UBC CS 322 – Search 2 September 12, 2014
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
Artificial Intelligence Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Slide 1 Heuristic Search: BestFS and A * Jim Little UBC CS 322 – Search 5 September 19, 2014 Textbook § 3.6.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
Artificial Intelligence Chapter 3: Solving Problems by Searching
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
CPSC 322, Lecture 8Slide 1 Heuristic Search: BestFS and A * Computer Science cpsc322, Lecture 8 (Textbook Chpt 3.5) January, 21, 2009.
CSC344: AI for Games Lecture 4: Informed search
CS 188: Artificial Intelligence Spring 2006 Lecture 2: Queue-Based Search 8/31/2006 Dan Klein – UC Berkeley Many slides over the course adapted from either.
Uninformed Search (cont.)
CS 561, Session 6 1 Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
CS 188: Artificial Intelligence Fall 2009 Lecture 2: Queue-Based Search 9/1/2009 Dan Klein – UC Berkeley Multiple slides from Stuart Russell, Andrew Moore.
For Friday Finish chapter 3 Homework: –Chapter 3, exercise 6 –May be done in groups. –Clarification on part d: an “action” must be running the program.
Solving Problems by Searching
CMU Snake Robot
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Computer Science CPSC 322 Lecture Heuristic Search (Ch: 3.6, 3.6.1) Slide 1.
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
CHAPTER 4: INFORMED SEARCH & EXPLORATION Prepared by: Ece UYKUR.
Search Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Dan Klein, Stuart Russell, Andrew Moore, Svetlana Lazebnik,
Artificial Intelligence
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Search with Costs and Heuristic Search 1 CPSC 322 – Search 3 January 17, 2011 Textbook §3.5.3, Taught by: Mike Chiang.
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Lecture 3: Uninformed Search
CSC3203: AI for Games Informed search (1) Patrick Olivier
Computer Science CPSC 322 Lecture 6 Iterative Deepening and Search with Costs (Ch: 3.7.3, 3.5.3)
For Friday Read chapter 4, sections 1 and 2 Homework –Chapter 3, exercise 7 –May be done in groups.
1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.
1 Kuliah 4 : Informed Search. 2 Outline Best-First Search Greedy Search A* Search.
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Uninformed search strategies A search strategy is defined by picking the order of node expansion Uninformed search strategies use only the information.
Problem Solving as Search. Problem Types Deterministic, fully observable  single-state problem Non-observable  conformant problem Nondeterministic and/or.
Slides by: Eric Ringger, adapted from slides by Stuart Russell of UC Berkeley. CS 312: Algorithm Design & Analysis Lecture #36: Best-first State- space.
CPSC 322, Lecture 6Slide 1 Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 17, 2012.
Implementation: General Tree Search
Solving problems by searching A I C h a p t e r 3.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Blind Search Russell and Norvig: Chapter 3, Sections 3.4 – 3.6 CS121 – Winter 2003.
Best-first search is a search algorithm which explores a graph by expanding the most promising node chosen according to a specified rule.
Brian Williams, Fall 041 Analysis of Uninformed Search Methods Brian C. Williams Sep 21 st, 2004 Slides adapted from: Tomas Lozano Perez,
For Monday Read chapter 4 exercise 1 No homework.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Artificial Intelligence Solving problems by searching.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Lecture 3: Uninformed Search
Searching for Solutions
Presentation transcript:

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) – First few parts straightforward. Don’t be fooled. It gets harder.

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

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

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

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)

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)?

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?

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(b d ) If we check for goal as we generate a node! Not if we check as we get ready to expand! Space: O(b d )

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(b m ) Space Complexity? – O(mb)

Depth-Limited DFS? Let l be the depth limit Complete? – No Optimal? – No Time Complexity? – O(b l ) Space Complexity? – O(m l )

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

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.

Uniform Cost Search a a b b h h g g c c f f e e d d i i Fringe is a Priority Queue Priority = cost so far Similar to another algorithm you know?

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

Generalized Search Function S EARCH (problem, frontier) returns a solution, or failure expanded ← an empty set frontier ← Insert(Make-Node(Initial-State[problem]), frontier) loop do if frontier is empty then return failure node ← Remove(frontier) if Goal-Test(problem, State[node]) then return node if State[node] is not in explored then add State[node] to explored frontier ← InsertAll(Expand(node, problem), frontier) end But be careful about slight (and yet significant) differences!

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

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

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?

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

Greedy Search with h SLD a a b b h h g g c c f f e e d d i i a6 b2.5 c6 d3 e1.5 f3 g0 h3.5 i6.5 black4.5 red3.5 yellow2.5 This time g is the goal.

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