Lecture 7: Uninformed Search Dr John Levine 52236 Algorithms and Complexity February 13th 2006.

Slides:



Advertisements
Similar presentations
Review: Search problem formulation
Advertisements

Announcements Course TA: Danny Kumar
Lecture 8: Informed Search Dr John Levine Algorithms and Complexity February 27th 2006.
Artificial Intelligence Problem Solving Eriq Muhammad Adams
Lecture 12: Revision Lecture Dr John Levine Algorithms and Complexity March 27th 2006.
ICS-171:Notes 4: 1 Notes 4: Optimal Search ICS 171 Summer 1999.
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.
Properties of breadth-first search Complete? Yes (if b is finite) Time? 1+b+b 2 +b 3 +… +b d + b(b d -1) = O(b d+1 ) Space? O(b d+1 ) (keeps every node.
CMSC 471 Spring 2014 Class #4 Thu 2/6/14 Uninformed Search Professor Marie desJardins,
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.
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
Uninformed Search Jim Little UBC CS 322 – Search 2 September 12, 2014
Artificial Intelligence Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
CS 380: Artificial Intelligence Lecture #3 William Regli.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 23, 2009.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
1 Using Search in Problem Solving Part II. 2 Basic Concepts Basic concepts: Initial state Goal/Target state Intermediate states Path from the initial.
Using Search in Problem Solving
Using Search in Problem Solving
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.
Solving problems by searching
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
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.
State-Space Searches.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Problem Solving and Search Andrea Danyluk September 11, 2013.
Search: Heuristic &Optimal Artificial Intelligence CMSC January 16, 2003.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
Lecture 6: Problem Solving Dr John Levine Algorithms and Complexity February 10th 2006.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l all learning algorithms,
Today’s Topics FREE Code that will Write Your PhD Thesis, a Best-Selling Novel, or Your Next Methods for Intelligently/Efficiently Searching a Space.
Informed (Heuristic) Search
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
Search exploring the consequences of possible actions.
Assignment 2 (from last week) This is a pen-and-paper exercise, done in the same groups as for Practical 1 Your answer can be typeset or hand-written There.
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
1 Solving problems by searching 171, Class 2 Chapter 3.
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Advanced Artificial Intelligence Lecture 2: Search.
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;
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Solving problems by searching 1. Outline Problem formulation Example problems Basic search algorithms 2.
CSCI 4310 Lecture 2: Search. Search Techniques Search is Fundamental to Many AI Techniques.
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.
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.
Lecture 2: Problem Solving using State Space Representation CS 271: Fall, 2008.
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
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.
Lecture 3 Problem Solving through search Uninformed Search
Lecture 3: Uninformed Search
Russell and Norvig: Chapter 3, Sections 3.4 – 3.6
The Rich/Knight Implementation
The Rich/Knight Implementation
Presentation transcript:

Lecture 7: Uninformed Search Dr John Levine Algorithms and Complexity February 13th 2006

Class admin Lab work starts this week Fri 11-1, L11.01 (Kelvin lab) Work in groups of no more than 6 (self selected) Lab work will be assessed (20% of total mark) Next Monday: lecture/tutorial, 11-1, M408 No lectures and labs in Weeks 11 and 12

The story so far Lecture 1: Why algorithms are so important Lecture 2: Big-Oh notation, a first look at different complexity classes (log, linear, log-linear, quadratic, polynomial, exponential, factorial) Lecture 3: simple search in a list of items is O(n) with unordered data but O(log n) with ordered data, and can be even faster with a good indexing scheme and parallel processors Lecture 4: sorting: random sort O(n!), naïve sort is O(n 2 ), bubblesort is O(n 2 ), quicksort is O(n log n)

The story so far Lecture 5: more on sorting: why comparison sort is O(n log n), doing better than O(n log n) by not doing comparisons (e.g. bucket sort) Lecture 6: harder search: how to represent a problem in terms of states and moves Lecture 7: uninformed search through states using an agenda: depth-first search and breadth-first search Lecture 8: making it smart: informed search using heuristics; how to use heuristic search without losing optimality – the A* algorithm

The story so far Lecture 5: more on sorting: why comparison sort is O(n log n), doing better than O(n log n) by not doing comparisons (e.g. bucket sort) Lecture 6: harder search: how to represent a problem in terms of states and moves Lecture 7: uninformed search through states using an agenda: depth-first search and breadth-first search Lecture 8: making it smart: informed search using heuristics; how to use heuristic search without losing optimality – the A* algorithm

State Space Search Problem solving using state space search consists of the following four steps: 1.Design a representation for states (including the initial state and the goal state) 2.Characterise the operators 3.Build a goal state recogniser 4.Search through the state space somehow by considering (in some or other order) the states reachable from the initial and goal states

Example: Blocks World A “classic” problem in AI planning The aim is to rearrange the blocks using the single robot arm so that the configuration in the goal state is achieved An optimal solution performs the transformation using as few steps as possible Any solution: linear complexity Optimal solution: exponential complexity (NP hard) C A B B A C

Blocks World Representation The blocks world problem can be represented as: States: stacks are lists, states are sets of stacks e.g. initial state = { [a,b],[c] } Transitions between states can be done using a single move operator: move(x,y) picks up object x and puts it on y (which may be the table) { [a,b,c] }  { [b,c],[a] } by applying move(a,table) { [a],[b,c] }  { [a,b,c] } by applying move(a,b)

Blocks World Representation NextStates(State)  list of legal states resulting from a single transition e.g. NextStates({ [a,b],[c] })  { [a],[b],[c] } by applying move(a,table) { [b],[a,c] } by applying move(a,c) { [c,a,b] } by applying move(c,a) Goal(State) returns true if State is identical with the goal state Search the space: start with the start state, explore reachable states, continue until the goal state is found

Search Spaces The search space of a problem is implicit in its formulation –You search the space of your representations We generate the space dynamically during search (including loops, dead ends, branches Operators are move generators We can represent the search space with trees Each node in the tree is a state When we call NextStates(S 0 )  [S 1,S 2,S 3 ], then we say we have expanded S 0

Expanding Nodes in the Search Space S0S0 S3S3 S2S2 S1S1 S8S8 S4S4 S6S6 S5S5 S9S9 S 11 S7S7 S 10 S 12

Depth-First Search S0S0 S3S3 S2S2 S1S1 S8S8 S5S5 S4S4 S9S9 S7S7 S6S6 S 10

Breadth-First Search S0S0 S3S3 S2S2 S1S1 S7S7 S6S6 S5S5 S4S4 S8S8 S 11 S 10 S9S9 S 12 S 13 S 14

Searching Using an Agenda When we expand a node we get multiple new nodes to expand, but we can only expand one at a time We keep track of the nodes still to be expanded using a data structure called an agenda When it is time to expand a new node, we choose the first node from the agenda As new states are discovered, we add them to the agenda somehow We can get different styles of search by altering how the states get added

Depth-First Search To get depth-first search, add the new nodes onto the start of the agenda (treat the agenda as a stack): let Agenda = [S 0 ] while Agenda ≠ [ ] do let Current = First (Agenda) let Agenda = Rest (Agenda) if Goal (Current) then return (“Found it!”) let Next = NextStates (Current) let Agenda = Next + Agenda

Breadth-First Search To get depth-first search, add the new nodes onto the end of the agenda (treat the agenda as a queue): let Agenda = [S 0 ] while Agenda ≠ [ ] do let Current = First (Agenda) let Agenda = Rest (Agenda) if Goal (Current) then return (“Found it!”) let Next = NextStates (Current) let Agenda = Agenda + Next

Properties of Depth-First Search Depth-first can often get to the answer quickly The agenda stays short: O(d) for memory, where d is the depth of the tree The time taken to find the solution is O(d) in the best case and O(b d ) in the worst case (where b is the average branching factor) But if there are loops in the search space, it can get into an infinite loop It isn’t guaranteed give the shortest solution

Properties of Breadth-First Search Breadth-first can often take a long time to get to the answer The agenda can get very big: O(b d ) for memory, giving exponential space consumption Also exponential time complexity: O(b d ) nodes will be expanded But it isn’t bothered by loops in the search space And it always gives the shortest solution Next time: best-first search and A*