Agents and Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.5.

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
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
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.
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.
Search Strategies Reading: Russell’s Chapter 3 1.
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.
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
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 for Games Uninformed search Patrick Olivier
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 1 Please pick up a copy of the course syllabus from the front desk.
Artificial Intelligence for Games Depth limited search Patrick Olivier
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
CHAPTER 3 CMPT Blind Search 1 Search and Sequential Action.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
CS 380: Artificial Intelligence Lecture #3 William Regli.
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.
Artificial Intelligence
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2004.
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?
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2002.
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
Leroy Garcia 1.  Artificial Intelligence is the branch of computer science that is concerned with the automation of intelligent behavior (Luger, 2008).
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
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.
PEAS: Medical diagnosis system  Performance measure  Patient health, cost, reputation  Environment  Patients, medical staff, insurers, courts  Actuators.
Agents CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
Vilalta&Eick:Uninformed Search Problem Solving By Searching Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States/Looping.
1 Solving problems by searching 171, Class 2 Chapter 3.
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
Informed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #3.
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
A General Introduction to Artificial Intelligence.
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.
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
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.
Rational Agency CSMC Introduction to Artificial Intelligence January 8, 2007.
Problem Solving as Search. Problem Types Deterministic, fully observable  single-state problem Non-observable  conformant problem Nondeterministic and/or.
Informed Search ECE457 Applied Artificial Intelligence Fall 2007 Lecture #3.
Intelligent Agents Introduction Rationality Nature of the Environment Structure of Agents Summary.
Solving problems by searching A I C h a p t e r 3.
Blind Search Russell and Norvig: Chapter 3, Sections 3.4 – 3.6 CS121 – Winter 2003.
Search Part I Introduction Solutions and Performance Uninformed Search Strategies Avoiding Repeated States Partial Information Summary.
Lecture 2: Problem Solving using State Space Representation CS 271: Fall, 2008.
WEEK 5 LECTURE -A- 23/02/2012 lec 5a CSC 102 by Asma Tabouk Introduction 1 CSC AI Basic Search Strategies.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2008 Lecture #2.
Artificial Intelligence Solving problems by searching.
Lecture 3: Uninformed Search
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
Artificial Intelligence
Solving problems by searching
Artificial Intelligence
Principles of Computing – UFCFA3-30-1
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #2
Presentation transcript:

Agents and Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.5

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 2 Rational Agents Simple reflex agent Model-based agent Goal-based agent Utility-based agent Learning agent Environment Percepts Actions SensorsActuators Agent Program

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 3 Simple Reflex Agent Environment PerceptsActions Sensors Actuators Selected Action Current State If-then Rules

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 4 Simple Reflex Agent Dune II (1992) units were simple reflex agents Harvester rules: IF at refinery AND not empty THEN empty IF at refinery AND empty THEN go harvest IF harvesting AND not full THEN continue harvesting IF harvesting AND full THEN go to refinery IF under attack by infantry THEN squash them

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 5 Model-Based Agent Environment PerceptsActions Sensors Actuators Selected Action Current State Previous perceptions Impact of actions World changes If-then Rules

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 6 Goal-Based Agent Environment PerceptsActions Sensors Actuators Selected Action Current State Goal Previous perceptions Impact of actions World changes State if I do action X

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 7 Utility-Based Agent Environment PerceptsActions Sensors Actuators Selected Action Current State Utility Previous perceptions Impact of actions World changes State if I do action X Happiness in that state

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 8 Learning Agent Environment PerceptsActions Sensors Actuators Problem Generator Learning Element Feedback Performance standard Changes Knowledge Learning Goals Performance Element Critic

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 9 Properties of the Environment Fully observable vs. partially observable See everything vs. hidden information Deterministic vs. stochastic vs. strategic Controlled by agent vs. randomness vs. multiagents Episodic vs. sequential Independent episodes vs. series of events Static vs. dynamic vs. semi-dynamic Waits for agent vs. goes on without agent vs. timer Discrete vs. continuous Finite distinct states vs. uninterrupted sequence Single agent vs. cooperative vs. competitive Alone vs. team-mates vs. opponents

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 10 Crossword Puzzle Fully observable, deterministic, sequential, static, discrete, single-agent Monopoly Fully observable, stochastic, sequential, static, discrete, competitive multi-agent Driving a car Partially observable, stochastic, sequential, dynamic, continuous, cooperative multi-agent Assembly-line inspection robot Fully observable, deterministic, episodic, dynamic, continuous, single-agent Properties of the Environment Fully observable, deterministic, sequential, static, discrete, single-agent Fully observable, stochastic, sequential, static, discrete, competitive multi-agent Fully observable, deterministic, episodic, dynamic, continuous, single-agent Partially observable, stochastic, sequential, dynamic, continuous, cooperative multi-agent

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 11 Well-Defined Problems Initial state Set of actions Move blank left, right, up or down, provided it does not get out of the game Goal test Are the tiles in the “goal state” order? Concept of cost Each action costs 1 Path cost is the sum of actions

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 12 Well-Defined Problems Travelling salesman problem Find the shortest round trip to visit each city exactly once Initial state Set of actions Goal test Concept of cost Any city Move to an unvisited city Am I in the initial city after having visited every city? Action cost: distance between cities Path cost: total distance travelled

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 13 Properties of Search Algos. Completeness Is the algorithm guaranteed to find a goal node, if one exists? Optimality Is the algorithm guaranteed to find the best goal node, i.e. the one with the cheapest path cost? Time complexity How many nodes are generated? Space complexity What’s the maximum number of nodes stored in memory?

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 14 Breath-First Search Explores each node of each level in order Complete if b finite & optimal if cost constant

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 15 Breath-First Search Worst case: goal is last node of depth d Number of generated nodes: b+b²+b³+…+b d +(b d+1 -b) = O(b d+1 ) Space & time complexity: all generated nodes

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 16 Uniform-Cost Search Explore the node with the cheapest path cost first Condition: No zero-cost or negative-cost edges. Minimum cost of an action is є Complete and optimal

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 17 Uniform-Cost Search Worst case: goal has path cost C*, all other actions have minimum cost of є Depth explored before taking action C*:  C*/є  Number of generated nodes: O(b  C*/є  ) Space & time complexity: all generated nodes C* є єє єє єєєє єє єєєє

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 18 Depth-First Search Explores an entire branch first Removes branch from memory after exploration Complete if m finite & not optimal

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 19 Depth-First Search Worst case for space: goal is last node of first branch After that, we start deleting nodes Number of generated nodes: b nodes at each of m levels Space complexity: all generated nodes = O(bm)

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 20 Depth-First Search Worst case for time: goal is last node of last branch Number of nodes generated: b nodes for each node of m levels (entire tree) Time complexity: all generated nodes O(b m )

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 21 Depth-Limited Search Depth-First Search with depth limit l Avoids problems of Depth-First Search when trees are unbounded Depth-First Search is Depth-Limited Search with l =  Complete, if l > d Not optimal

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 22 Depth-Limited Search Worst case for space: goal is last node of first branch After that, we start deleting nodes Number of generated nodes: b nodes at each of l levels Space complexity: all generated nodes = O(bl)

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 23 Depth-Limited Search Worst case for time: goal is last node of last branch Number of nodes generated: b nodes for each node of l levels (entire tree to depth l) Time complexity: all generated nodes O(b l )

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 24 Iterative Deepening Search Depth-First Search with increasing depth limit l Repeat depth-limited search over and over, with l = l + 1 Avoids problems of Depth-First Search when trees are unbounded Avoids problem of Depth-Limited Search when goal depth d > l Complete, if b is finite Optimal, if path cost is equal to depth Guaranteed to return the shallowest goal

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 25 Depth-Limited Search Worst case for space: goal is last node of first branch After that, we start deleting nodes Number of generated nodes: b nodes at each of d levels Space complexity: all generated nodes = O(bd)

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 26 Depth-Limited Search Worst case for time: goal is last node of last branch Number of nodes generated: b nodes for each node of d levels (entire tree to depth d) Time complexity: all generated nodes O(b d )

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 27 Depth Searches Depth-first search Depth-limited search Iterative deepening search Depth limit mld Time complexity O(b m )O(b l )O(b d ) Space complexity O(bm)O(bl)O(bd)

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 28 Summary of Searches Breath- first Uniform Cost Depth -first Depth- limited Iterative deepening CompleteYes 1 No 4 No 5 Yes 1 OptimalYes 2 Yes 3 No Yes 2 TimeO(b d+1 )O(b  C*/є  )O(b m )O(b l )O(b d ) SpaceO(b d+1 )O(b  C*/є  )O(bm)O(bl)O(bd) 1: Assuming b finite (common in trees) 2: Assuming equal action costs 3: Assuming all costs  є 4: Unless m finite (uncommon in trees) 5: Unless l precisely selected

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 29 Summary / Example Going from Arad to Bucharest

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 30 Summary / Example Initial state Being in Arad Action Move to a neighbouring city, if a road exists. Goal test Are we in Bucharest? Cost Move cost = distance between cities Path cost = distance travelled since Arad

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 31 Summary / Example Breath-First Search

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 32 Summary / Example Uniform-Cost Search

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 33 Summary / Example Depth-First Search

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 34 Summary / Example Depth-Limited Search, l = 4

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 35 Summary / Example Iterative Deepening Search

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 36 Repeated States leftdown left right down left up Example: 8-puzzle

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 37 Repeated States Unavoidable in problems where Actions are reversible Multiple paths to the same state are possible Can greatly increase the number of nodes in a tree Or even make a finite tree infinite!

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 38 Repeated States Each state generates a single child twice 26 different states 2 25 leaves (i.e. state Z) Over 67M nodes in the tree A B C D E A BB CCCC DDDDDDDD EEEEEEEEEEEEEEEE

ECE457 Applied Artificial Intelligence R. Khoury (2007)Page 39 Repeated States Maintain a closed list of visited states Closed list (for expanded nodes) vs. open list (for fringe nodes) Detect and discard repeated states upon generation Increases space complexity