Search: Representation and General Search Procedure Jim Little UBC CS 322 – Search 1 September 10, 2014 Textbook § 3.0 – 3.4 1.

Slides:



Advertisements
Similar presentations
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Advertisements

Solving problems by searching
Announcements Course TA: Danny Kumar
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 14, 2012.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) Sept, 11, 2013.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Problem Solving and Search Andrea Danyluk September 9, 2013.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.4) January, 14, 2009.
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
Slide 1 Planning: Representation and Forward Search Jim Little UBC CS 322 October 10, 2014 Textbook §8.1 (Skip )- 8.2)
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
CHAPTER 3 CMPT Blind Search 1 Search and Sequential Action.
Problem Solving and Search in AI Part I Search and Intelligence Search is one of the most powerful approaches to problem solving in AI Search is a universal.
CS 380: Artificial Intelligence Lecture #3 William Regli.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) January, 12, 2009.
Search: Representation and General Search Procedure CPSC 322 – Search 1 January 12, 2011 Textbook § 3.0 –
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
Structures and Strategies for State Space Search
CPSC 322, Lecture 17Slide 1 Planning: Representation and Forward Search Computer Science cpsc322, Lecture 17 (Textbook Chpt 8.1 (Skip )- 8.2) February,
Using Search in Problem Solving
Uninformed Search (cont.)
Solving problems by searching
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Solving problems by searching This Lecture Read Chapters 3.1 to 3.4 Next Lecture Read Chapter 3.5 to 3.7 (Please read lecture topic material before and.
1 Problem Solving and Searching CS 171/271 (Chapter 3) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Computer Science CPSC 322 Lecture 3 AI Applications 1.
Uninformed Search Strategies CPSC 322 – Search 2 January 14, 2011 Textbook §3.5 1.
Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Jim Little UBC CS 322 – CSP 1 September 27, 2014 Textbook §
Computer Science CPSC 322 Lecture 4 Search: Intro (textbook Ch: ) 1.
1 Solving problems by searching This Lecture Chapters 3.1 to 3.4 Next Lecture Chapter 3.5 to 3.7 (Please read lecture topic material before and after each.
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
1 Solving problems by searching 171, Class 2 Chapter 3.
A General Introduction to Artificial Intelligence.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 3 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) Sept, 12, 2012.
Introduction to State Space Search
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
G5AIAI Introduction to AI
1 Solving problems by searching Chapter 3. 2 Outline Problem types Example problems Assumptions in Basic Search State Implementation Tree search Example.
Lecture 2: Problem Solving using State Space Representation CS 271: Fall, 2008.
Computer Science CPSC 322 Lecture 2 Representational Dimensions, Search Intro 1.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Solving problems by searching Chapter 3. Types of agents Reflex agent Consider how the world IS Choose action based on current percept Do not consider.
Solving problems by searching
Computer Science cpsc322, Lecture 4
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
ECE 448 Lecture 4: Search Intro
Problem Solving by Searching
Artificial Intelligence
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Solving problems by searching
Computer Science cpsc322, Lecture 2
Problem Solving and Searching
Artificial Intelligence
Problem Solving and Searching
Solving problems by searching
Solving problems by searching
Solving problems by searching
Solving Problems by Searching
Solving problems by searching
Presentation transcript:

Search: Representation and General Search Procedure Jim Little UBC CS 322 – Search 1 September 10, 2014 Textbook § 3.0 – 3.4 1

Today’s Lecture Search: motivation Simple Search Agent and Examples General Search Procedure 2

Course Map 3 D imen- sions Course Modules Deterministic vs. Stochastic Static vs. Sequential States vs. Features vs. Relations 1. SearchDeterministicStaticStates 2. CSPsDeterministicStaticFeatures 3. PlanningDeterministicSequentialStates or Features 4. LogicDeterministicStaticRelations 5. UncertaintyStochasticStaticFeatures 6. Decision Theory StochasticSequentialFeatures

Search is a powerful tool to know well World champion AI programs: –Checkers 1994 (unbeatable!) –Chess 1997 Can also be used to solve –Constraint satisfaction problems (CSP), course module 2 –Constraint optimization problems Very important in operations research and in industry –Planning, course module 3 –Problems in game AI Infinite Mario Bros: –… 4

Search for Playing Infinite Mario Bros 5

Today’s Lecture Search: motivation Simple Search Agent and Examples General Search Procedure 6

Often we are given a specification of what a solution is, but do not know how we would go about finding one. we have to search for a solution –Enumerate a set of potential partial solutions –Check to see if they are solutions or could lead to one –We can recognize a solution once we see one –“Generate [potential [partial] solution] and test.” Search 7

Simple Deterministic Search Agent Goal-driven deterministic agent with Perfect knowledge of the world –Using state-based world representation –Environment changes only when the agent acts, and in known ways Deterministic actions -Agent perfectly knows: -actions that can be applied in any given state -the state it is going to end up in when an action is applied in a given state Agent is in a start state Agent is given a goal (subset of all states) A sequence of actions taking the agent from the start state to a goal state is a solution (a plan) 8

Definition of a search problem 9 State space: set of all possible states -Not necessarily given explicitly (state space might be infinite) Initial state Set of actions (operators) available to the agent: for each state and each operator, if operator applicable, defines the successor state: the state the agent would end up in Goal state(s): explicit set of states or predicate on states Path Cost (we ignore this for now)

Three examples 1.The delivery robot planning the route it will take in a bldg. to get from one room to another (Text: Section 1.6) 2.Vacuum cleaner world 3.Solving an 8-puzzle 10

Example 1: Delivery Robot (Ch.1.6) 11 Simplified Consider only bold locations Limits in direction of movement (can move only in the direction doors open) Start: o103 Goal: r123

Search Space for the Delivery Robot 12 Simplified Consider only bold locations Limits in direction of movement (can move only in the direction doors open) Start: o103 Goal: r123

Example 2: vacuum world Slide 13 Possible start state Goal state States -Two rooms: r1, r2 -Each room can be either dirty or not -Vacuuming agent can be in either in r1 or r2

Slide 14 Possible start state Goal state Feature-based representation: how many states? Example 2: vacuum world States -Two rooms: r1, r2 -Each room can be either dirty or not -Vacuuming agent can be in either in r1 or r2

Example 2: vacuum world 15 States – one of the eight states in the picture Operators –left, right, suck Possible Goal – no dirt

Search Space 16 Operators – left, right, suck -Successor states in the graph describe the effect of each action applied to a given state Possible Goal – no dirt

Search Space 17 Operators – left, right, suck -Successor states in the graph describe the effect of each action applied to a given state Possible Goal – no dirt

Search Space 18 Operators – left, right, suck -Successor states in the graph describe the effect of each action applied to a given state Possible Goal – no dirt

Search Space 19 Operators – left, right, suck -Successor states in the graph describe the effect of each action applied to a given state Possible Goal – no dirt

Search Space 20 Operators – left, right, suck -Successor states in the graph describe the effect of each action applied to a given state Possible Goal – no dirt

What describes a state? What are the operators? Example 3: 8-Puzzle 21

Search space for 8-puzzle Slide 22

Search space for 8-puzzle Slide 23

24 States: each state specifies which number/blank occupies each of the 9 tiles How many states are there? Operators: the blank spot moves left, right, up down Goal: the configuration with all numbers in the right sequence Example 3: Eight Puzzle

Today’s Lecture Search: motivation Simple Search Agent and Examples General Search Procedure 25

Search: Abstract Definition Slide 26 How to search Start at the start state Evaluate which actions can lead us from states that have been encountered in the search so far to new states Stop when a goal state is encountered To make this more formal, we'll need to review the formal definition of a graph...

A directed graph consists of a set N of nodes (vertices) and a set A of ordered pairs of nodes, called edges (arcs). Node n 2 is a neighbor of n 1 if there is an arc from n 1 to n 2. That is, if  n 1, n 2   A. A path is a sequence of nodes n 0, n 1,..,n k such that  n i-1, n i   A. A cycle is a non-empty path such that the start node is the same as the end node. Search graph Nodes are search states Edges correspond to actions Given a set of start nodes and goal nodes, a solution is a path from a start node to a goal node: a plan of actions. Graphs 27

The forward branching factor of a node is the number of arcs going out of the node The backward branching factor of a node is the number of arcs going into the node If the forward branching factor of a node is b and the graph is a tree, there are b n nodes that are n steps away from a node Branching Factor 28

29 Nodes={ } Edges={...} Solution paths: Graph Specification for the Delivery Robot

30 Nodes={mail, ts, o103, b3, o109,...} Edges={ 〈 ts,mail 〉, 〈 o103,ts 〉, 〈 o103,b3 〉, 〈 o103,o109 〉,...} One of three solution paths: 〈 o103, o109, o119, o123, r123 〉 Graph Specification for the Delivery Robot

Generic search algorithm: given a graph, start nodes, and goal nodes, incrementally explore paths from the start nodes Maintain a frontier of paths from the start node that have been explored. As search proceeds, the frontier expands into the unexplored nodes until a goal node is encountered. The way in which the frontier is expanded defines the search strategy. Graph Searching 31

Problem Solving by Graph Searching 32

Input: a graph a set of start nodes Boolean procedure goal(n) testing if n is a goal node frontier:= { | s is a start node}; While frontier is not empty: select and remove path from frontier; If goal(n k ) Then return ; Else For every neighbor n of n k, add to frontier; end Generic Search Algorithm 33

Lecture Summary 34 Search is a key computational mechanism in many AI agents We will study the basic principles of search on the simple deterministic goal-driven search agent model in state- based world representation Generic search approach: - Define a search space graph - Initialize the frontier with an empty path - incrementally expand frontier until goal state is reached The way in which the frontier is expanded defines the search strategy

Identify real world examples that make use of deterministic goal-driven search agents Assess the size of the search space of a given search problem Implement the generic solution to a search problem Coming up: Uninformed search: read section Learning Goals for today’s class