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

Similar documents
Solving Problems by Searching

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

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

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

Artificial Intelligence: Search Part 1: Uninformed graph search

Problem solving and search

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

CS:4420 Artificial Intelligence

4. Solving Problems by Searching

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

Problem solving and search: Chapter 3, Sections 1 5

Problem solving and search: Chapter 3, Sections 1 5

Seminar: Search and Optimization

Problem solving and search

AGENTS AND ENVIRONMENTS. What is AI in reality?

AGENTS AND ENVIRONMENTS. What is AI in reality?

Problem solving and search

Problem solving and search

Solving Problems by Searching

Solving Problems by Searching

Robot Programming with Lisp

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

Artificial Intelligence

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

CS 331: Artificial Intelligence Uninformed Search. Real World Search Problems

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

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

Problem solving and search

Problem solving by search

Problem solving and search

Problem Solving and Search. Chapter 3

Solving problems by searching

Search. Intelligent agents. Problem-solving. Problem-solving agents. Road map of Romania. The components of a problem. that will take me to the goal!

Introduction to Artificial Intelligence. Informed Search

CS 331: Artificial Intelligence Uninformed Search. Real World Search Problems

Problem solving and search

COMP9414/ 9814/ 3411: Artificial Intelligence. 5. Informed Search. Russell & Norvig, Chapter 3. UNSW c Alan Blair,

Artificial Intelligence. Informed search methods

Problem Solving as Search. CMPSCI 383 September 15, 2011

Informed search algorithms

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

PEAS: Medical diagnosis system

CS 331: Artificial Intelligence Uninformed Search. Leftovers from last time

Informed search algorithms

Informed Search. Topics. Review: Tree Search. What is Informed Search? Best-First Search

Solving Problems by Searching

Informed Search Algorithms. Chapter 4

Artificial Intelligence: Search Part 2: Heuristic search

Solving Problems using Search

Informed search algorithms. Chapter 4, Sections 1 2 1

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

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

Artificial Intelligence

Overview. Path Cost Function. Real Life Problems. COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

Solving problems by searching

Solving Problems by Searching. Artificial Intelligence Santa Clara University 2016

Outline. Informed search algorithms. Best-first search. Review: Tree search. A search Heuristics. Chapter 4, Sections 1 2 4

Solving problems by searching

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

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

CS:4420 Artificial Intelligence

Artificial Intelligence

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

Solving Problem by Searching. Chapter 3

Chapter 2. Blind Search 8/19/2017

Solving problems by searching

Problem Solving and Search. Geraint A. Wiggins Professor of Computational Creativity Department of Computer Science Vrije Universiteit Brussel

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

Informed search algorithms

Uninformed Search B. Navigating through a search tree. Navigating through a search tree. Navigating through a search tree

Informed Search and Exploration

Solving problems by searching

CS 771 Artificial Intelligence. Problem Solving by Searching Uninformed search

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,

CS 380: Artificial Intelligence Lecture #3

Uninformed Search B. Navigating through a search tree. Navigating through a search tree. Navigating through a search tree

COSC343: Artificial Intelligence

CAP 4630 Artificial Intelligence

PROBLEM SOLVING AND SEARCH IN ARTIFICIAL INTELLIGENCE

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.

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

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

Informed Search and Exploration

KI-Programmierung. Basic Search Algorithms

CS 8520: Artificial Intelligence

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

Informed Search and Exploration

Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu. Blind Searches

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Artificial Intelligence

Planning, Execution & Learning 1. Heuristic Search Planning

Solving problems by searching. Chapter 3

Problem solving and search

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

Searching and NetLogo

Foundations of Artificial Intelligence

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

AI: problem solving and search

Algorithms for Data Structures: Uninformed Search. Phillip Smith 19/11/2013

Transcription:

Outline Solving Problems by Searching S/ University of Waterloo Sept 7, 009 Problem solving agents and search Examples Properties of search algorithms Uninformed search readth first Depth first Iterative Deepening Introduction Problem-solving agents Search was one of the first topics studied in I Newell and Simon (9) General Problem Solver entral component to many I systems utomated reasoning, theorem proving, robot navigation, VLSI layout, scheduling, game playing,

Start Example: Traveling in Romania 7 7 Dobreta Formulate Goal Get to ucharest 0 70 7 Lugoj Mehadia 0 0 99 raiova Fagaras Rimnicu Vilcea 97 Pitesti Neamt 0 ucharest Giurgiu Formulate Problem Find a solution Initial state: In() Sequence of cities:, ctions: Drive between cities, Fagaras, ucharest Goal Test: In(ucharest)? Path cost: Distance between cities 7 90 7 Iasi Urziceni End 9 9 Vaslui Hirsova Eforie Examples of Search Problems 7 Start State 7 Goal State States: Locations of tiles and blank Initial State: ny state Initial State: No queens on the board Succ Func: Generates legal states that result from trying actions (blank up, Succ Func: dd a queen to an empty down, left, right) space Goal test: Does state match desired configuration Path cost: Number of steps States: rrangement of 0 to queens on the board Goal test: queens on board, none attacked Path cost: none More Examples ommon haracteristics ll of those examples are Fully observable Deterministic Sequential Static Discrete Single agent an be tackled by simple search techniques 9 0 annot tackle these yet hance Infinite number of states Hidden states ll of the above Games against an adversary Searching We can formulate a search problem Now need to find the solution We can visualize a state space search in terms of trees or graphs Nodes correspond to states Edges correspond to taking actions We will be studying search trees These trees are constructed on the fly by our algorithms

Data Structures for Search asic data structure: Search Node State Parent node and operator applied to parent to reach current node ost of the path so far Depth of the node PRENT NODE Expanding Nodes Expanding a node pplying all legal operators to the state contained in the node and generating nodes for all corresponding successor states (a) The initial state (b) fter expanding Fagaras Rimnicu Vilcea Lugoj TION = right Node DEPTH = PTH OST = STTE Fagaras Rimnicu Vilcea Lugoj (c) fter expanding 7 Fagaras Rimnicu Vilcea Lugoj Generic Search lgorithm. Initialize search algorithm with initial state of the problem. Repeat. If no candidate nodes can be expanded, return failure. hoose leaf node for expansion, according to search strategy. If node contains a goal state, return solution. Otherwise, expand the node, by applying legal operators to the state within the node. dd resulting nodes to the tree Implementation Details We need to only keep track of nodes that need to be expanded (fringe) Done by using a (prioritized) queue. Initialize queue by inserting the node corresponding to the initial state of the problem. Repeat. If queue is empty, return failure. Dequeue a node. If the node contains a goal state, return solution. Otherwise, expand node by applying legal operators to the state within. Insert resulting nodes into queue Search algorithms differ in their queuing function! readth-first search ll nodes on a given level are expanded before any nodes on the next level are expanded. Implemented with a FIFO queue,,d,e D,E,F,G Evaluating search algorithms ompleteness: Is the algorithm guaranteed to find a solution if a solution exists? Optimality: Does the algorithm find the optimal solution (Lowest path cost of all solutions) Time complexity Space complexity Variables b ranching factor d Depth of shallowest goal node m Maximum length of any path in the state space 7

Judging FS omplete:, if b is finite Optimal:, if all costs are the same Time: +b+b +b + +b d = O(b d ) Space: O(b d ) ll uninformed search methods will have exponential time complexity 9 Uniform ost Search variation of breadth-first search Instead of expanding shallowest node it expands the node with lowest path cost Implemented using a priority queue Optimal omplete if ε > 0 Time: O(b ceiling(*/ε ) ) Space: O(b ceiling(*/ε ) ) * is cost of optimal solution ε is minimum action cost 0

Judging DFS omplete: No, might get stuck going down a long path Optimal: No, might return a solution which is deeper (i.e. more costly) than another solution Time: O(b m ), m might be larger than d Space: O(bm) Do not use DFS if you suspect a large tree depth 7 Depth-limited search We can avoid the problem of unbounded trees by using a depth limit, l ll nodes at depth l are treated as though they have no successors If possible, choose l based on knowledge of the problem Time: O(b l ) Memory: O(bl) omplete?: No Optimal?: No Iterative-deepening General strategy that repeatedly does depthlimited search, but increases the limit each time Iterative-deepening IDS is not as wasteful as one might think. Note, most nodes in a tree are at the bottom level. It does not matter if nodes at a higher level are generated multiple times. readth first search : + b + b + + b d- + b d E.g. b=0, d=: +0+00+,000+0,000+00,000 =, Iterative deepening search : (d+)* + (d)*b + (d-)*b + + b d- + b d E.g. +0+00+000+0,000+00,000 =, omplete, Optimal, O(b d ) time, O(bd) space 9 0

Summary Problem formulation usually requires abstracting away real-world details to define a state space that can feasibly be explored Variety of uninformed search strategies ssume no knowledge about the problem (general but expensive) Mainly differ in the order in which they consider the states Summary Iterative deepening uses only linear space and not much more time than other uninformed search algorithms Use IDS when there is a large state space and the maximum depth of the solution is unknown riteria omplete Time Space Optimal FS O(b d ) O(b d ) Uniform DFS DLS No No O(b ceiling(*/ε) ) O(b m ) O(b l ) O(b ceiling(*/ε) ) O(bm) O(bl) No No IDS O(b d ) O(bd) Things to think about: What about searching graphs? Repeated states? Next lass Informed search techniques Russell & Norvig: Sections.-.