States and Search Core of intelligent behaviour. D Goforth - COSC 4117, fall 20062 The simple problem solver Restricted form of general agent: Figure.

Slides:



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

Additional Topics ARTIFICIAL INTELLIGENCE
Review: Search problem formulation
Announcements Course TA: Danny Kumar
Uninformed search strategies
Artificial Intelligence Solving problems by searching
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.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
January 26, 2003AI: Chapter 3: Solving Problems by Searching 1 Artificial Intelligence Chapter 3: Solving Problems by Searching Michael Scherger Department.
Artificial Intelligence Problem Solving Eriq Muhammad Adams
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.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
1 Chapter 3 Solving Problems by Searching. 2 Outline Problem-solving agentsProblem-solving agents Problem typesProblem types Problem formulationProblem.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
PSU CS 370 – Artificial Intelligence Dr. Mohamed Tounsi Artificial Intelligence 3. Solving Problems By Searching.
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.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
Artificial Intelligence (CS 461D)
UNINFORMED SEARCH Problem - solving agents Example : Romania  On holiday in Romania ; currently in Arad.  Flight leaves tomorrow from Bucharest.
Agents the AI metaphor. D Goforth - COSC 4117, fall The agent model  agents include all aspects of AI in one object-oriented organizing model:
Search by partial solutions. Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Hill climbing Random restart General.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
CS 380: Artificial Intelligence Lecture #3 William Regli.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
UnInformed Search What to do when you don’t know anything.
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?
Blind Search-Part 2 Ref: Chapter 2. Search Trees The search for a solution can be described by a tree - each node represents one state. The path from.
Using Search in Problem Solving
Problem solving in state spaces State representation and the problem solving agent algorithm.
Solving problems by searching
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
3.0 State Space Representation of Problems 3.1 Graphs 3.2 Formulating Search Problems 3.3 The 8-Puzzle as an example 3.4 State Space Representation using.
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.
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.
CS 440 / ECE 448 Introduction to Artificial Intelligence Spring 2010 Lecture #3 Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam.
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.
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
COMP261 Lecture 6 Dijkstra’s Algorithm. Connectedness Is this graph connected or not? A Z FF C M N B Y BB S P DDGG AA R F G J L EE CC Q O V D T H W E.
Lecture 3: Uninformed Search
1 Solving problems by searching 171, Class 2 Chapter 3.
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
A General Introduction to Artificial Intelligence.
Agents and Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.5.
Supplemental slides for CSE 327 Prof. Jeff Heflin
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.
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.
Ch. 3 – Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Solving problems by searching A I C h a p t e r 3.
Other partial solution strategies. Partial solution algorithms greedy  branch and bound  A*  divide and conquer  dynamic programming.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
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.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Problem Solving by Searching
Problem Solving as Search
Artificial Intelligence
Russell and Norvig: Chapter 3, Sections 3.4 – 3.6
Solving problems by searching
Problem Solving and Searching
What to do when you don’t know anything know nothing
Searching for Solutions
Artificial Intelligence
Problem Solving and Searching
Supplemental slides for CSE 327 Prof. Jeff Heflin
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #2
Presentation transcript:

States and Search Core of intelligent behaviour

D Goforth - COSC 4117, fall The simple problem solver Restricted form of general agent: Figure 3.1, p.61 function Simple-Problem-Solving-Agent( percept) returns action seq an action sequence, initially empty state some description of the current world state goal a goal, initially null problem a problem formulation state = Update-State(state, percept) if seq is empty ( ie – do search first time only) goal = Formulate-Goal(state) if (state==goal) return nil problem = Formulate-Problem(state, goal) (performance) seq = Search(problem) action First(seq) seq = Rest(seq) return action Creating a solution sequence by graph search

D Goforth - COSC 4117, fall The simple problem solver  works by simulating the problem in internal representation and trying plans till a good one is discovered  works in deterministic, static, single agent environments plan is made once and never changed  works if plan is perfect – actions do what plan assumes  no corrections to path are required  works efficiently if space is not too large

D Goforth - COSC 4117, fall Representation of Environment – abstractions of real world  states and state space – only relevant information in state representation  actions - successor function costs and path cost (eg touring problem TSP)  start state  goal state or criterion function of state(s)

D Goforth - COSC 4117, fall Representation of Environment – state space efficiency Faster processing  minimization of number of states  minimization of degree of branching of successor function (actions) Smaller memory allocation  large state spaces are generated/explored, not stored/traversed

D Goforth - COSC 4117, fall Searching state space The fundamental method for creating a plan Is SEARCH

D Goforth - COSC 4117, fall Searching – graph traversals – TREE-SEARCH – p. 70  start node and all possible actions, then pick another node...:

D Goforth - COSC 4117, fall Design of a search space – the spanning tree over a state space  Node in search space current state reference to parent node on path action from parent to node path cost from start node (may be just path length)

D Goforth - COSC 4117, fall Problem-solving agent – example LLLL RRRRLRRR RLLL RRLL RLLRRLRL LRLL LLLRLLRL RRRL RLRRRRLR LRRL LLRRLRLR Node in search space LLRL 2 F State Parent link Action Path length RRRL 3 Ff

D Goforth - COSC 4117, fall Problem-solving agent – example LLLL RRRRLRRR RLLL RRLL RLLRRLRL LRLL LLLRLLRL RRRL RLRRRRLR LRRL LLRRLRLR SPANNING TREE Note why some state space edges are not traversed in the spanning tree

D Goforth - COSC 4117, fall General search algorithm – p.72  EXAMPLE: breadth first search in a binary tree start state (visitedList) fringe (openList) current state

general search algorithm -variation startState initial state of environment adjacentNode, node nodes of search tree: contain state, parent, action, path cost openList collection of Nodes generated, not tested yet (fringe) visitedList collection of Nodes already tested and not the goal action[n] list of actions that can be taken by agent goalStateFound(state) returns boolean evaluate a state as goal precondition(state, action) returns boolean test a state for action apply(node,action) returns node apply action to get next state node makeSequence(node) returns sequence of actions generate plan as sequence of actions

general search algorithm -variation algorithm search (startState, goalStateFound()) returns action sequence openList = new NodeCollection(); // stack or queue or... visitedList = new NodeCollection(); node = new Node(startState, null, null, 0 0); openList.insert(node) while ( notEmpty(openList) ) node = openList.get() if (goalStateFound (node.state) ) // successful search return makeSequence(node) for k = 0..n-1 if (precondition(node.state, action[k])==TRUE) adjacentNode = apply(nextNode,action[k]) if NOT(adjacentNode in openList OR visitedList) openList.insert(adjacentNode) visitedList.insert(node) return null

D Goforth - COSC 4117, fall algorithms of general search  breadth first  depth first  iterative deepening search  uniform cost search

D Goforth - COSC 4117, fall variations on search algorithm 1.breadth first search openList is a queue 2.depth first search openList is a stack (recursive depth first is equivalent) tradeoffs for bfs: shortest path vs resources required RRRL 3 Ff State Parent link Action Path length

D Goforth - COSC 4117, fall comparison of bfs and dfs  nodes on openList while search is at level k: bfsO(n k )n is branching factor dfsO(nk) recursive dfsO(k)  quality of solution path bfs always finds path with fewest actions dfs may find a longer path before a shorter one

D Goforth - COSC 4117, fall depth-limited dfs  use depth first search with limited path length eg dfs(startNode,goalStateFound(),3) uses dfs but only goes to level 3

D Goforth - COSC 4117, fall iterated (depth-limited) dfs  variation on dfs to get best of both small openList of dfs finds path with fewest actions like bfs  repeated searching is not a big problem!!!

D Goforth - COSC 4117, fall iterative deepening dfs  search algorithm puts depth-limited dfs in a loop: algorithm search (startState, goalStateFound()) Node node = null depth = 0 while (node == null) depth++ node = dfs(startState,goalStateFound(),depth) return node

D Goforth - COSC 4117, fall uniform cost search  find best path when there is an action cost for each edge: a path of more edges may be better than a path of fewer edges: (5 edges) is preferred to (2 edges) variation on bfs openList is a priority queue ordered on path cost from start state

D Goforth - COSC 4117, fall uniform cost search - example openList is a priority queue ordered on path cost from start state visited. open C(2),B(4),D(8) current A(0) A BCD 4 2 8

visited. open C(2),B(4),D(8) current A(0) A BCD visited A(0) open B(4),E(5),D(8) current C(2) A BCD E 3 visited A(0),C(2), B(4) open G(6),F(7),D(8), H(10) current E(5) A BCD E 3 FG 3 5 visited A(0),C(2) open E(5),F(7),D(8),G(9) current B(4) A BCD E 3 FG 3 5 H

D Goforth - COSC 4117, fall variations of the general algorithm  openList structure  time of testing for goal state

D Goforth - COSC 4117, fall (some) problems that complicate search  perceptions are incomplete representation of state  dynamic environment – path of actions is not only cause of state change (eg games)

D Goforth - COSC 4117, fall what kind of problem-reprise  fully / partly observable - is state known?  deterministic / stochastic - effect of action uncertain?  sequential / episodic - plan required/useful?  static / dynamic - state changes between action & perception and/or between perception & action  discrete / continuous - concurrent or sequential actions on state  single- / multi-agent dynamic environment; possible communication, distributed AI