Artificial Intelligence Problem Solving Eriq Muhammad Adams

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
January 26, 2003AI: Chapter 3: Solving Problems by Searching 1 Artificial Intelligence Chapter 3: Solving Problems by Searching Michael Scherger Department.
Blind Search by Prof. Jean-Claude Latombe
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.
1 Blind (Uninformed) Search (Where we systematically explore alternatives) R&N: Chap. 3, Sect. 3.3–5.
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.
Search Search plays a key role in many parts of AI. These algorithms provide the conceptual backbone of almost every approach to the systematic exploration.
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.
EIE426-AICV 1 Blind and Informed Search Methods Filename: eie426-search-methods-0809.ppt.
Artificial Intelligence for Games Depth limited search Patrick Olivier
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.
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 Chapter 3: Solving Problems by Searching
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.
1 Midterm Review cmsc421 Fall Outline Review the material covered by the midterm Questions?
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.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Solving Problems by Searching CPS Outline Problem-solving agents Example problems Basic search algorithms.
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.
1 Solving Problems by Searching (Blindly) R&N: Chap. 3 (many of these slides borrowed from Stanford’s AI Class)
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Prof. Carla P. Gomes Module: Search I (Reading R&N: Chapter.
1 Solving problems by searching 171, Class 2 Chapter 3.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
A General Introduction to Artificial Intelligence.
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.
Solving problems by searching 1. Outline Problem formulation Example problems Basic search algorithms 2.
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.
1 search CS 331/531 Dr M M Awais REPRESENTATION METHODS Represent the information: Animals are generally divided into birds and mammals. Birds are further.
Pengantar Kecerdasan Buatan
Problem Solving by Searching
Implementation: General Tree Search
Solving problems by searching A I C h a p t e r 3.
1 CS B551: Elements of Artificial Intelligence Instructor: Kris Hauser
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.
Search Problems Russell and Norvig: Chapter 3, Sections 3.1 – 3.3 CS121 – Winter 2003.
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.
Artificial Intelligence Solving problems by searching.
Lecture 3: Uninformed Search
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
Artificial Intelligence Solving problems by searching
Artificial Intelligence
Russell and Norvig: Chapter 3, Sections 3.4 – 3.6
Solving problems by searching
Artificial Intelligence
Russell and Norvig: Chapter 3, Sections 3.1 – 3.3
Solving problems by searching
Solving problems by searching
Solving problems by searching
Solving problems by searching
Presentation transcript:

Artificial Intelligence Problem Solving Eriq Muhammad Adams

Outline Problem Solving Agents Problem Formulation Example Problems Basic Search Algorithms

Problem-Solving Agent environment agent ? sensors actuators

Problem-Solving Agent environment agent ? sensors actuators Formulate Goal Formulate Problem States Actions Find Solution

14 Jan 2004CS Blind Search5 Problem-solving agents

Example: Route finding

Holiday Planning On holiday in Romania; Currently in Arad. Flight leaves tomorrow from Bucharest. Formulate Goal: Be in Bucharest Formulate Problem: States: various cities Actions: drive between cities Find solution: Sequence of cities: Arad, Sibiu, Fagaras, Bucharest

Problem Formulation GoalStart States Actions Solution

Vacuum World

Search Problem State space ◦ each state is an abstract representation of the environment ◦ the state space is discrete Initial state Successor function Goal test Path cost

Search Problem State space Initial state: ◦ usually the current state ◦ sometimes one or several hypothetical states (“what if …”) Successor function Goal test Path cost

Search Problem State space Initial state Successor function: ◦ [state  subset of states] ◦ an abstract representation of the possible actions Goal test Path cost

Search Problem State space Initial state Successor function Goal test: ◦ usually a condition ◦ sometimes the description of a state Path cost

Search Problem State space Initial state Successor function Goal test Path cost: ◦ [path  positive number] ◦ usually, path cost = sum of step costs ◦ e.g., number of moves of the empty tile

Example: 8-puzzle Initial state Goal state

Example: 8-puzzle Size of the state space = 9!/2 = 181, puzzle .65 x puzzle .5 x million states/sec 0.18 sec 6 days 12 billion years

Example: Robot navigation What is the state space ?

Example: Robot navigation Cost of one horizontal/vertical step = 1 Cost of one diagonal step =  2

Example: Robot navigation

Assumptions in Basic Search The environment is static The environment is discretizable The environment is observable The actions are deterministic

Simple Agent Algorithm Problem-Solving-Agent 1. initial-state  sense/read state 2. goal  select/read goal 3. successor  select/read action models 4. problem  (initial-state, goal, successor) 5. solution  search(problem) 6. perform(solution)

Search of State Space

 search tree

Basic Search Concepts Search tree Search node Node expansion Search strategy: At each stage it determines which node to expand

Search Nodes  States The search tree may be infinite even when the state space is finite The search tree may be infinite even when the state space is finite

14 Jan 2004CS Blind Search30 Implementation: states vs. nodes A state is a (representation of) a physical configuration A node is a data structure constituting part of a search tree includes state, parent node, action, path cost g(x), depth The Expand function creates new nodes, filling in the various fields and using the SuccessorFn of the problem to create the corresponding states.

Node Data Structure STATE PARENT ACTION COST DEPTH If a state is too large, it may be preferable to only represent the initial state and (re-)generate the other states when needed If a state is too large, it may be preferable to only represent the initial state and (re-)generate the other states when needed

Fringe Set of search nodes that have not been expanded yet Implemented as a queue FRINGE ◦ INSERT(node,FRINGE) ◦ REMOVE(FRINGE) The ordering of the nodes in FRINGE defines the search strategy

Search Algorithm 1. If GOAL?(initial-state) then return initial-state 2. INSERT(initial-node,FRINGE) 3. Repeat: If FRINGE is empty then return failure n  REMOVE(FRINGE) s  STATE(n) For every state s’ in SUCCESSORS(s)  Create a node n’  If GOAL?(s’) then return path or goal state  INSERT(n’,FRINGE)

Search Strategies A strategy is defined by picking the order of node expansion Performance Measures: ◦ Completeness – does it always find a solution if one exists? ◦ Time complexity – number of nodes generated/expanded ◦ Space complexity – maximum number of nodes in memory ◦ Optimality – does it always find a least-cost solution Time and space complexity are measured in terms of ◦ b – maximum branching factor of the search tree ◦ d – depth of the least-cost solution ◦ m – maximum depth of the state space (may be ∞)

Remark Some problems formulated as search problems are NP-hard (non-deterministic polynomial-time hard) problems. We cannot expect to solve such a problem in less than exponential time in the worst- casenon-deterministic polynomial-time But we can nevertheless strive to solve as many instances of the problem as possible

Blind vs. Heuristic Strategies Blind (or uninformed) strategies do not exploit any of the information contained in a state (or use only the information available in the problem definition) Heuristic (or informed) strategies exploits such information to assess that one node is “more promising” than another

Blind Strategies Breadth-first ◦ Bidirectional Depth-first ◦ Depth-limited ◦ Iterative deepening Uniform-Cost Step cost = 1 Step cost = c(action)   > 0

Breadth-First Strategy New nodes are inserted at the end of FRINGE FRINGE = (1)

Breadth-First Strategy New nodes are inserted at the end of FRINGE FRINGE = (2, 3)

Breadth-First Strategy New nodes are inserted at the end of FRINGE FRINGE = (3, 4, 5)

Breadth-First Strategy New nodes are inserted at the end of FRINGE FRINGE = (4, 5, 6, 7)

Evaluation b: branching factor d: depth of shallowest goal node Complete Optimal if step cost is 1 Number of nodes generated: 1 + b + b 2 + … + b d + b(b d -1) = O(b d+1 ) Time and space complexity is O(b d+1 )

Time and Memory Requirements d#NodesTimeMemory msec11 Kbytes 411,1111 msec1 Mbyte 6~ sec100 Mb 8~ sec10 Gbytes 10~ hours1 Tbyte 12~ days100 Tbytes 14~ years10,000 Tb Assumptions: b = 10; 1,000,000 nodes/sec; 100bytes/node

Bidirectional Strategy 2 fringe queues: FRINGE1 and FRINGE2 Time and space complexity = O(b d/2 ) << O(b d )

Depth-First Strategy New nodes are inserted at the front of FRINGE FRINGE = (1)

Depth-First Strategy New nodes are inserted at the front of FRINGE FRINGE = (2, 3)

Depth-First Strategy New nodes are inserted at the front of FRINGE FRINGE = (4, 5, 3)

Depth-First Strategy New nodes are inserted at the front of FRINGE

Depth-First Strategy New nodes are inserted at the front of FRINGE

Depth-First Strategy New nodes are inserted at the front of FRINGE

Depth-First Strategy New nodes are inserted at the front of FRINGE

Depth-First Strategy New nodes are inserted at the front of FRINGE

Depth-First Strategy New nodes are inserted at the front of FRINGE

Depth-First Strategy New nodes are inserted at the front of FRINGE

Depth-First Strategy New nodes are inserted at the front of FRINGE

Evaluation b: branching factor d: depth of shallowest goal node m: maximal depth of a leaf node Complete only for finite search tree Not optimal Number of nodes generated: 1 + b + b 2 + … + b m = O(b m ) Time complexity is O(b m ) Space complexity is O(bm)

Depth-Limited Strategy Depth-first with depth cutoff k (maximal depth below which nodes are not expanded) Three possible outcomes: ◦ Solution ◦ Failure (no solution) ◦ Cutoff (no solution within cutoff)

Iterative Deepening Strategy Repeat for k = 0, 1, 2, …: Perform depth-first with depth cutoff k Complete Optimal if step cost =1 Time complexity is: (d+1)(1) + db + (d-1)b 2 + … + (1) b d = O(b d ) Space complexity is: O(bd)

14 Jan 2004CS Blind Search59 Iterative deepening search

14 Jan 2004CS Blind Search60 Iterative deepening search l =0

14 Jan 2004CS Blind Search61 Iterative deepening search l =1

14 Jan 2004CS Blind Search62 Iterative deepening search l =2

14 Jan 2004CS Blind Search63 Iterative deepening search l =3

Comparison of Strategies Breadth-first is complete and optimal, but has high space complexity Depth-first is space efficient, but neither complete nor optimal Iterative deepening is asymptotically optimal

Repeated States 8-queens No assembly planning Few puzzle and robot navigation Many search tree is finitesearch tree is infinite

Avoiding Repeated States Requires comparing state descriptions Breadth-first strategy: ◦ Keep track of all generated states ◦ If the state of a new node already exists, then discard the node

Avoiding Repeated States Depth-first strategy: ◦ Solution 1:  Keep track of all states associated with nodes in current tree  If the state of a new node already exists, then discard the node  Avoids loops ◦ Solution 2:  Keep track of all states generated so far  If the state of a new node has already been generated, then discard the node  Space complexity of breadth-first

Detecting Identical States Use explicit representation of state space Use hash-code or similar representation

Uniform-Cost Strategy Each step has some cost   > 0. The cost of the path to each fringe node N is g(N) =  costs of all steps. The goal is to generate a solution path of minimal cost. The queue FRINGE is sorted in increasing cost. S 0 1 A 5 B 15 C SG A B C G 11 G 10

Uniform-Cost Strategy

Summary Search tree  state space Search strategies: breadth-first, depth-first, and variants Evaluation of strategies: completeness, optimality, time and space complexity Avoiding repeated states Optimal search with variable step costs