Solving problems by searching

Similar documents
Solving problems by searching

Chapter 2. Blind Search 8/19/2017

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

CS 380: Artificial Intelligence Lecture #3

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Solving Problem by Searching. Chapter 3

Solving problems by searching

CS 8520: Artificial Intelligence

Solving problems by searching. Chapter 3

Artificial Intelligence Problem Solving and Uninformed Search

Multiagent Systems Problem Solving and Uninformed Search

Solving problems by searching

Problem solving and search

ITCS 6150 Intelligent Systems. Lecture 3 Uninformed Searches

AI: problem solving and search

Problem Solving by Searching

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

Problem solving and search: Chapter 3, Sections 1 5

Problem solving and search: Chapter 3, Sections 1 5

Chapter 3 Solving problems by searching

Solving Problems: Blind Search

Solving Problems by Searching. AIMA Sections , 3.6

Problem solving and search

KI-Programmierung. Basic Search Algorithms

Problem Solving and Search

Problem solving and search

Problem solving and search

Artificial Intelligence Uninformed search

Problem solving and search

Solving Problems by Searching (Blindly)

Problem solving and search

Goal-Based Agents Problem solving as search. Outline

Problem solving by search

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

Reminders. Problem solving and search. Problem-solving agents. Outline. Assignment 0 due 5pm today

Problem solving and search

Artificial Intelligence

Problem-solving agents. Problem solving and search. Example: Romania. Reminders. Example: Romania. Outline. Chapter 3

Outline. Problem solving and search. Problem-solving agents. Example: Romania. Example: Romania. Problem types. Problem-solving agents.

CS 771 Artificial Intelligence. Problem Solving by Searching Uninformed search

Artificial Intelligence

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

Solving Problems by Searching

CS 151: Intelligent Agents, Problem Formulation and Search

ARTIFICIAL INTELLIGENCE. Pathfinding and search

Problem solving and search

Search EECS 395/495 Intro to Artificial Intelligence

Search EECS 348 Intro to Artificial Intelligence

Problem solving Basic search. Example: Romania. Example: Romania. Problem types. Intelligent Systems and HCI D7023E. Single-state problem formulation

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

Pengju XJTU 2016

4. Solving Problems by Searching

Solving problems by searching

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

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

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

Solving Problems by Searching

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

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

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

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

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.

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

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

Pengju

Artificial Intelligence: Search Part 1: Uninformed graph search

Artificial Intelligence

Solving problems by searching

Solving problems by searching

Ar#ficial)Intelligence!!

Robot Programming with Lisp

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)

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

Lecture 3. Uninformed Search

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

Problem Solving and Search. Chapter 3

AGENTS AND ENVIRONMENTS. What is AI in reality?

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

ARTIFICIAL INTELLIGENCE SOLVING PROBLEMS BY SEARCHING. Chapter 3

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

521495A: Artificial Intelligence

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

A2 Uninformed Search

Example: The 8-puzzle. A2 Uninformed Search. It can be generalized to 15-puzzle, 24-puzzle, or. (n 2 1)-puzzle for n 6. Department of Computer Science

AGENTS AND ENVIRONMENTS. What is AI in reality?

Solving Problems by Searching

Solving Problems by Searching

Problem Solving as Search. CMPSCI 383 September 15, 2011

Chapter 3: Solving Problems by Searching

DFS. Depth-limited Search

Problem-solving agents. Solving Problems by Searching. Outline. Example: Romania. Chapter 3

Uninformed search strategies (Section 3.4) Source: Fotolia

CAP 4630 Artificial Intelligence

Review Search. This material: Chapter 1 4 (3 rd ed.) Read Chapter 18 (Learning from Examples) for next week

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

Uninformed Search Strategies AIMA

Outline. Solving Problems by Searching. Introduction. Problem-solving agents

CS:4420 Artificial Intelligence

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

Transcription:

Solving problems by searching 1 C H A P T E R 3

Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms Outline 2

Problem-solving agents 3 Note: this is offline problem solving; solution executed eyes closed.

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 4

Example: Romania 5 Abstraction: The process of removing details from a representation Is the map a good representation of the problem? What is a good replacement?

Problem types Deterministic, fully observable single-state problem Agent knows exactly which state it will be in; solution is a sequence Vacuum world everything observed Romania The full map is observed 6 Single-state: Start in #5. Solution?? [Right, Suck]

Problem types Non-observable sensorless problem (conformant problem) Agent may have no idea where it is; solution is a sequence Vacuum world No sensors Romania No map just know operators(cities you can move to) 7 Conformant: Start in {1, 2, 3, 4, 5, 6, 7, 8} e.g., Right goes to {2, 4, 6, 8}. Solution?? [Right, Suck,Left, Suck]

Problem types Nondeterministic and/or partially observable contingency problem percepts provide new information about current state Unknown state space exploration problem Vacuum world know state of current location Romania know current location and neighbor cities Contingency: [L,clean] Start in #5 or #7 Murphy s Law: Suck can dirty a clean carpet Local sensing: dirt, location only. Solution?? [Right, if dirt then Suck] 8

Single-state problem formulation A problem is defined by four items: 9 1. initial state e.g., "at Arad 2. actions or successor function S(x) = set of action state pairs e.g., S(Arad) = {<Arad Zerind, Zerind>, } 3. goal test, can be explicit, e.g., x = "at Bucharest" implicit, e.g., Checkmate(x) 4. path cost (additive) e.g., sum of distances, number of actions executed, etc. c(x,a,y) is the step cost, assumed to be 0 A solution is a sequence of actions leading from the initial state to a goal state

Selecting a state space Real world is absurdly complex state space must be abstracted for problem solving (Abstract) state = set of real states (Abstract) action = complex combination of real actions e.g., "Arad Zerind" represents a complex set of possible routes, detours, rest stops, etc. (Abstract) solution = set of real paths that are solutions in the real world 10 Each abstract action should be "easier" than the original problem

Vacuum world state space graph 11 states? actions? goal test? path cost?

Vacuum world state space graph 12 states? integer dirt and robot location actions? Left, Right, Suck goal test? no dirt at all locations path cost? 1 per action

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

Example: The 8-puzzle 14 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]

Example: robotic assembly 15 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

Basic idea: Tree search algorithms 16 offline, simulated exploration of state space by generating successors of already-explored states (a.k.a.~expanding states)

Tree search example 17

Tree search example 18

Tree search example 19

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? 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 ) 20

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

Breadth-first search Expand shallowest unexpanded node Implementation: fringe is a FIFO queue, i.e., new successors go at end 22

Breadth-first search 23 Expand shallowest unexpanded node Implementation: fringe is a FIFO queue, i.e., new successors go at end

Breadth-first search Expand shallowest unexpanded node Implementation: fringe is a FIFO queue, i.e., new successors go at end 24

Breadth-first search Expand shallowest unexpanded node Implementation: fringe is a FIFO queue, i.e., new successors go at end 25

Properties of breadth-first search Complete? Time? Space?Optimal? Complete? Yes (if b is finite) Time? 1+b+b 2 +b 3 + +b d + b(b d -1) = O(b d+1 ) Space? O(b d+1 ) (keeps every node in memory) Optimal? Yes (if cost = 1 per step) Space is the bigger problem (more than time) 26

Uniform-cost search Expand least-cost unexpanded node Implementation: fringe = queue ordered by path cost Equivalent to breadth-first if step costs all equal Complete? Yes, if step cost ε Time? O(b ceiling(c*/ ε) ) where C * is the cost of the optimal solution Space? O(b ceiling(c*/ ε) ) Optimal? Yes nodes expanded in increasing order of g(n) 27

Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front 28

Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front 29

Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front 30

Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front 31

Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front 32

Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front 33

Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front 34

Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front 35

Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front 36

Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front 37

Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front 38

Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front 39

Properties of depth-first search Complete? Time? Space?Optimal? Complete? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path complete in finite spaces Time? O(b m ): terrible if m is much larger than d but if solutions are dense, may be much faster than breadth-first Space? O(bm), i.e., linear space! Optimal? No 40

Depth-limited search depth-first search with depth limit l, i.e., nodes at depth l have no successors Solves infinite loop problem Complete? No if l < d: 41 Time? O(b l ): Space? O(bl), i.e., linear space! Optimal? No if l > b

Iterative deepening search 42

Iterative deepening search l =0 43

Iterative deepening search l =1 44

Iterative deepening search l =2 45

Iterative deepening search l =3 46

Iterative deepening search 47 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%

Properties of iterative deepening search Complete? Yes Time? (d+1)b 0 + d b 1 + (d-1)b 2 + + b d = O(b d ) Space? O(bd) Optimal? Yes, if step cost = 1 48

Bidirectional serach 49 Motivation : time O(b d/2 ) Example d=6, b=10 BFS = 11,111,000 nodes Bidirectional = 22 200 nodes

Properties of Bidirectional search Complete? Yes Time? O(b d/2 ) Space? O(b d/2 ) Optimal? Yes 50

Summary of algorithms 51

Repeated states Failure to detect repeated states can turn a linear problem into an exponential one! 52

Graph search 53

Summary 54 Problem formulation usually requires abstracting away real-world details to define a state space that can feasibly be explored Variety of uninformed search strategies Iterative deepening search uses only linear space and not much more time than other uninformed algorithms