Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Lecture 2 of 42 William H. Hsu Department.

Slides:



Advertisements
Similar presentations
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Advertisements

Artificial Intelligence Problem Solving Eriq Muhammad Adams
Problem Solving and Search Andrea Danyluk September 9, 2013.
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
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
Computing & Information Sciences Kansas State University Lecture 4 of 42 CIS 530 / 730 Artificial Intelligence Lecture 4 of 42 William H. Hsu Department.
Computing & Information Sciences Kansas State University Lecture 20 of 42 CIS 530 / 730 Artificial Intelligence Lecture 20 of 42 Introduction to Classical.
CS 380: Artificial Intelligence Lecture #3 William Regli.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
Artificial Intelligence Chapter 3: Solving Problems by Searching
Computing & Information Sciences Kansas State University Lecture 11 of 42 CIS 530 / 730 Artificial Intelligence Lecture 11 of 42 William H. Hsu Department.
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?
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
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.
Solving Problems by Searching
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
Computing & Information Sciences Kansas State University Lecture 3 of 42 CIS 530 / 730 Artificial Intelligence Lecture 3 of 42 William H. Hsu Department.
Computing & Information Sciences Kansas State University Lecture 1 of 42 CIS 530 / 730 Artificial Intelligence Lecture 1 of 42 William H. Hsu Department.
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 Problem Solving and Searching CS 171/271 (Chapter 3) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Problem Solving and Search Andrea Danyluk September 11, 2013.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 3 Wednesday 27 August.
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department Read Russell & Norvig Sections (Also read Chapters 1 and 2 if.
Computing & Information Sciences Kansas State University Wednesday, 23 Aug 2006CIS 490 / 730: Artificial Intelligence Lecture 1 of 42 Wednesday, 23 August.
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.
Computing & Information Sciences Kansas State University Monday, 28 Aug 2006CIS 490 / 730: Artificial Intelligence Lecture 3 of 42 Monday, 28 August 2006.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 9 of 14 Friday, 10 September.
Computing & Information Sciences Kansas State University Wednesday, 15 Oct 2008CIS 530 / 730: Artificial Intelligence Lecture 20 of 42 Wednesday, 15 October.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 2 Tuesday, August 29,
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.
Computing & Information Sciences Kansas State University Lecture 22 of 42 CIS 530 / 730 Artificial Intelligence Lecture 22 of 42 Planning: Sensorless and.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 2 of 41 Monday, 23 August.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Lecture 2 of 42 Problem Solving by Search
Computing & Information Sciences Kansas State University Lecture 13 of 42 CIS 530 / 730 Artificial Intelligence Lecture 13 of 42 William H. Hsu Department.
Lecture 3: Uninformed Search
Computing & Information Sciences Kansas State University Wednesday, 30 Aug 2006CIS 490 / 730: Artificial Intelligence Lecture 4 of 42 Wednesday, 30 August.
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 9 of 42 Wednesday, 14.
Lecture 3: 18/4/1435 Searching for solutions. Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 3 of 41 Wednesday 25.
For Friday Read chapter 4, sections 1 and 2 Homework –Chapter 3, exercise 7 –May be done in groups.
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).
CSCI 4310 Lecture 2: Search. Search Techniques Search is Fundamental to Many AI Techniques.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Computing & Information Sciences Kansas State University Monday, 23 Oct 2006CIS 490 / 730: Artificial Intelligence Lecture 25 of 42 Monday, 23 October.
Computing & Information Sciences Kansas State University Friday, 20 Oct 2006CIS 490 / 730: Artificial Intelligence Lecture 24 of 42 Friday, 20 October.
Computing & Information Sciences Kansas State University Lecture 12 of 42 CIS 530 / 730 Artificial Intelligence Lecture 12 of 42 William H. Hsu Department.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 5 of 41 Wednesday 03.
Computing & Information Sciences Kansas State University Friday, 08 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 7 of 42 Friday, 08 September.
Solving problems by searching A I C h a p t e r 3.
Computing & Information Sciences Kansas State University Friday, 05 Sep 2008CIS 490 / 730: Artificial Intelligence Lecture 4 of 42 Friday, 05 September.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
Computing & Information Sciences Kansas State University Monday, 09 Oct 2006CIS 490 / 730: Artificial Intelligence Lecture 19 of 42 Monday, 09 October.
Blind Search Russell and Norvig: Chapter 3, Sections 3.4 – 3.6 CS121 – Winter 2003.
Search I Tuomas Sandholm Read Russell & Norvig Sections (Also read Chapters 1 and 2 if you haven’t already.) Next time we’ll cover topics related.
Computing & Information Sciences Kansas State University Wednesday, 04 Oct 2006CIS 490 / 730: Artificial Intelligence Lecture 17 of 42 Wednesday, 04 October.
Computing & Information Sciences Kansas State University Friday, 13 Oct 2006CIS 490 / 730: Artificial Intelligence Lecture 21 of 42 Friday, 13 October.
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.
Introduction to Artificial Intelligence
Problem Solving by Searching
Searching for Solutions
Presentation transcript:

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Lecture 2 of 42 William H. Hsu Department of Computing and Information Sciences, KSU KSOL course page: Course web site: Instructor home page: Reading for Next Class: Machine Problem 1 (posted Wednesday) Sections 2.3 – 2.5, p. 39 – 56, Russell & Norvig 2 nd edition Section 3.1, p. 59 – 62, Russell & Norvig 2 nd edition Problem Solving by Search Discussion: Term Projects 2 of 5

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Search Topics (Review) Next Monday - Wednesday: Sections , Russell and Norvig Thinking Exercises (Discussion in Next Class): 3.3 (a, b, e), 3.9 Solving Problems by Searching  Problem solving agents: design, specification, implementation  Specification: problem, solution, constraints  Measuring performance Formulating Problems as (State Space) Search Example Search Problems  Toy problems: 8-puzzle, N-queens, cryptarithmetic, toy robot worlds  Real-world problems: layout, scheduling Data Structures Used in Search Next Monday: Uninformed Search Strategies  State space search handout (Winston)  Search handouts (Ginsberg, Rich and Knight)

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Term Project Topics (review) 1. Game-playing Expert System  “Borg” for Angband computer role-playing game (CRPG)  Trading Agent Competition (TAC)  Supply Chain Management (TAC-SCM) scenario  Machine Learning for Bioinformatics  Evidence ontology for genomics or proteomics 

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Agent Framework: Simple Reflex Agents [1] Agent Sensors Effectors Condition-Action Rules What action I should do now Environment

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Agent Framework: Simple Reflex Agents [2] Implementation and Properties  Instantiation of generic skeleton agent: Figs. 2.9 & 2.10, p. 47 R&N 2 e  function SimpleReflexAgent (percept) returns action  static: rules, set of condition-action rules  state  Interpret-Input (percept)  rule  Rule-Match (state, rules)  action  Rule-Action {rule}  return action Advantages  Selection of best action based only on rules, current state of world  Simple, very efficient  Sometimes robust Limitations and Disadvantages  No memory (doesn’t keep track of world)  Limits range of applicability

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Agent Frameworks: (Reflex) Agents with State [1] Agent Sensors Effectors Condition-Action Rules What action I should do now Environment State How world evolves What my actions do What world is like now

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Agent Frameworks: (Reflex) Agents with State [2] Implementation and Properties  Instantiation of skeleton agent: Figures 2.11 & 2.12, p. 49 R&N 2 e  function ReflexAgentWithState (percept) returns action  static: state description; rules, set of condition-action rules  state  Update-State (state, percept)  rule  Rule-Match (state, rules)  action  Rule-Action {rule}  return action Advantages  Selection of best action based only on rules, current state of world  Able to reason over past states of world  Still efficient, somewhat more robust Limitations and Disadvantages  No way to express goals and preferences relative to goals  Still limited range of applicability

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Agent Frameworks: Goal-Based Agents [1] Agent Sensors Effectors Goals What action I should do now Environment State How world evolves What my actions do What world is like now What it will be like if I do action A

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Agent Frameworks: Goal-Based Agents [2] Implementation and Properties  Instantiation of skeleton agent: Figure 2.13, p. 50 R&N 2 e  Functional description  Chapter R&N 2e: classical planning  Requires more formal specification Advantages  Able to reason over goal, intermediate, and initial states  Basis: automated reasoning  One implementation: theorem proving (first-order logic)  Powerful representation language and inference mechanism Limitations and Disadvantages  May be expensive: can’t feasibly solve many general problems  No way to express preferences

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Agent Frameworks: Utility-Based Agents [1] Agent Sensors Effectors Utility What action I should do now Environment State How world evolves What my actions do What world is like now What it will be like if I do A How happy will I be

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Agent Frameworks: Utility-Based Agents [2] Implementation and Properties  Instantiation of skeleton agent: Figure 2.14, p. 53 R&N 2 e  Functional description  Chapter R&N 2e: making decisions  Requires representation of decision space Advantages  Able to acccount for uncertainty and agent preferences  Models value of goals: costs vs. benefits  Essential in economics, business; useful in many domains Limitations and Disadvantages  How to get utilities?  How to reason under uncertainty? (Examples?)

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Problem-Solving Agents [1]: Goals Justification  Rational IA: act to reach environment that maximizes performance measure  Need to formalize, operationalize this definition Practical Issues  Hard to find appropriate sequence of states  Difficult to translate into IA design Goals  Translating agent specification to formal design  Chapter 2, R&N: decision loop simplifies task  First step in problem solving: formulation of goal(s)  Chapters 3-4, R&N: state space search  Goal  {world states | goal test is satisfied}  Graph planning  Chapter 5: constraints – domain, rules, moves  Chapter 6: games – evaluation function

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Problem-Solving Agents [2]: Definitions Problem Formulation  Given  Initial state  Desired goal  Specification of actions  Find  Achievable sequence of states (actions)  Represents mapping from initial to goal state Search  Actions  Cause transitions between world states  e.g., applying effectors  Typically specified in terms of finding sequence of states (operators)

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Problem-Solving Agents [3]: Requirements and Specification Input  Informal objectives  Initial, intermediate, goal states  Actions  Leads to design requirements for state space search problem Output  Path from initial to goal state  Leads to design requirements for state space search problem Logical Requirements  States: representation of state of world (example: starting city, graph representation of Romanian map)  Operators: descriptors of possible actions (example: moving to adjacent city)  Goal test: state  boolean (example: at destination city?)  Path cost: based on search, action costs (example: number of edges traversed)

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Problem-Solving Agents [4]: Objectives Operational Requirements  Search algorithm to find path  Objective criterion: minimum cost (this and next 3 lectures) Environment  Agent can search in environment according to specifications  May have full state and action descriptors  Sometimes not!

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Problem-Solving Agents [5]: Implementation function Simple-Problem-Solving-Agent (p: percept) returns a: action  inputs: p, percept  static:s, action sequence (initially empty) state, description of current world state g, goal (initially null) problem, problem formulation  state  Update-State (state, p)  if s.Is-Empty() then  g  Formulate-Goal (state)// focus of today’s class  problem  Formulate-Problem (state, g)// today  s  Search (problem)// next week  action  Recommendation (s, state)  s  Remainder (s, state)// discussion: meaning?  return (action) Ch. 3-4: Implementation of Simple-Problem-Solving-Agent

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Example: TAC-SCM Agent [1] Project Topic 2 of 5 Trading Agent Competition Supply Chain Management Scenario © 2002 Swedish Institute of Computer Science

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Trading Agent Competition  Swedish Institute of Computer Science (SICS) Page  Supply chain management (SCM) scenario Problem Specification  Study existing TAC-SCM agents  Develop a scheduling and utility-based reasoning system  Use SICS interface to develop a new TAC agent  Play it against other agents using competition server Example: TAC-SCM Agent [2] Problem Specification

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Formulating Problems [1]: Single-State Single-State Problems  Goal state is reachable in one action (one move)  World is fully accessible  Example: vacuum world (Figure 3.2, R&N) – simple robot world Significance  Initial step analysis  “Base case” for problem solving by regression  General Problem Solver  Means-ends analysis

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Formulating Problems [2]: Multi-State Multi-State Problems  Goal state may not be reachable in one action  Assume limited access  effects of actions known  may or may not have sensors Significance  Need to reason over states that agent can get to  May be able to guarantee reachability of goal state anyway Determining State Space Formulation  State space – single-state problem  State set space – multi-state problems

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence General Search [1]: Overview Generating Action Sequences  Initialization: start (initial) state  Test for goal condition  Membership in goal state set (explicitly enumerated)  Constraints met (implicit)  Applying operators (when goal state not achieved)  Implementation: generate new set of successor (child) states  Conceptual process: expand state  Result: multiple branches (e.g., Figure 3.8 R&N) Intuitive Idea  Select one option  Ordering (prioritizing / scheduling) others for later consideration  Iteration: choose, test, expand  Termination: solution is found or no states remain to be expanded Search Strategy: Selection of State to Be Expanded

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence General Search [2]: Algorithm function General-Search (problem, strategy) returns a solution or failure  initialize search tree using initial state of problem  loop do  if there are no candidates for expansion then return failure  choose leaf node for expansion according to strategy  If node contains a goal state then return corresponding solution  else expand node and add resulting nodes to search tree  end Note: Downward Function Argument (Funarg) strategy Implementation of General-Search  Rest of Chapter 3, Chapter 4, R&N  See also:  Ginsberg (handout in CIS library today)  Rich and Knight  Nilsson: Principles of Artificial Intelligence

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Search Strategies: Criteria Completeness  Is strategy guaranteed to find solution when one exists?  Typical requirements/assumptions for guaranteed solution  Finite depth solution  Finite branch factor  Minimum unit cost (if paths can be infinite) – discussion: why? Time Complexity  How long does it take to find solution in worst case?  Asymptotic analysis Space Complexity  How much memory does it take to perform search in worst case?  Analysis based on data structure used to maintain frontier Optimality  Finds highest-quality solution when more than one exists?  Quality: defined in terms of node depth, path cost

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Uninformed (Blind) Search Strategies Breadth-First Search (BFS)  Basic algorithm: breadth-first traversal of search tree  Intuitive idea: expand whole frontier first  Advantages: finds optimal (minimum-depth) solution for finite search spaces  Disadvantages: intractable (exponential complexity, high constants) Depth-First Search (DFS)  Basic algorithm: depth-first traversal of search tree  Intuitive idea: expand one path first and backtrack  Advantages: narrow frontier  Disadvantages: lot of backtracking in worst case; suboptimal and incomplete Search Issues  Criteria: completeness (convergence); optimality; time, space complexity  “Blind”  No information about number of steps or path cost from state to goal  i.e., no path cost estimator function (heuristic) Uniform-Cost, Depth-Limited, Iterative Deepening, Bidirectional

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Breadth-First Search: Algorithm function Breadth-First-Search (problem) returns a solution or failure  return General-Search (problem, Enqueue-At-End) function Enqueue-At-End (e: Element-Set) returns void  // Queue: priority queue data structure  while not (e.Is-Empty())  if not queue.Is-Empty() then queue.last.next  e.head();  queue.last  e.head();  e.Pop-Element();  return Implementation Details  Recall: Enqueue-At-End downward funarg for Insert argument of General- Search  Methods of Queue (priority queue)  Make-Queue (Element-Set) – constructor  Is-Empty() – boolean-valued method  Remove-Front() – element-valued method  Insert(Element-Set) – procedure, aka Queuing-Fn

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Depth-First Search: Algorithm function Depth-First-Search (problem) returns a solution or failure  return General-Search (problem, Enqueue-At-Front) function Enqueue-At-Front (e: Element-Set) returns void  // Queue: priority queue data structure  while not (e.Is-Empty())  temp  queue.first;  queue.first  e.head();  queue.first.next  temp;  e.Pop-Element();  return Implementation Details  Enqueue-At-Front downward funarg for Insert argument of General-Search  Otherwise similar in implementation to BFS  Exercise (easy)  Recursive implementation  See Cormen, Leiserson, Rivest, & Stein (2002)

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Terminology Agent Types  Reflex aka “reactive”  Reflex with state (memory-based)  Goal-based aka “deliberative”  Preference-based aka “utility-based” Decision Cycle Problem Solving Frameworks  Regression, Means-ends analysis (MEA)  State space search, PEAS  Representations (later)  Plans  Constraint satisfaction problems  Policies and decision processes  Situation calculus

Computing & Information Sciences Kansas State University Lecture 2 of 42 CIS 530 / 730 Artificial Intelligence Summary Points The Basic Decision Cycle for Intelligent Agents Agent Types  Reflex aka “reactive”  Reflex with state (memory-based)  Goal-based aka “deliberative”  Preference-based aka “utility-based” Problem Solving Frameworks  Regression-based problem solving  Means-ends analysis (MEA)  PEAS framework  Performance  Environment  Actuators  Sensors  State space formulation