Computer Science CPSC 322 Le Lecture ture 3 AI AI ap appl plicatio ications, ns, Un Uninf nform ormed ed Se Sear arch h St Strat ategies egies (Ch Ch 3. 3.1-3.4) 3.4) 1
Today’s Lecture • Discussion on AI applications • Search • Search Spaces • Generic Search Algorithm • Uninformed Search (time permitting) • Depth first 2
AI a I agents ents in in th this is course rse Would like most general agents possible, but in this course we need to restrict ourselves to: • Flat representations (vs. hierarchical) • Knowledge given (vs. knowledge learned) • Goals and simple preferences (vs. complex preferences) • Single-agent scenarios (vs. multi-agent scenarios) We will look at • Deterministic and stochastic domains • Static and Sequential problems And see examples of representations using • Explicit state or features or relations 3
AI Application • Today, we will look at some AI applications that you have found for your assignment 0 • You are asked to described them in terms of the elements above and some more 4
• What does it do • Goals • prior knowledge needed • past experiences that it does (or could) learn from • Observations needed • Actions performed • AI technologies used • Why is it intelligent? 5 • Evaluation?
Today’s Lecture • Discussion on AI applications • Search • Search Spaces • Generic Search Algorithm • Uninformed Search • Depth first 6
Represent presentational ational Dim imensions ensions Representatio esentation En Environmen nment Reasoning Stochastic Deterministic Technique Problem lem Type Arc Consistency Constraint Variab riables les + + Satisfaction Search Cons nstra train ints ts Static atic Baye yesia sian Nets Query Logic gics Variable Search Elimination Decis cision ion Nets Sequential ntial ST STRIPS Variable Planning Elimination Search Markov kov Processe esses Value Iteration 7
Recap cap • Search is a key computational mechanism in many AI agents • We study the basic principles of search via a simple deterministic search agent model • Agent is in a start art state ate • Agent is given a goal goal (subset of possible states) • Environment changes only when the agent acts • Agent perfectly knows: • actions ns that can be applied in any given state • the state ate it is going to end up in when an action is applied in a given state • The sequence of actions (and appropriate ordering) taking the agent from the start state to a goal state is the solut lution ion Slide 8
Defini finition tion of a f a se search arch problem oblem • Init itial ial state(s) ate(s) • Set of actions ions (operators) available to the agent • An action ion funct ction ion that, given a state and an action, returns a new state • Goal l state(s) ate(s) • Search ch space: set of states that will be searched for a path from initial state to goal, given the available actions • states tes ar are node nodes s and actions ions are e lin links between them. • Not necessarily given explicitly (state space might be infinite) • Path h Co Cost t (we ignore this for now) 9
Search Space for the Delivery Robot 10
Today’s Lecture • Discussion on AI applications • Search • Search Spaces • Generic Search Algorithm • Uninformed Search • Depth first 11
Example: mple: vacuum uum world rld States • Two rooms: r1, r2 • Each room can be • either dirty or not Vacuuming agent can • be in either in r1 or r2 Possible goal state Possible start state Slide 12
Example: mple: vacuum uum world rld States • Feature-based representation: - Features? Two rooms: r1, r2 • - how many states? Each room can be • either dirty or not Vacuuming agent can • be in either in r1 or r2 Possible goal state Possible start state Slide 13
Example: mple: vacuum uum world rld States • Feature-based representation: - Features? Two rooms: r1, r2 • - how many states? Each room can be • either dirty or not Vacuuming agent can • be in either in r1 or r2 Possible goal state Possible start state Slide 14
….. Suppose we have the same problem with k rooms. The number of states is…. A. k 3 B. k * 2k C. k * 2 k D. 2 * k k 16
….. Suppose we have the same problem with k rooms. The number of states is…. A. k 3 B. k * 2k C. k * 2 k D. 2 * k k Loc() feature can take k possible values For each room i, dirty_room_i can take 2 values, and there are k of these features 17
Search Space • Actions – left, right, suck Successor states in the graph describe the effect of each - action applied to a given state • Possible Goal – no dirt 18
Search Space • Actions – left, right, suck Successor states in the graph describe the effect of each - action applied to a given state • Possible Goal – no dirt 19
Search Space • Actions – left, right, suck Successor states in the graph describe the effect of each - action applied to a given state • Possible Goal – no dirt 20
Search Space • Actions – left, right, suck Successor states in the graph describe the effect of each - action applied to a given state • Possible Goal – no dirt 21
Search Space • Actions – left, right, suck Successor states in the graph describe the effect of each - action applied to a given state • Possible Goal – no dirt 22
Eight Puzzle 23
Eight Puzzle States : each state specifies which number/blank occupies each of the 9 tiles HOW MANY STATES ? Actions : Goal : 24
Eight Puzzle States : each state specifies which number/blank occupies each of the 9 tiles HOW MANY STATES ? 9! Actions : Goal : 25
Eight Puzzle States : each state specifies which number/blank occupies each of the 9 tiles HOW MANY STATES ? 9! Actions : blank moves left, right, up down Goal : configuration with numbers in right sequence 26
Search arch space ce fo for 8puzzle uzzle Slide 27
Search arch space ce fo for 8puzzle uzzle Slide 28
How w can we fi find a so soluti lution? on? • How can we find a sequence of actions and their appropriate ordering that lead to the goal? • Need smart ways to search the space ce gra raph Slide 29
Today’s Lecture • Discussion on AI applications • Search • Search Spaces • Generic Search Algorithm • Uninformed Search (time permitting) • Depth first 30
Search: arch: Abstract stract Defini finition tion How to search • Start at the start state • Evaluate the effect of taking different actions starting from states that have been encountered in the search so far • Stop when a goal state is encountered To make this more formal, we'll use the definition of a graph that you were asked to review for today Slide 31
Grap Gr aphs hs • 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. • A directed acyclic graph (DAG) is a graph with no cycles • Given a set of start nodes and goal nodes, a solution is a path from a start node to a goal node 32
Grap aph h spe pecifica ificati tion on fo for th the e Del elive very ry Rob obot ot N={mail, ts, o103, b3, o109,...} A={ 〈 ts,mail 〉 , 〈 o103,ts 〉 , 〈 o103,b3 〉 , 〈 o103,o109 〉 , ...} One of several solution paths: 〈 o103, o109, o119, o123, r123 〉 33
Gr Graph ph Searching arching Ends of paths on frontier • Generic search algorithm: given a graph, start nodes, and goal nodes, incrementally explore paths from the start nodes. Maintain a frontier of paths that have been explored from the start node 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. If there is only one thing you want to remember about search, this is it. 34
Probl oblem em Solvi lving ng by Gr Graph aph Searchi arching ng Ends of paths on frontier 35
Gene Ge neric ic Se Sear arch h Al Algo gorith ithm Input ut: - a graph Ends of paths on - a set of start nodes frontier - Boolean procedure goal(n) testing if n is a goal node frontier:= [<s>: s is a start node]; While ile frontier is not empty: select lect and remove emove path <n o ,…., n k > from frontier; If goal( If al(n k ) return urn <n o ,…., n k >; For r every ery neighbor n of n k, add <n o ,…., n k , n> to frontier; add end end • The goal function defines what is a solution. 36 • Which path is selected from the frontier defines the search strategy.
Recommend
More recommend