Search EECS 348 Intro to Artificial Intelligence

Similar documents
Search EECS 395/495 Intro to Artificial Intelligence

Uninformed Search. Chapter 3

Uninformed Search. Chapter 3. (Based on slides by Stuart Russell, Subbarao Kambhampati, Dan Weld, Oren Etzioni, Henry Kautz, and other UW-AI faculty)

Outline. Solving problems by searching. Problem-solving agents. Example: Romania

Solving problems by searching

Chapter 2. Blind Search 8/19/2017

CS 380: Artificial Intelligence Lecture #3

CS 8520: Artificial Intelligence

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Solving Problem by Searching. Chapter 3

Solving problems by searching

Solving problems by searching

Problem Solving and Search

Solving problems by searching

Problem solving and search

Artificial Intelligence

Basic Search. Fall Xin Yao. Artificial Intelligence: Basic Search

Chapter 3 Solving problems by searching

CS 4700: Foundations of Artificial Intelligence. Bart Selman. Search Techniques R&N: Chapter 3

Solving Problems by Searching (Blindly)

Search I. slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig

CS 771 Artificial Intelligence. Problem Solving by Searching Uninformed search

Solving Problems: Blind Search

Set 2: State-spaces and Uninformed Search. ICS 271 Fall 2015 Kalev Kask

ARTIFICIAL INTELLIGENCE (CSC9YE ) LECTURES 2 AND 3: PROBLEM SOLVING

KI-Programmierung. Basic Search Algorithms

Artificial Intelligence Problem Solving and Uninformed Search

Solving problems by searching. Chapter 3

Problem solving and search

Problem solving and search

AI: problem solving and search

Week 3: Path Search. COMP9414/ 9814/ 3411: Artificial Intelligence. Motivation. Example: Romania. Romania Street Map. Russell & Norvig, Chapter 3.

COMP219: Artificial Intelligence. Lecture 7: Search Strategies

Multiagent Systems Problem Solving and Uninformed Search

Problem Spaces & Search CSE 473

Uninformed Search. Problem-solving agents. Tree search algorithms. Single-State Problems

ARTIFICIAL INTELLIGENCE SOLVING PROBLEMS BY SEARCHING. Chapter 3

Solving Problems by Searching

CS486/686 Lecture Slides (c) 2015 P.Poupart

Chapter3. Problem-Solving Agents. Problem Solving Agents (cont.) Well-defined Problems and Solutions. Example Problems.

CS486/686 Lecture Slides (c) 2014 P.Poupart

ARTIFICIAL INTELLIGENCE. Pathfinding and search

Chapter 3. A problem-solving agent is a kind of goal-based agent. It decide what to do by finding sequences of actions that lead to desirable states.

Problem solving and search

Artificial Intelligence

Artificial Intelligence

CAP 4630 Artificial Intelligence

Solving Problems by Searching. AIMA Sections , 3.6

4. Solving Problems by Searching

Solving Problems by Searching

DFS. Depth-limited Search

521495A: Artificial Intelligence

Uninformed Search. Reading: Chapter 4 (Tuesday, 2/5) HW#1 due next Tuesday

Goal-Based Agents Problem solving as search. Outline

Blind (Uninformed) Search (Where we systematically explore alternatives)

Why Search. Things to consider. Example, a holiday in Jamaica. CSE 3401: Intro to Artificial Intelligence Uninformed Search

Robot Programming with Lisp

Problem solving and search

S A E RC R H C I H NG N G IN N S T S A T T A E E G R G A R PH P S

Graph Search. Chris Amato Northeastern University. Some images and slides are used from: Rob Platt, CS188 UC Berkeley, AIMA

Artificial Intelligence, CS, Nanjing University Spring, 2018, Yang Yu. Lecture 2: Search 1.

Chapter 3: Solving Problems by Searching

Pengju XJTU 2016

COMP3702/7702 Artificial Intelligence Week2: Search (Russell & Norvig ch. 3)" Hanna Kurniawati"

CSC 2114: Artificial Intelligence Search

Intelligent Agents. Foundations of Artificial Intelligence. Problem-Solving as Search. A Simple Reflex Agent. Agent with Model and Internal State

Solving Problems by Searching

Solving Problems by Searching

Planning and search. Lecture 1: Introduction and Revision of Search. Lecture 1: Introduction and Revision of Search 1

Problem solving and search

Artificial Intelligence Uninformed search

Uninformed Search Methods

Ar#ficial)Intelligence!!

Search Algorithms. Uninformed Blind search. Informed Heuristic search. Important concepts:

Uninformed Search Strategies

Problem solving and search: Chapter 3, Sections 1 5

Problem solving and search: Chapter 3, Sections 1 5

Artificial Intelligence: Search Part 1: Uninformed graph search

Solving problems by searching

Solving problems by searching

ITCS 6150 Intelligent Systems. Lecture 3 Uninformed Searches

Solving Problems by Searching

Blind (Uninformed) Search (Where we systematically explore alternatives)

Uninformed search strategies (Section 3.4) Source: Fotolia

Announcements. Project 0: Python Tutorial Due last night

Graphs vs trees up front; use grid too; discuss for BFS, DFS, IDS, UCS Cut back on A* optimality detail; a bit more on importance of heuristics,

Pengju

AGENTS AND ENVIRONMENTS. What is AI in reality?

A4B36ZUI - Introduction ARTIFICIAL INTELLIGENCE

CSE 473. Chapter 4 Informed Search. CSE AI Faculty. Last Time. Blind Search BFS UC-BFS DFS DLS Iterative Deepening Bidirectional Search

Problem Solving and Search. Chapter 3

AGENTS AND ENVIRONMENTS. What is AI in reality?

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 19 January, 2018

HW#1 due today. HW#2 due Monday, 9/09/13, in class Continue reading Chapter 3

Today s s lecture. Lecture 2: Search - 1. Examples of toy problems. Searching for Solutions. Victor R. Lesser

Problem solving by search

Problem Solving by Searching

Outline. Solving problems by searching. Prologue. Example: Romania. Uninformed search

Outline. Best-first search

Problem solving and search

Transcription:

Search EECS 348 Intro to Artificial Intelligence (slides from Oren Etzioni, based on Stuart Russell, Dan Weld, Henry Kautz, and others)

What is Search? Search is a class of techniques for systematically finding or constructing solutions to problems. Example technique: generate-and-test. Example problem: Combination lock. 1. Generate a possible solution. 2. Test the solution. 3. If solution found THEN done ELSE return to step 1. 2

Search thru a Problem Space / State Space Input: Set of states Operators [and costs] Start state Goal state [test] Output: Path: start a state satisfying goal test [May require shortest path] 3

Why is search interesting? Many (all?) AI problems can be formulated as search problems! Examples: Path planning Games Natural Language Processing Machine learning Genetic algorithms 4

Example: The 8-puzzle states? actions? goal test? path cost? 5

Example: The 8-puzzle states? locations of tiles actions? move blank left, right, up, down goal test? = goal state (given) path cost? 1 per move [Note: optimal solution of n-puzzle family is NP-hard] 6

Search Tree Example: Fragment of 8-Puzzle Problem Space 7

Example: robotic assembly states?: real-valued coordinates of robot joint angles parts of the object to be assembled actions?: continuous motions of robot joints goal test?: complete assembly path cost?: time to execute 8

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. 9

Tree Search Fringe = root node Repeat while Fringe non-empty Take n from Fringe If n is a goal break (we re done) Else Add Expand(n ) to Fringe If n is a goal, return path to n Otherwise return failure 10

Search strategies A search strategy is defined by picking the order of node expansion Strategies are evaluated along the following dimensions: completeness: does it always find a solution if one exists? time complexity: number of nodes generated space complexity: maximum number of nodes in memory optimality: does it always find a least-cost solution? systematicity: does it visit each state at most once? 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 ) 11

Uninformed search strategies Uninformed search strategies use only the information available in the problem definition Breadth-first search Depth-first search Depth-limited search Iterative deepening search 12

Depth First Search Maintain stack of nodes to visit Evaluation Complete? Not for infinite spaces Time Complexity? O(b^m) Space Complexity? O(m) c d (though vanilla alg. in book has no backtracking, so O(mb)) b a e f g h 13

Breadth First Search Maintain queue of nodes to visit Evaluation Complete? Yes (assume b finite) Time Complexity? O(b^d) Space Complexity? a b c O(b^d) d e f g h 14

BFS: Memory Limitation Suppose: 4-core 2 GHz CPU 8 GB main memory 100 cycles / expansion 10 bytes / node 800,000 expansions / sec Memory filled in 100 sec < 2 minutes 15

Iterative deepening search 16

Iterative deepening search l =0 17

Iterative deepening search l =1 18

Iterative deepening search l =2 19

Iterative deepening search l =3 20

Iterative deepening search Number of nodes generated in a depth-limited search to depth d with branching factor b: N DLS = b 0 + b 1 + b 2 + + b d-2 + b d-1 + b d Number of nodes generated in an iterative deepening search to depth d with branching factor b: N IDS = (d+1)b 0 + d b^1 + (d-1)b^2 + + 3b d-2 +2b d-1 + 1b d For b = 10, d = 5, N DLS = 1 + 10 + 100 + 1,000 + 10,000 + 100,000 = 111,111 N IDS = 6 + 50 + 400 + 3,000 + 20,000 + 100,000 = 123,456 Overhead = (123,456-111,111)/111,111 = 11% 21

Cost of Iterative Deepening b ratio ID to DFS 2 3 3 2 5 1.5 10 1.2 25 1.08 100 1.02 22

iterative deepening search Complete? Yes Time? Space? (d+1)b 0 + d b 1 + (d-1)b 2 + + b d = O(b d ) O(d ) Optimal? Yes, if step cost = 1 Systematic? No, but okay 23

Repeated states (1 of 3) Failure to detect repeated states can turn a linear problem into an exponential one! 24

Repeated states (2 of 3) More realistic case: A B C D E F G H I J K L M N O P 25

Repeated states (3 of 3) Can save states but then iterative deepening with DFS no longer takes O(m) space! What space is required? 26

Forwards vs. Backwards 27

vs. Bidirectional 28

Recap: Tree Search Fringe = root node Repeat while fringe non-empty Take n from Fringe If n is a goal break (we re done) Else Expand n: add n s successors to Fringe If n is a goal, return path to n Otherwise return failure 29

Summary Search problems Search strategies DFS, BFS, Iterative Deepening w/depthlimited DFS Issue: All these methods are slow (blind) Solution add guidance ( heurstic estimate ) informed search 30

Backup 31

Example: Romania 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, e.g., Arad, Sibiu, Fagaras, Bucharest 32

Example: N Queens Input: Set of states Q Q Q Operators [and costs] Q Start state Goal state (test) Output 33