Russell and Norvig: Chapter 3, Sections 3.4 – 3.6

Slides:



Advertisements
Similar presentations
Artificial Intelligent
Advertisements

Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Additional Topics ARTIFICIAL INTELLIGENCE
Review: Search problem formulation
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Artificial Intelligence Problem Solving Eriq Muhammad Adams
Lecture 3: Uninformed Search
1 Lecture 3 Uninformed Search. 2 Uninformed search strategies Uninformed: While searching you have no clue whether one non-goal state is better than any.
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
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 Blind (Uninformed) Search (Where we systematically explore alternatives) R&N: Chap. 3, Sect. 3.3–5.
Implementation and Evaluation of Search Methods. Use a stack data structure. 1. Push root node of tree on the stack. 2. Pop the top node off the stack.
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 Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
CS 380: Artificial Intelligence Lecture #3 William Regli.
Review: Search problem formulation
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
Searching the search space graph
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
1 Lecture 3 Uninformed Search. 2 Complexity Recap (app.A) We often want to characterize algorithms independent of their implementation. “This algorithm.
1 Midterm Review cmsc421 Fall Outline Review the material covered by the midterm Questions?
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
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)
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Lecture 3: Uninformed Search
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.
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.
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.
Brian Williams, Fall 041 Analysis of Uninformed Search Methods Brian C. Williams Sep 21 st, 2004 Slides adapted from: Tomas Lozano Perez,
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Chapter 3 (Part-II) Section 3.4, 3.5, 3.6 Uninformed Search.
Lecture 3 Problem Solving through search Uninformed Search
Lecture 3: Uninformed Search
Review: Tree search Initialize the frontier using the starting state
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
Uninformed Search Chapter 3.4.
Problem Solving by Searching
Uninformed Search Strategies
Artificial Intelligence Solving problems by searching
Problem solving and search
Artificial Intelligence (CS 370D)
Search Tuomas Sandholm Read Russell & Norvig Sections
Artificial Intelligence
Solving problems by searching
CS 188: Artificial Intelligence Spring 2007
Search Tuomas Sandholm Read Russell & Norvig Sections
Problem Solving and Searching
What to do when you don’t know anything know nothing
EA C461 – Artificial Intelligence
Searching for Solutions
Problem Solving and Searching
Principles of Computing – UFCFA3-30-1
Russell and Norvig: Chapter 3, Sections 3.1 – 3.3
Problem Spaces & Search
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #2
CMSC 471 Fall 2011 Class #4 Tue 9/13/11 Uninformed Search
Presentation transcript:

Russell and Norvig: Chapter 3, Sections 3.4 – 3.6 Blind Search Russell and Norvig: Chapter 3, Sections 3.4 – 3.6

탐색: 인공지능과 알고리즘 알고리즘: 탐색공간이 사전에 알려져 있고, 크기도 제한됨 인공지능 주로 탐색 공간은 k*n으로 나타남 처리속도: Polynomial complexity 모든 탐색공간을 찾을 수 있으며, 최선의 값을 찾음 인공지능 탐색공간: 무한할 수 있으며, 유한하더라도 주로 polynomial함. 따라서 모든 탐색 공간을 찾을 수 없음. 탐색 과정에서 탐색공간을 생성할 때가 많음 처리속도: 주로 NP 문제임 가능한 값(feasible solution)을 찾음. 일반적으로 최선의 값은 알 수 없음. Blind Search

Simple Agent Algorithm Problem-Solving-Agent initial-state  sense/read state goal  select/read goal  goal formulation and test: a function for goal testing successor  select/read action models  successor function to calculate next states problem  (initial-state, goal, successor) solution  search(problem) perform(solution) Blind Search

Search of State Space  search tree Blind Search

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

Search Nodes  States The search tree may be infinite even 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 3 5 6 8 4 7 2 The search tree may be infinite even when the state space is finite Blind Search

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 Blind Search

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 Blind Search

Search Algorithm If GOAL?(initial-state) then return initial-state INSERT(initial-node,FRINGE) 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’ as a successor of n If GOAL?(s’) then return path or goal state INSERT(n’,FRINGE) Blind Search

Performance Measures Completeness Is the algorithm guaranteed to find a solution when there is one? Probabilistic completeness: If there is a solution, the probability that the algorithms finds one goes to 1 “quickly” with the running time Blind Search

Performance Measures Completeness Is the algorithm guaranteed to find a solution when there is one? Optimality Is this solution optimal? Time complexity How long does it take? Space complexity How much memory does it require? Blind Search

Important Parameters Maximum number of successors of any state  branching factor b of the search tree Minimal length of a path in the state space between the initial and a goal state  depth d of the shallowest goal node in the search tree Blind Search

Blind vs. Heuristic Strategies Blind (or un-informed) strategies do not exploit any of the information contained in a state Heuristic (or informed) strategies exploits such information to assess that one node is “more promising” than another Blind Search

Example: 8-puzzle For a heuristic strategy counting the number of misplaced tiles, N2 is more promising than N1 For a blind strategy, N1 and N2 are just two nodes (at some depth in the search tree) 1 2 3 4 5 6 7 8 Goal state N1 N2 STATE Blind Search

Important Remark Some problems formulated as search problems are NP-hard problems (e.g., (n2-1)-puzzle We cannot expect to solve such a problem in less than exponential time in the worst-case But we can nevertheless strive to solve as many instances of the problem as possible Blind Search

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

Breadth-First Strategy New nodes are inserted at the end of FRINGE 2 3 4 5 1 6 7 FRINGE = (1) Blind Search

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

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

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

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

Big O Notation g(n) is in O(f(n)) if there exist two positive constants a and N such that: for all n > N, g(n)  af(n) Blind Search

Time and Memory Requirements #Nodes Time Memory 2 111 .01 msec 11 Kbytes 4 11,111 1 msec 1 Mbyte 6 ~106 1 sec 100 Mb 8 ~108 100 sec 10 Gbytes 10 ~1010 2.8 hours 1 Tbyte 12 ~1012 11.6 days 100 Tbytes 14 ~1014 3.2 years 10,000 Tb Assumptions: b = 10; 1,000,000 nodes/sec; 100bytes/node Blind Search

Time and Memory Requirements #Nodes Time Memory 2 111 .01 msec 11 Kbytes 4 11,111 1 msec 1 Mbyte 6 ~106 1 sec 100 Mb 8 ~108 100 sec 10 Gbytes 10 ~1010 2.8 hours 1 Tbyte 12 ~1012 11.6 days 100 Tbytes 14 ~1014 3.2 years 10,000 Tb Assumptions: b = 10; 1,000,000 nodes/sec; 100bytes/node Blind Search

Bidirectional Strategy 2 fringe queues: FRINGE1 and FRINGE2 Time and space complexity = O(bd/2) << O(bd) Blind Search

Depth-First Strategy New nodes are inserted at the front of FRINGE 1 2 3 4 5 Blind Search

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

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

Depth-First Strategy New nodes are inserted at the front of FRINGE 1 2 3 4 5 Blind Search

Depth-First Strategy New nodes are inserted at the front of FRINGE 1 2 3 4 5 Blind Search

Depth-First Strategy New nodes are inserted at the front of FRINGE 1 2 3 4 5 Blind Search

Depth-First Strategy New nodes are inserted at the front of FRINGE 1 2 3 4 5 Blind Search

Depth-First Strategy New nodes are inserted at the front of FRINGE 1 2 3 4 5 Blind Search

Depth-First Strategy New nodes are inserted at the front of FRINGE 1 2 3 4 5 Blind Search

Depth-First Strategy New nodes are inserted at the front of FRINGE 1 2 3 4 5 Blind Search

Depth-First Strategy New nodes are inserted at the front of FRINGE 1 2 3 4 5 Blind Search

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 + b2 + … + bm = O(bm) Time complexity is O(bm) Space complexity is O(bm) or O(m) Blind Search

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) Blind Search

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)b2 + … + (1) bd = O(bd) Space complexity is: O(bd) or O(d) Blind Search

Calculation db + (d-1)b2 + … + (1) bd = bd + 2bd-1 + 3bd-2 +… + db  bd(Si=1,…, ib(1-i)) = bd (b/(b-1))2 Blind Search

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 Blind Search

Repeated States No Few Many 1 2 3 4 5 6 7 8 search tree is finite 8-queens No assembly planning Few 1 2 3 4 5 6 7 8 8-puzzle and robot navigation Many search tree is finite search tree is infinite Blind Search

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 The cost to find the repeated state (space and time) Blind Search

Avoiding Repeated States Depth-first strategy: Solution 1: Keep track of all states associated with nodes in current path 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 Blind Search

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

Revisiting Complexity Assume a state space of finite size s Let r be the maximal number of states that can be attained in one step from any state In the worst-case r = s-1 Assume breadth-first search with no repeated states Time complexity is O(rs). In the worst case it is O(s2) Blind Search

Example s = nx x ny r = 4 or 8 Time complexity is O(s) Blind Search

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 S G A B C 5 1 15 10 1 A 5 B 15 C G 11 G 10 Blind Search

Modified Search Algorithm INSERT(initial-node,FRINGE) Repeat: If FRINGE is empty then return failure n  REMOVE(FRINGE) s  STATE(n) If GOAL?(s) then return path or goal state For every state s’ in SUCCESSORS(s) Create a node n’ as a successor of n INSERT(n’,FRINGE) Blind Search

Exercises Adapt uniform-cost search to avoid repeated states while still finding the optimal solution Uniform-cost looks like breadth-first (it is exactly breadth first if the step cost is constant). Adapt iterative deepening in a similar way to handle variable step costs Blind Search

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 Blind Search